diff options
Diffstat (limited to 'examples/quick/shared')
-rw-r--r-- | examples/quick/shared/LauncherList.qml | 11 | ||||
-rw-r--r-- | examples/quick/shared/shared.h | 5 |
2 files changed, 10 insertions, 6 deletions
diff --git a/examples/quick/shared/LauncherList.qml b/examples/quick/shared/LauncherList.qml index 65dec0f29f..e532b53e7f 100644 --- a/examples/quick/shared/LauncherList.qml +++ b/examples/quick/shared/LauncherList.qml @@ -57,10 +57,12 @@ Rectangle { //function used to add to model A) to enforce scheme B) to allow Qt.resolveUrl in url assignments color: "#eee" - function addExample(name, desc, url) - { + function addExample(name, desc, url) { myModel.append({"name":name, "description":desc, "url":url}) } + function showExample(url) { + pageComponent.createObject(pageContainer, { exampleUrl: url }).show() + } // The container rectangle here is used to give a nice "feel" when // transitioning into an example. @@ -72,10 +74,7 @@ Rectangle { id: launcherList clip: true delegate: SimpleLauncherDelegate{ - onClicked: { - var page = pageComponent.createObject(pageContainer, { exampleUrl: url }) - page.show() - } + onClicked: showExample(url) } model: ListModel {id:myModel} anchors.fill: parent diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h index 317d8c70cb..18e7ff056b 100644 --- a/examples/quick/shared/shared.h +++ b/examples/quick/shared/shared.h @@ -66,6 +66,11 @@ f.setVersion(4, 4);\ view.setFormat(f);\ }\ + if (qgetenv("QT_QUICK_MULTISAMPLE").toInt()) {\ + QSurfaceFormat f = view.format();\ + f.setSamples(4);\ + view.setFormat(f);\ + }\ view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);\ new QQmlFileSelector(view.engine(), &view);\ view.setSource(QUrl("qrc:///" #NAME ".qml")); \ |