Important: Please read the Qt Code of Conduct -

A weird problem about qtchart,it will disappear when I drag window to another screen

  • Recently,I refactored my code,it almost done,but QtChart works weird,have you ever met similar problems that something unexpected happened when move window to another screen?

    I Have two scrren,here, call A and B.

    Something Weird:

    • For example,if program window generated in A,it works normal in A,however,if I move it to B,all openglwidgets of QtChart will disappear,even if I move it back to A,it still can't be seen.In turn,if generated in B,and move it to A,problems are same.

    • when It disappeard,I float(setWindowFlag(Qt::Window,true);) the little window containing qtChart,openglWidget will show,and I move the littlt window to another scrren,it works all right,But if I embed(setWindowFlag(Qt::Window,false);) it back to main window,openglWidget will disappear again.

    • Another problem is,after move window to another screen, when I hover mouse over the handle of QSplitter,CursorShape won't change,but splitter still works if drag the handle.



    There are some settings below, but it should not be the reason for this question, because the previous version is same, but works right.

    All windows are customized:

    setWindowFlags(Qt::Window |Qt::FramelessWindowHint);

    Capture pointer of openglWidget is only for screenshoot :

    chart_ = new QChart;
    view_ = new QChartView(chart_);
    glTempSeries_ = new QLineSeries(this);
    openglWidget_ = view_->findChild<QOpenGLWidget*>();

    I really tried,but I still can't find why,any suggestions would be appreciated,thanks.

Log in to reply