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. QML Chart does not respect width when using OpenGL 3.3 in macOS

QML Chart does not respect width when using OpenGL 3.3 in macOS

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

    Hi guys!

    I am building a simulator in which the GUI needs to update some charts (6) very fast (60 Hz). I am using QML Charts and it is painfully slow. After reading a lot, doing the data handling in C++, etc. I saw that I can improve the performance by using OpenGL.

    However, if I use this code:

    ChartView {
        title: "Line"
        anchors.fill: parent
        antialiasing: true
    
        LineSeries {
            name: "LineSeries"
            XYPoint { x: 0; y: 0 }
            XYPoint { x: 1.1; y: 2.1 }
            XYPoint { x: 1.9; y: 3.3 }
            XYPoint { x: 2.1; y: 2.1 }
            XYPoint { x: 2.9; y: 4.9 }
            XYPoint { x: 3.4; y: 3.0 }
            XYPoint { x: 4.1; y: 3.3 }
        }
    }
    

    with vanilla settings w.r.t. OpenGL, I get this as expected:

    0_1558527120810_Vanilla.png

    However, if I change the OpenGL version to 3.3 (which I need to draw a 3D view) using this code:

        QSurfaceFormat glFormat;
    
        glFormat.setVersion(3,3);
        glFormat.setProfile(QSurfaceFormat::CoreProfile);
        QSurfaceFormat::setDefaultFormat(glFormat);
    

    then I get this output:

    0_1558527182562_OpenGL_3_3.png

    Notice that the line width is not respected anymore. Is there anything I can do to avoid this?

    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