Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Which widget to use for a pixel art editor?
Qt 6.11 is out! See what's new in the release blog

Which widget to use for a pixel art editor?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Papipone
    wrote on last edited by
    #1

    I am exploring some functionalities of Qt I never used. I am currently developing a pixel art editor but I do not know which widget is the best for 2D drawing. I have considered to create a widget and embed an OpenGL context inside it.

    Based on your experiences, what is the best way to draw 2D graphics with Qt?

    Thanks for your answers.

    1 Reply Last reply
    0
    • njbrownN Offline
      njbrownN Offline
      njbrown
      wrote on last edited by
      #2

      A regular QWidget should do just fine. Override the paintEvent, create a QPainter instance and start drawing.
      QT comes with a few painting examples you can look at.

      https://doc.qt.io/qt-5/qtwidgets-tools-plugandpaint-app-example.html
      http://doc.qt.io/qt-5/qtwidgets-painting-basicdrawing-example.html

      Found an open-source qt paint app you can check out too:
      https://github.com/kkonopko/Paint

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Papipone
        wrote on last edited by Papipone
        #3

        Thanks, I already checked the examples. I will go for a QWidget and look for GL solutions if I encounter a problem (I want to be able to apply convolution matrices, paths for shifting colors for instance, ...).

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jamesoleg2
          wrote on last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved