Modernize type registration in new examples
Change-Id: I26671d47d663c126e2bff41e8db7b0945db78643 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
90b4528b84
commit
c398e6701d
|
@ -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;
|
||||
|
|
|
@ -60,6 +60,7 @@ class CustomTextureItem : public QQuickItem
|
|||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal t READ t WRITE setT NOTIFY tChanged)
|
||||
QML_ELEMENT
|
||||
|
||||
public:
|
||||
CustomTextureItem();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -50,14 +50,11 @@
|
|||
|
||||
#include <QGuiApplication>
|
||||
#include <QtQuick/QQuickView>
|
||||
#include "vulkantextureimport.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
qmlRegisterType<CustomTextureItem>("VulkanTextureImport", 1, 0, "CustomTextureItem");
|
||||
|
||||
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::VulkanRhi);
|
||||
|
||||
QQuickView view;
|
||||
|
|
|
@ -60,6 +60,7 @@ class CustomTextureItem : public QQuickItem
|
|||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal t READ t WRITE setT NOTIFY tChanged)
|
||||
QML_ELEMENT
|
||||
|
||||
public:
|
||||
CustomTextureItem();
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
!qtConfig(vulkan): error("This example requires Qt built with Vulkan support")
|
||||
|
||||
QT += qml quick
|
||||
CONFIG += qmltypes
|
||||
QML_IMPORT_NAME = VulkanTextureImport
|
||||
QML_IMPORT_MAJOR_VERSION = 1
|
||||
|
||||
HEADERS += vulkantextureimport.h
|
||||
SOURCES += vulkantextureimport.cpp main.cpp
|
||||
RESOURCES += vulkantextureimport.qrc
|
||||
|
||||
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/quick/scenegraph/vulkantextureimport
|
||||
INSTALLS += target
|
||||
|
|
|
@ -50,14 +50,11 @@
|
|||
|
||||
#include <QGuiApplication>
|
||||
#include <QtQuick/QQuickView>
|
||||
#include "vulkansquircle.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
qmlRegisterType<VulkanSquircle>("VulkanUnderQML", 1, 0, "VulkanSquircle");
|
||||
|
||||
// This example needs Vulkan. It will not run otherwise.
|
||||
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::VulkanRhi);
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@ class VulkanSquircle : public QQuickItem
|
|||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal t READ t WRITE setT NOTIFY tChanged)
|
||||
QML_ELEMENT
|
||||
|
||||
public:
|
||||
VulkanSquircle();
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
!qtConfig(vulkan): error("This example requires Qt built with Vulkan support")
|
||||
|
||||
QT += qml quick
|
||||
CONFIG += qmltypes
|
||||
QML_IMPORT_NAME = VulkanUnderQML
|
||||
QML_IMPORT_MAJOR_VERSION = 1
|
||||
|
||||
HEADERS += vulkansquircle.h
|
||||
SOURCES += vulkansquircle.cpp main.cpp
|
||||
|
|
Loading…
Reference in New Issue