aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/metaltextureimport
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-02-11 16:00:11 +0100
committerUlf Hermann <ulf.hermann@qt.io>2020-02-11 19:26:44 +0100
commitc398e6701d15d13efe242085f51c59722e32d037 (patch)
tree45752b9fb81e7ff77c21296872762d10be2b934f /examples/quick/scenegraph/metaltextureimport
parent90b4528b846542bfa6f0723487315140b9de17b4 (diff)
Modernize type registration in new examples
Change-Id: I26671d47d663c126e2bff41e8db7b0945db78643 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/metaltextureimport')
-rw-r--r--examples/quick/scenegraph/metaltextureimport/main.cpp4
-rw-r--r--examples/quick/scenegraph/metaltextureimport/metaltextureimport.h1
-rw-r--r--examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro3
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/quick/scenegraph/metaltextureimport/main.cpp b/examples/quick/scenegraph/metaltextureimport/main.cpp
index c969817e8f..4fc010e710 100644
--- a/examples/quick/scenegraph/metaltextureimport/main.cpp
+++ b/examples/quick/scenegraph/metaltextureimport/main.cpp
@@ -50,14 +50,10 @@
#include <QGuiApplication>
#include <QtQuick/QQuickView>
-#include "metaltextureimport.h"
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
-
- qmlRegisterType<CustomTextureItem>("MetalTextureImport", 1, 0, "CustomTextureItem");
-
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::MetalRhi);
QQuickView view;
diff --git a/examples/quick/scenegraph/metaltextureimport/metaltextureimport.h b/examples/quick/scenegraph/metaltextureimport/metaltextureimport.h
index afc5aced97..49a29565a7 100644
--- a/examples/quick/scenegraph/metaltextureimport/metaltextureimport.h
+++ b/examples/quick/scenegraph/metaltextureimport/metaltextureimport.h
@@ -60,6 +60,7 @@ class CustomTextureItem : public QQuickItem
{
Q_OBJECT
Q_PROPERTY(qreal t READ t WRITE setT NOTIFY tChanged)
+ QML_ELEMENT
public:
CustomTextureItem();
diff --git a/examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro b/examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro
index bbdfd358d3..9e88c50dc6 100644
--- a/examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro
+++ b/examples/quick/scenegraph/metaltextureimport/metaltextureimport.pro
@@ -1,6 +1,9 @@
!macos:!ios: error("This example requires macOS or iOS")
QT += qml quick
+CONFIG += qmltypes
+QML_IMPORT_NAME = MetalTextureImport
+QML_IMPORT_MAJOR_VERSION = 1
HEADERS += metaltextureimport.h
SOURCES += metaltextureimport.mm main.cpp