diff options
Diffstat (limited to 'src/imports/wavefrontmesh')
-rw-r--r-- | src/imports/wavefrontmesh/plugin.cpp | 19 | ||||
-rw-r--r-- | src/imports/wavefrontmesh/plugins.qmltypes | 37 | ||||
-rw-r--r-- | src/imports/wavefrontmesh/qwavefrontmesh.cpp | 10 | ||||
-rw-r--r-- | src/imports/wavefrontmesh/qwavefrontmesh.h | 2 | ||||
-rw-r--r-- | src/imports/wavefrontmesh/wavefrontmesh.pro | 1 |
5 files changed, 15 insertions, 54 deletions
diff --git a/src/imports/wavefrontmesh/plugin.cpp b/src/imports/wavefrontmesh/plugin.cpp index 1a266b7e36..eea0db19db 100644 --- a/src/imports/wavefrontmesh/plugin.cpp +++ b/src/imports/wavefrontmesh/plugin.cpp @@ -42,25 +42,20 @@ #include "qwavefrontmesh.h" +extern void qml_register_types_Qt_labs_wavefrontmesh(); + QT_BEGIN_NAMESPACE -class QmlWavefrontMeshPlugin : public QQmlExtensionPlugin +class QmlWavefrontMeshPlugin : public QQmlEngineExtensionPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid) public: QmlWavefrontMeshPlugin(QObject *parent = nullptr) - : QQmlExtensionPlugin(parent) + : QQmlEngineExtensionPlugin(parent) { - } - - void registerTypes(const char *uri) override - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.wavefrontmesh")); - qmlRegisterType<QWavefrontMesh>(uri, 1, 0, "WavefrontMesh"); - - // Auto-increment the import to stay in sync with ALL future QtQuick minor versions from 5.12 onward - qmlRegisterModule(uri, 1, QT_VERSION_MINOR); + volatile auto registration = &qml_register_types_Qt_labs_wavefrontmesh; + Q_UNUSED(registration); } }; diff --git a/src/imports/wavefrontmesh/plugins.qmltypes b/src/imports/wavefrontmesh/plugins.qmltypes deleted file mode 100644 index 4e6a1dca73..0000000000 --- a/src/imports/wavefrontmesh/plugins.qmltypes +++ /dev/null @@ -1,37 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable Qt.labs.wavefrontmesh 1.14' - -Module { - dependencies: ["QtQuick 2.0"] - Component { - name: "QWavefrontMesh" - prototype: "QQuickShaderEffectMesh" - exports: ["Qt.labs.wavefrontmesh/WavefrontMesh 1.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "Error" - values: { - "NoError": 0, - "InvalidSourceError": 1, - "UnsupportedFaceShapeError": 2, - "UnsupportedIndexSizeError": 3, - "FileNotFoundError": 4, - "NoAttributesError": 5, - "MissingPositionAttributeError": 6, - "MissingTextureCoordinateAttributeError": 7, - "MissingPositionAndTextureCoordinateAttributesError": 8, - "TooManyAttributesError": 9, - "InvalidPlaneDefinitionError": 10 - } - } - Property { name: "source"; type: "QUrl" } - Property { name: "lastError"; type: "Error"; isReadonly: true } - Property { name: "projectionPlaneV"; type: "QVector3D" } - Property { name: "projectionPlaneW"; type: "QVector3D" } - } -} diff --git a/src/imports/wavefrontmesh/qwavefrontmesh.cpp b/src/imports/wavefrontmesh/qwavefrontmesh.cpp index e973ef0103..1772c40c50 100644 --- a/src/imports/wavefrontmesh/qwavefrontmesh.cpp +++ b/src/imports/wavefrontmesh/qwavefrontmesh.cpp @@ -257,7 +257,7 @@ void QWavefrontMesh::readData() while (!stream.atEnd()) { stream.readLineInto(&buffer); - QVector<QStringRef> tokens = buffer.splitRef(space, QString::SkipEmptyParts); + QVector<QStringRef> tokens = buffer.splitRef(space, Qt::SkipEmptyParts); if (tokens.size() < 2) continue; @@ -316,7 +316,7 @@ void QWavefrontMesh::readData() if (tokens.size() >= 4 && tokens.size() <= 5) { { bool ok; - QVector<QStringRef> faceTokens = tokens.at(1).split(slash, QString::SkipEmptyParts); + QVector<QStringRef> faceTokens = tokens.at(1).split(slash, Qt::SkipEmptyParts); Q_ASSERT(!faceTokens.isEmpty()); p1 = faceTokens.at(0).toInt(&ok) - 1; @@ -336,7 +336,7 @@ void QWavefrontMesh::readData() { bool ok; - QVector<QStringRef> faceTokens = tokens.at(2).split(slash, QString::SkipEmptyParts); + QVector<QStringRef> faceTokens = tokens.at(2).split(slash, Qt::SkipEmptyParts); Q_ASSERT(!faceTokens.isEmpty()); p2 = faceTokens.at(0).toInt(&ok) - 1; @@ -356,7 +356,7 @@ void QWavefrontMesh::readData() { bool ok; - QVector<QStringRef> faceTokens = tokens.at(3).split(slash, QString::SkipEmptyParts); + QVector<QStringRef> faceTokens = tokens.at(3).split(slash, Qt::SkipEmptyParts); Q_ASSERT(!faceTokens.isEmpty()); p3 = faceTokens.at(0).toInt(&ok) - 1; @@ -394,7 +394,7 @@ void QWavefrontMesh::readData() if (tokens.size() == 5) { bool ok; - QVector<QStringRef> faceTokens = tokens.at(4).split(slash, QString::SkipEmptyParts); + QVector<QStringRef> faceTokens = tokens.at(4).split(slash, Qt::SkipEmptyParts); Q_ASSERT(!faceTokens.isEmpty()); int p4 = faceTokens.at(0).toInt(&ok) - 1; diff --git a/src/imports/wavefrontmesh/qwavefrontmesh.h b/src/imports/wavefrontmesh/qwavefrontmesh.h index e3ded8078e..a8a40c1a6a 100644 --- a/src/imports/wavefrontmesh/qwavefrontmesh.h +++ b/src/imports/wavefrontmesh/qwavefrontmesh.h @@ -55,6 +55,8 @@ class QWavefrontMesh : public QQuickShaderEffectMesh Q_PROPERTY(Error lastError READ lastError NOTIFY lastErrorChanged) Q_PROPERTY(QVector3D projectionPlaneV READ projectionPlaneV WRITE setProjectionPlaneV NOTIFY projectionPlaneVChanged) Q_PROPERTY(QVector3D projectionPlaneW READ projectionPlaneW WRITE setProjectionPlaneW NOTIFY projectionPlaneWChanged) + QML_NAMED_ELEMENT(WavefrontMesh) + public: enum Error { NoError, diff --git a/src/imports/wavefrontmesh/wavefrontmesh.pro b/src/imports/wavefrontmesh/wavefrontmesh.pro index 85bd500089..0b28410750 100644 --- a/src/imports/wavefrontmesh/wavefrontmesh.pro +++ b/src/imports/wavefrontmesh/wavefrontmesh.pro @@ -12,4 +12,5 @@ SOURCES += \ HEADERS += \ qwavefrontmesh.h +CONFIG += qmltypes install_qmltypes load(qml_plugin) |