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. Does drawLine(...) draw endpoints?
Qt 6.11 is out! See what's new in the release blog

Does drawLine(...) draw endpoints?

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

    There's nothing said about the endpoints in documentation: https://doc.qt.io/qt-6/qpainter.html#drawLine-2

    If it doesn't, how do I know it (without manual testing)?

    SGaistS 1 Reply Last reply
    0
    • SGaistS SGaist moved this topic from Qt in Education on
    • W wpnwbn

      There's nothing said about the endpoints in documentation: https://doc.qt.io/qt-6/qpainter.html#drawLine-2

      If it doesn't, how do I know it (without manual testing)?

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean something like drawing arrows on each end of the line ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      W 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Do you mean something like drawing arrows on each end of the line ?

        W Offline
        W Offline
        wpnwbn
        wrote on last edited by wpnwbn
        #3

        @SGaist Hello,
        No. Suppose we have some vertex and a bunch (say, N) of edges connected to it. I iterate over each edge, drawing it with drawLine, and I want to know, will the vertex be drawn N times? Will the pixel, containing the vertex, be redrawn N times?

        If it will, that means, that if I drew all edges with some transparency, the pixel, containing the vertex, would be more opaque than the edges.

        Or maybe the point-difference will be just too negligible to have some effect on the color of the pixel...

        SGaistS 1 Reply Last reply
        0
        • W wpnwbn

          @SGaist Hello,
          No. Suppose we have some vertex and a bunch (say, N) of edges connected to it. I iterate over each edge, drawing it with drawLine, and I want to know, will the vertex be drawn N times? Will the pixel, containing the vertex, be redrawn N times?

          If it will, that means, that if I drew all edges with some transparency, the pixel, containing the vertex, would be more opaque than the edges.

          Or maybe the point-difference will be just too negligible to have some effect on the color of the pixel...

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          That's a good question, I currently don't remember whether there will be optimisation in the backend if several operations happens on the same segment.

          Based on the names you use, wouldn't it make more sense to use OpenGL ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - 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