@@ -551,17 +551,15 void ChartPresenter::ensureGLWidget() | |||
|
551 | 551 | // GLWidget pointer is wrapped in QPointer as its parent is not in our control, and therefore |
|
552 | 552 | // can potentially get deleted unexpectedly. |
|
553 | 553 | if (m_glWidget.isNull() && m_glUseWidget && m_chart->scene()) { |
|
554 | QObject *parent = m_chart->scene()->parent(); | |
|
555 | while (parent) { | |
|
556 | QWidget *parentWidget = qobject_cast<QWidget *>(parent); | |
|
557 |
|
|
|
554 | // Find the view of the scene. If the scene has multiple views, only the first view is | |
|
555 | // chosen. | |
|
556 | QList<QGraphicsView *> views = m_chart->scene()->views(); | |
|
557 | if (views.size()) { | |
|
558 | QGraphicsView *firstView = views.at(0); | |
|
558 | 559 |
|
|
559 |
|
|
|
560 | firstView); | |
|
560 | 561 |
|
|
561 | 562 |
|
|
562 | break; | |
|
563 | } | |
|
564 | parent = parent->parent(); | |
|
565 | 563 | } |
|
566 | 564 | } |
|
567 | 565 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now