When the dialog pops up, the chart series is drawn over the dialog.
-
void wSpectrum::AddChartSeries(bool isData, usrTableModel* pModel) { QLineSeries* pSeries = new QLineSeries(m_pChart); //pSeries->setUseOpenGL(true); // 속도 향상 QVXYModelMapper* mapper = new QVXYModelMapper(this); mapper->setXColumn(0); mapper->setYColumn(pModel->GetColCount()-1); if(isData) mapper->setSeries(pSeries); mapper->setModel(pModel); m_pChart->addSeries(pSeries); m_pChart->createDefaultAxes(); // [축 재설정] { QValueAxis* axisx = qobject_cast<QValueAxis*>(m_pChart->axes(Qt::Horizontal).first()); axisx->setTickCount(5); m_pChart->axisX()->setTitleFont(cGlobalParam::gGetChartAxis(true)); m_pChart->axisX()->setTitleText("Wave Length"); m_pChart->axisX()->setTitleBrush(QBrush(QColor(76, 127, 185))); m_pChart->axisY()->setTitleFont(cGlobalParam::gGetChartAxis(true)); m_pChart->axisY()->setTitleText("Absorbance."); m_pChart->axisY()->setTitleBrush(QBrush(QColor(76, 127, 185))); } // [행의 마지막 위치로 이동] QModelIndex index = pModel->index(0, pModel->GetColCount()-1, QModelIndex()); this->ui.tableWidget->scrollTo(index, QAbstractItemView::PositionAtTop); } void wSpectrum::BtnMeasure() { QPair<QString, QList<qreal>> pairTemp2; pairTemp2.first = QString("D_%1").arg(m_pDataModel->GetInputData().count()); for (int i = 0; i < this->m_pSpectrumInfo->GetDataCount()+1; i++) { qreal qRan1 = QRandomGenerator::global()->bounded(0, 10); qreal qRan2 = QRandomGenerator::global()->generateDouble(); pairTemp2.second.append(qRan1 + qRan2); } m_pDataModel->AppendData(pairTemp2); AddChartSeries(true, m_pDataModel); //this->update(); }
I am connecting tables and charts with Abstractmodel. It draws a series whenever data comes in, but the setUseOpenGL option seems to be the cause. Please understand that we cannot upload the full source.
-
pSeries->setUseOpenGL(true); If I disable the function, it works fine.
The problem with this is that even if you delete all the series in the chart, it remains on the screen. But when I switch to another screen with the mouse, it is cleared.This is a bug.
-
If you can't provide a minimal, compilable example we can't help here. I doubt it's a bug in Qt but on your side. If you think it's a bug, write a bug report but even there you need a minimal, compilable examle to get your problem fixed...
-
https://github.com/HaonPAPA/MyRepository/blob/main/linechart.7z
I have created an example. A dialog box pops up after creating a series by clicking the Add series button.
A blue widget is floating in the dialog. It is drawn over the widget. -
It's the combination of Qt::FramelessWindowHint and OpenGl. You should create a bug report with your testcase.
-
Are you saying it's a bug?
-
Yes - as I told you create a bug report, but why do you need such a dialog on top?
-
I am trying to open an option window. However, as a form of style, I tried to lower the alpha value around it to draw more attention to the options window.
The method I have implemented may not be the normal method.
If there is a better way please suggest -
What's wrong with a simple QDialog?
-
This is the UI I wanted. -
This is a simple QMessageBox. Why so much work? Why must it be frameless?
-
The program we are developing is user UI-oriented, so we have to pay a lot of attention to the little things.
answer my question
What I want is to blur the background behind it. It could be done very simply in C# too.
Is there a better way than the way I did? -
I don't know - if you've a commercial license then ask TQtC to fix it. Otherwise find a workaround.