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. [SOLVED] DRAW A LINE IN A QWidget OR QLabels OR QFRAME OR OTHER

[SOLVED] DRAW A LINE IN A QWidget OR QLabels OR QFRAME OR OTHER

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.3k 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.
  • S Offline
    S Offline
    Salvatello
    wrote on last edited by
    #1

    I would like to draw a line in a QLabels, or QWidget, or qframe or other

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Subclass that class you want and implement paintEvent by first calling the base implementation and then do your drawing using QPainter.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Salvatello
        wrote on last edited by
        #3

        I solved it.
        I used qgraphicsview.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          maximus
          wrote on last edited by
          #4

          You can also use QFrame with the option "frameShape" to HLine or VLine. possible to customize the line with Stylesheet,

          good luck!


          Free Indoor Cycling Software - https://maximumtrainer.com

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Salvatello
            wrote on last edited by
            #5

            I actually I needed a subject on which you can draw lines, rectangles, circles, etc. ..
            for the moment with qgraphicsview I can do what I need. I do not know if we will have problems. But for the moment I can do lines, circles, rectangles, etc. ..

            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