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. How can i draw multiple rectangle in c++ qtcreator?
QtWS25 Last Chance

How can i draw multiple rectangle in c++ qtcreator?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 522 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.
  • I Offline
    I Offline
    ioanna
    wrote on last edited by
    #1

    04b9c8c8-d649-4a90-aedf-61f9d172cab4-image.png

    How can i attain something like this in qtcreator?

    jsulmJ 1 Reply Last reply
    0
    • I ioanna

      04b9c8c8-d649-4a90-aedf-61f9d172cab4-image.png

      How can i attain something like this in qtcreator?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @ioanna Do you want to draw charts or simply rectangles?
      Painting is done using https://doc.qt.io/qt-5/qpainter.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply
      1
      • jsulmJ jsulm

        @ioanna Do you want to draw charts or simply rectangles?
        Painting is done using https://doc.qt.io/qt-5/qpainter.html

        I Offline
        I Offline
        ioanna
        wrote on last edited by
        #3

        @jsulm how sir how can i paint inside pushbutton slot? I am just drawing rectangle i'm not going with graph.

        jsulmJ 1 Reply Last reply
        0
        • I ioanna

          @jsulm how sir how can i paint inside pushbutton slot? I am just drawing rectangle i'm not going with graph.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ioanna You don't draw in the button slot, you draw in paintEvent of the widget where you want to draw. In button slot you call update() on the widget where you want to draw.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          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