diff options
author | Dheerendra Purohit <[email protected]> | 2025-05-26 11:50:17 +0530 |
---|---|---|
committer | Dheerendra Purohit <[email protected]> | 2025-06-02 09:01:46 +0000 |
commit | 96578b3b00e4287459bb7bb255e3829662ec0773 (patch) | |
tree | 784aea80e82f58e022a2ee279cbcd0e21c5c2697 /examples/graphs/3d | |
parent | 52a361988d84ed893ac4cea36fe11e49d2c58fa5 (diff) |
Removed qmlRegisterType calls from the qmake versions of the
AxisHandling and SurfaceGallery examples. These examples already had
the QML_ELEMENT macro in their classes. With this change,the qmake-based
examples now also work correctly withcompile-time QML type registration,
just like their CMake.
Pick-to: 6.9 6.8
Task-number: QTBUG-136712
Change-Id: Ieb6328f57dbb19373a3895572667c749af0ed344
Reviewed-by: Sami Varanka <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'examples/graphs/3d')
5 files changed, 7 insertions, 20 deletions
diff --git a/examples/graphs/3d/axishandling/axishandling.pro b/examples/graphs/3d/axishandling/axishandling.pro index 55e20f78..f4d1f62c 100644 --- a/examples/graphs/3d/axishandling/axishandling.pro +++ b/examples/graphs/3d/axishandling/axishandling.pro @@ -2,7 +2,9 @@ error( "Couldn't find the examples.pri file!" ) } -DEFINES += QMAKE_BUILD +CONFIG += qmltypes +QML_IMPORT_NAME = AxisHandlingExample +QML_IMPORT_MAJOR_VERSION = 1 SOURCES += main.cpp \ customformatter.cpp diff --git a/examples/graphs/3d/axishandling/main.cpp b/examples/graphs/3d/axishandling/main.cpp index 19ac8869..9cf4026d 100644 --- a/examples/graphs/3d/axishandling/main.cpp +++ b/examples/graphs/3d/axishandling/main.cpp @@ -6,19 +6,10 @@ #include <QtQml> #include <QtQuick/qquickview.h> -#ifdef QMAKE_BUILD -#include "customformatter.h" -Q_DECLARE_METATYPE(CustomFormatter *) -#endif - int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); -#ifdef QMAKE_BUILD - qmlRegisterType<CustomFormatter>("AxisHandling", 1, 0, "CustomFormatter"); -#endif - QQuickView viewer; // The following are needed to make examples run without having to install the diff --git a/examples/graphs/3d/surfacegallery/main.cpp b/examples/graphs/3d/surfacegallery/main.cpp index 396c0628..30fff3af 100644 --- a/examples/graphs/3d/surfacegallery/main.cpp +++ b/examples/graphs/3d/surfacegallery/main.cpp @@ -9,18 +9,10 @@ #include <QtQml/qqmlengine.h> #include <QtQuick/qquickview.h> -#ifdef QMAKE_BUILD -#include "datasource.h" -#endif - int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); -#ifdef QMAKE_BUILD - qmlRegisterType<DataSource>("SurfaceGallery", 1, 0, "DataSource"); -#endif - QQuickView viewer; //! [1] diff --git a/examples/graphs/3d/surfacegallery/qml/surfacegallery/SurfaceOscilloscope.qml b/examples/graphs/3d/surfacegallery/qml/surfacegallery/SurfaceOscilloscope.qml index 3570253d..59de7372 100644 --- a/examples/graphs/3d/surfacegallery/qml/surfacegallery/SurfaceOscilloscope.qml +++ b/examples/graphs/3d/surfacegallery/qml/surfacegallery/SurfaceOscilloscope.qml @@ -5,7 +5,7 @@ import QtQuick import QtQuick.Controls.Basic import QtGraphs //! [0] -import SurfaceGalleryExample +import SurfaceGallery //! [0] Item { diff --git a/examples/graphs/3d/surfacegallery/surfacegallery.pro b/examples/graphs/3d/surfacegallery/surfacegallery.pro index 0da2a48a..620bb52e 100644 --- a/examples/graphs/3d/surfacegallery/surfacegallery.pro +++ b/examples/graphs/3d/surfacegallery/surfacegallery.pro @@ -2,7 +2,9 @@ error( "Couldn't find the examples.pri file!" ) } -DEFINES += QMAKE_BUILD +CONFIG += qmltypes +QML_IMPORT_NAME = SurfaceGallery +QML_IMPORT_MAJOR_VERSION = 1 QT += graphs |