Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

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

    General and Desktop
    3
    5
    1923
    Loading More Posts
    • 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
      Salvatello last edited by

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

      1 Reply Last reply Reply Quote 0
      • Chris Kawa
        Chris Kawa Moderators last edited by

        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 Reply Quote 0
        • S
          Salvatello last edited by

          I solved it.
          I used qgraphicsview.

          1 Reply Last reply Reply Quote 0
          • M
            maximus last edited by

            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 Reply Quote 0
            • S
              Salvatello last edited by

              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 Reply Quote 0
              • First post
                Last post