Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QSGGeometry how to draw disk points and not squared ones
Forum Update on Monday, May 27th 2025

QSGGeometry how to draw disk points and not squared ones

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 634 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.
  • EmilieGE Offline
    EmilieGE Offline
    EmilieG
    wrote on last edited by
    #1

    In OpenGL I use gl_enable(GL_POINT_SMOOTH) but I can't find anything similar in QSGGeometry. So all my points are squared... How can I set gl_enable(GL_POINT_SMOOTH) from a QSGGeometry ?

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by fcarney
      #2

      @EmilieG said in QSGGeometry how to draw disk points and not squared ones:

      QSGGeometry

      Can you draw a point on the end of the line?
      https://doc.qt.io/qt-5/qsggeometry.html#DrawingMode-enum

      I don't have a setup to test this at the moment.

      Edit:
      Also, I don't know if a point will be smooth.

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      0
      • EmilieGE Offline
        EmilieGE Offline
        EmilieG
        wrote on last edited by EmilieG
        #3

        I'm using QSGGeometry::DrawPoints to draw points instead of lines and it's working, but the points are squares not round.

        JonBJ 1 Reply Last reply
        0
        • EmilieGE EmilieG

          I'm using QSGGeometry::DrawPoints to draw points instead of lines and it's working, but the points are squares not round.

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by
          #4

          @EmilieG
          I see an old post in this forum https://forum.qt.io/topic/13099/solved-recommended-approaches-to-plotting-points-in-3d states:

          Starting to get things working now, using QGLWidget and drawing circular "points" using glPointSize() and glEnable(GL_POINT_SMOOTH) functions. I found "this example":http://www.civilnet.cn/book/embedded/gui/qt4/ch08lev1sec5.html a helpful starting point.

          That implies the guy was able to use gl_enable(GL_POINT_SMOOTH) from Qt, though I don't know anything about QGLWidget or QSGGeometry or how they compare. Unfortunately the linked book does not exist ... :(

          Ah, another post here, https://forum.qt.io/topic/30516/solved-how-can-i-draw-xor-lines-in-a-qgraphicsscene, shows glEnable(GL_POINT_SMOOTH); being used?

          I'd better stop, as I'm afraid I have no idea whether this applies for your QSGGeometry....

          1 Reply Last reply
          0
          • fcarneyF Offline
            fcarneyF Offline
            fcarney
            wrote on last edited by
            #5

            If you need points at each location you could create an QSGNode that is a texture. I did this over the weekend. There is an example in there of using QPainter to render to texture and then turn this into a node that is for textures.
            https://github.com/Demolishun/MeetupGameHackathon1

            C++ is a perfectly valid school of magic.

            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