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. Can't set line width of an QSGGeometry object
Forum Updated to NodeBB v4.3 + New Features

Can't set line width of an QSGGeometry object

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

    I am trying to create a custom QML item by subclassing QQuickItem, but when I call QSGGeometry::setLineWidth( 4.28f ); I get a message that says "Line widths other than 1 are not supported by the graphics API", the width of the lines does not change and it's always around 2-3 pixels

    QSGNode *TextBalloon::updatePaintNode(
        QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *)
    {
        /// ...
        auto geometry = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 2);
        geometry->setDrawingMode(QSGGeometry::DrawLineStrip);
        geometry->setLineWidth( 4.28f );
        /// ...
    }    
    
    S 1 Reply Last reply
    1
    • T Tahar

      I am trying to create a custom QML item by subclassing QQuickItem, but when I call QSGGeometry::setLineWidth( 4.28f ); I get a message that says "Line widths other than 1 are not supported by the graphics API", the width of the lines does not change and it's always around 2-3 pixels

      QSGNode *TextBalloon::updatePaintNode(
          QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *)
      {
          /// ...
          auto geometry = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 2);
          geometry->setDrawingMode(QSGGeometry::DrawLineStrip);
          geometry->setLineWidth( 4.28f );
          /// ...
      }    
      
      S Offline
      S Offline
      seyed
      wrote on last edited by
      #2

      @Tahar same issue for me. Is there any solution?

      A 1 Reply Last reply
      0
      • S seyed

        @Tahar same issue for me. Is there any solution?

        A Offline
        A Offline
        AlexandreD
        wrote on last edited by
        #3

        @seyed

        With the DrawLines everything works well.

        But setLineWidth() of geometry using DrawLineStrip propagates this width to all others using this flag! It's like the material doesn't consider the lineWidth() in this case.

        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