aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/quickwidgets/quickwidget/main.cpp7
-rw-r--r--examples/quickcontrols/contactlist/CMakeLists.txt1
-rw-r--r--examples/quickcontrols/gallery/pages/DelegatePage.qml8
3 files changed, 9 insertions, 7 deletions
diff --git a/examples/quick/quickwidgets/quickwidget/main.cpp b/examples/quick/quickwidgets/quickwidget/main.cpp
index 584cecfb00..f8e0b78844 100644
--- a/examples/quick/quickwidgets/quickwidget/main.cpp
+++ b/examples/quick/quickwidgets/quickwidget/main.cpp
@@ -112,10 +112,12 @@ void MainWindow::createQuickWidgetsInTabs(QMdiArea *mdiArea)
if (widget->parent()) {
widget->setAttribute(Qt::WA_DeleteOnClose, true);
widget->setParent(nullptr);
+ connect(this, &QObject::destroyed, widget, &QWidget::close);
widget->show();
btn->setText(msgFromTopLevel);
} else {
widget->setAttribute(Qt::WA_DeleteOnClose, false);
+ disconnect(this, &QObject::destroyed, widget, &QWidget::close);
tabWidget->addTab(widget, widget->windowTitle());
btn->setText(msgToTopLevel);
}
@@ -201,8 +203,9 @@ int main(int argc, char **argv)
optMultipleSample = parser.isSet(multipleSampleOption);
- MainWindow mainWindow;
- mainWindow.show();
+ MainWindow *mainWindow = new MainWindow;
+ mainWindow->setAttribute(Qt::WA_DeleteOnClose, true);
+ mainWindow->show();
return app.exec();
}
diff --git a/examples/quickcontrols/contactlist/CMakeLists.txt b/examples/quickcontrols/contactlist/CMakeLists.txt
index 508bccaae9..cd7980653d 100644
--- a/examples/quickcontrols/contactlist/CMakeLists.txt
+++ b/examples/quickcontrols/contactlist/CMakeLists.txt
@@ -21,7 +21,6 @@ qt_add_executable(contactlistexample WIN32 MACOSX_BUNDLE
qt_add_qml_module(contactlistexample
URI contactlist
- NO_RESOURCE_TARGET_PATH
QML_FILES
"ContactDelegate.ui.qml"
"ContactDialog.qml"
diff --git a/examples/quickcontrols/gallery/pages/DelegatePage.qml b/examples/quickcontrols/gallery/pages/DelegatePage.qml
index 5d4c6b9db2..519fffc6d2 100644
--- a/examples/quickcontrols/gallery/pages/DelegatePage.qml
+++ b/examples/quickcontrols/gallery/pages/DelegatePage.qml
@@ -20,6 +20,10 @@ Pane {
text: qsTr("Delegate controls are used as delegates in views such as ListView.")
}
+ ButtonGroup {
+ id: radioButtonGroup
+ }
+
ListView {
id: listView
clip: true
@@ -152,10 +156,6 @@ Pane {
}
}
- ButtonGroup {
- id: radioButtonGroup
- }
-
Component {
id: radioDelegateComponent