Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.3.0
-
None
-
Debian 7, X11
-
6ef802ff6ed1cd234848b65fdad56dc3b0579cff (qtdeclarative), 5cd7390ba91702efb2a978a438896d713f5a3abc (qtbase)
Description
This is a subtask of QTBUG-36935
Replace the C++ part of the qquickwidget example by this:
#include <QQuickWidget> #include <QtWidgets> class HideShow : public QObject { Q_OBJECT public: QWidget *subject; HideShow(QWidget *subject, int interval) : QObject(subject), subject(subject) { startTimer(interval); } void timerEvent(QTimerEvent *) { if (subject->isVisible()) { qDebug() << "hide" << subject->width() << subject->height(); subject->hide(); } else { qDebug() << "show" << subject->width() << subject->height(); subject->show(); } } }; int main(int argc, char **argv) { QApplication app(argc, argv); QMainWindow *toplevel = new QMainWindow; QUrl source("qrc:quickwidget/rotatingsquare.qml"); QQuickWidget *w = new QQuickWidget; w->resize(300,300); w->setResizeMode(QQuickWidget::SizeRootObjectToView); w->setSource(source); new HideShow(w, 3000); toplevel->setCentralWidget(w); toplevel->show(); return app.exec(); } #include "main.moc"
The QQuickWidget's contents will still be visible after hide(), but the rectangle won't be spinning anymore. Furthermore it won't restart the spinning after show() and it creates visual clutter when resizing the window.
Attachments
Issue Links
- is required for
-
QTBUG-36935 various problems when trying to use QQuickWidget in QML profiler
- Closed
For Gerrit Dashboard: QTBUG-37062 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
79493,2 | QQuickWidget: handle hide and show events properly | stable | qt/qtdeclarative | Status: MERGED | +2 | 0 |
79519,1 | QQuickWidget show/hide/raise fix | stable | qt/qtbase | Status: MERGED | +2 | 0 |