Solved (several qdockWidget) QWidget::repaint: Recursive repaint detected kernel\qwidget.cpp: 5557
-
@halima
what are the contents of the qdockwidgets? Custom widgets?
It seems you are calling repaint() (directly or indirectly) inside a paintEvent()? -
@raven-worx in my dockwidgets i have a 3D view primarily, qml for custom widget , and o lot of other widgets.
i don't use the paintEvent() -
Hi and welcome to devnet,
Can you determine exactly which of these docks triggers the crash ?
What content does it have ? -
@SGaist Hi SGaist thank you for reply.
the dockwidget containing a 3D view . Because when i disable it i don't have this problem . -
What kind of 3D view is it ?
-
I solved the problem by modifying the qml code, before it was like that :
file.h QQuickWidget *m_quickWidget_gauge_2; QObject *object_gauge_2 ; QQuickWidget *m_quickWidget_gauge_3; QObject *object_gauge_3 ; QQuickWidget *m_quickWidget_gauge_4; QObject *object_gauge_4 ;
file.cpp //QQuickWidget : actuator number 1 m_quickWidget_gauge_1 = new QQuickWidget(this) ; m_quickWidget_gauge_1->setSource(QUrl("qrc:/Resources/res/gauge.qml")); m_quickWidget_gauge_1->setResizeMode(QQuickWidget::SizeRootObjectToView); m_quickWidget_gauge_1->setMinimumHeight(30); m_quickWidget_gauge_1->setMinimumWidth(150); m_quickWidget_gauge_1->setAttribute(Qt::WA_AlwaysStackOnTop); m_quickWidget_gauge_1->setClearColor(Qt::transparent); ui.horizontalLayout_al_1->addWidget(m_quickWidget_gauge_1, 1, Qt::AlignTop); //QQuickWidget : actuator number 2 m_quickWidget_gauge_2 = new QQuickWidget(this) ; m_quickWidget_gauge_2->setSource(QUrl("qrc:/Resources/res/gauge.qml")); m_quickWidget_gauge_2->setResizeMode(QQuickWidget::SizeRootObjectToView); m_quickWidget_gauge_2->setMinimumHeight(30); m_quickWidget_gauge_2->setMinimumWidth(150); m_quickWidget_gauge_2->setAttribute(Qt::WA_AlwaysStackOnTop); m_quickWidget_gauge_2->setClearColor(Qt::transparent); ui.horizontalLayout_al_2->addWidget(m_quickWidget_gauge_2, 1, Qt::AlignTop); //QQuickWidget : actuator number 3 [....]
I made these changes and it works!!
file.h QQuickView *m_qmlview_gauge_1; QQuickView *m_qmlview_gauge_2; QQuickView *m_qmlview_gauge_3;
file.cpp m_qmlview_gauge_1 = new QQuickView(QUrl("qrc:/Resources/res/qml/actuator_gauge.qml")); m_qmlview_gauge_1->setColor(QColor(Qt::white)); QWidget *container = QWidget::createWindowContainer(m_qmlview_gauge_1); container->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Expanding); ui.verticalLayout_11->addWidget(container); m_qmlview_gauge_2 = new QQuickView(QUrl("qrc:/Resources/res/qml/actuator_gauge.qml")); m_qmlview_gauge_2->setColor(QColor(Qt::white)); QWidget *container_1 = QWidget::createWindowContainer(m_qmlview_gauge_2); container_1->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Expanding); ui.verticalLayout_12->addWidget(container_1); m_qmlview_gauge_3 = new QQuickView(QUrl("qrc:/Resources/res/qml/actuator_gauge.qml")); m_qmlview_gauge_3->setColor(QColor(Qt::white)); QWidget *container_2 = QWidget::createWindowContainer(m_qmlview_gauge_3); container_2->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Expanding); ui.verticalLayout_13->addWidget(container_2);
i still not understand why the old code cause this crash, it worked well before !!
-
Did you change something in between ? Qt version ? Windows version ? Video driver version ?
-
@SGaist I updated the graphic driver.
Please can you tell me if there is nothing wrrong in my code because sometimes the problem is reproduced :(
should i delete this variables in the destructor?QQuickView *m_qmlview_gauge_1; QQuickView *m_qmlview_gauge_2; QQuickView *m_qmlview_gauge_3;
-
Then you should consider downgrading the video driver.
AFAIK, you don't need to delete them as the container takes ownership of the window you pass to it. See QWidget::createWindowContainer.
-
@SGaist
it's the graphics driver that did that. Thank you.