Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47090

[REG 5.4.2->5.5.0] QSGGeometry::setLineWidth has no effect anymore with drawingMode GL_LINES

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.1
    • 5.5.0 Beta, 5.5.0
    • Quick: SceneGraph
    • None
    • Windows 8.1 OpenGL, android armV7
    • 52dfe30201c8f6dad90604247643673025086275 4336566e48e7853bcf91d768c70d20db5de9e174

    Description

      Setting lineWidth used to work with GL_LINES in Qt 5.4.2, tested both on Windows Desktop and android. Logging qpa.gl shows that in both windows versions (5.4.2 vs. 5.5.0) OpenGL (and not ANGLE) is used. GL_LINE_STRIP works fine in 5.5.0, though.

      Code snippet:

      QSGNode* Line::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
      {
      QSGGeometryNode* node = static_cast<QSGGeometryNode*>(oldNode);
      if(!node)

      { node = new QSGGeometryNode; QSGGeometry *geometry = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 2); QSGFlatColorMaterial *material = new QSGFlatColorMaterial; node->setGeometry(geometry); node->setFlag(QSGNode::OwnsGeometry); node->setMaterial(material); node->setFlag(QSGNode::OwnsMaterial); node->geometry()->setDrawingMode(GL_LINES); }

      node->geometry()->setLineWidth(20); // since Qt 5.5.0, this has no more effect - resulting lineWidth is always 1

      node->geometry()->vertexDataAsPoint2D()[0].set(m_p1.x(), m_p1.y());
      node->geometry()->vertexDataAsPoint2D()[1].set(m_p2.x(), m_p2.y());

      QSGFlatColorMaterial* flatmaterial = static_cast<QSGFlatColorMaterial*>(node->material());
      flatmaterial->setColor(m_color);

      node->markDirty(QSGNode::DirtyGeometry);

      return node;
      }

      Attachments

        For Gerrit Dashboard: QTBUG-47090
        # Subject Branch Project Status CR V

        Activity

          People

            sletta Gunnar Sletta
            frank.proposch Frank Proposch
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes