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. QLineSeries OpenGL issue
QtWS25 Last Chance

QLineSeries OpenGL issue

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.4k 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.
  • X Offline
    X Offline
    xcoder
    wrote on last edited by
    #1

    Hello Everybody,

    I've been playing around with QtCharts. Thought I would convert one of my application which uses qwt to QtCharts. Unfortunatelly I'm running into some issues.

    I'm not able to generate a line chart with large X values when setUseOpenGL is enabled.

    Here is a code which doesn't render anything.

    QLineSeries *series = new QLineSeries();
    
        series->append(1490215139925, 0.841470985);
        series->append(1490215157925, 0.14987721);
        series->append(1490215158925, 0.912945251);
        series->append(1490215159925, 0.836655639);
        series->append(1490215160925, -0.008851309);
    
        series->setUseOpenGL(true);
    
    
        chart = new QChart();
        chart->setTitle( ui->titleEdit->text() );
        QFont tFont = chart->titleFont();
        tFont.setPointSizeF( 15 );
        tFont.setBold( true );
        chart->setTitleFont( tFont );
    
    
        axisX = new QValueAxis;
        axisX->setRange( (qreal)1490215139925, (qreal)1490215163925 );
        axisX->setTickCount(10);
        axisX->setLabelFormat("%l");
        axisX->setTitleText("unixTime");
    
        axisY = new QValueAxis;
        axisY->setRange(-1, 1);
        axisY->setTitleText("Level");
        chart->setAxisX(dateAxisX);
        chart->setAxisY(axisY);
    
        chart->addSeries(series);
        series->attachAxis(axisX);
        series->attachAxis(axisY);
    

    As I mentioned before change setUseOpenGL to false

      series->setUseOpenGL(false);
    

    And all works fine.

    Couple other things I tried or noticed:

    • If x values are in 32 bit range it seems to work fine in opengl mode
    • Tried changing QValueAxis to QDateTimeAxis still doesn't work in opengl mode

    Any ideas is it a bug? Is there a workaround? Is this a limitation of OpenGL not able to take in large numbers?

    I'm using Qt 5.8 with MinGW 5.3.0 32bit

    Only a biker knows why a dog sticks his head out of a car window.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I'd go check the bug report system to see if there's something related.

      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
      • X Offline
        X Offline
        xcoder
        wrote on last edited by xcoder
        #3

        Thanks for your reply, it seems there is no bug reported regarding this issue. Only similar one is that QLineSeries can't be hidden when openGL is enabled.

        I'll write an example test code and submit a bug

        Only a biker knows why a dog sticks his head out of a car window.

        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