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. Simplest approach for drawing simple structures (rectangles, lines) in an application?
Forum Updated to NodeBB v4.3 + New Features

Simplest approach for drawing simple structures (rectangles, lines) in an application?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.4k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    BDifferent
    wrote on last edited by
    #1

    Dear all,

    I am new to Qt and I am a bit confused which class to use for my problem at hand. I want to draw some very simple geometric structures (lines, rectangles) in my window, just like a labyrinth seen from above. Having used the C++ Builder before (previously Borland, now Embarcadero), there my approach was to place a "TImage" in my window, define brush and pen color and then draw onto the TImage's "TCanvas". Is there some similar approach in the Qt API?
    The drawing does not have to be very fast, for the moment simplicity is the main goal. QGraphicsView seems to be overkill for my purpose; first I thought QPicture/QPainter was the way to go, but now I am not so sure about that anymore, since the QPainter approach of recording drawing commands does not quite seem to fit, but maybe I just have to get used to it ...

    Which approach would you recommend?

    Thanks in advance!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      It all depends, and there are lots of options.

      There is QtQuick, there is QtQuickCanvas (it uses HTML5 canvas API), QGraphicsView and QPainter. All with advantages and disadvantages.

      The easiest to use is probably QtQuick (QML), it also is easy to learn and development usually goes pretty fast in it.

      (Z(:^

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BDifferent
        wrote on last edited by
        #3

        Thank you for your answer, I will first give QPainter a try, in case of questions I will return here :-)

        Have a nice weekend.

        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