summaryrefslogtreecommitdiffstats
path: root/src/window-lib
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2023-09-25 19:27:50 +0200
committerRobert Griebl <robert.griebl@qt.io>2023-09-26 11:13:38 +0200
commit3b47cfced267f82388a9832c9ecb3ec6b1e7eefd (patch)
tree90702008b66eed215add5ed26f7469a81e371280 /src/window-lib
parent9936a7fcb6195f7a21c09c2c903c94d1a27e0b91 (diff)
QML can now deal with QList<object derived type *> properties
This means we can finally make our QML API look nicer. Also extended the simple QML auto-test to make sure the changed API gets tested. Change-Id: I4ce3d7d49b2cf93ed1959bd2c1c835bd3e4ce0dc Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Diffstat (limited to 'src/window-lib')
-rw-r--r--src/window-lib/windowmanager.cpp4
-rw-r--r--src/window-lib/windowmanager.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/window-lib/windowmanager.cpp b/src/window-lib/windowmanager.cpp
index b5364319..1068f5a9 100644
--- a/src/window-lib/windowmanager.cpp
+++ b/src/window-lib/windowmanager.cpp
@@ -516,9 +516,9 @@ Window *WindowManager::window(int index) const
signals or the windowAboutToBeRemoved signal to get notified if the objects are about
to be deleted on the C++ side.
*/
-QList<QObject *> WindowManager::windowsOfApplication(const QString &id) const
+QList<Window *> WindowManager::windowsOfApplication(const QString &id) const
{
- QList<QObject *> result;
+ QList<Window *> result;
for (Window *window : d->windowsInModel) {
if (window->application() && window->application()->id() == id)
result << window;
diff --git a/src/window-lib/windowmanager.h b/src/window-lib/windowmanager.h
index 80b9336d..496d78b5 100644
--- a/src/window-lib/windowmanager.h
+++ b/src/window-lib/windowmanager.h
@@ -85,7 +85,7 @@ public:
int count() const;
Q_INVOKABLE QVariantMap get(int index) const;
Q_INVOKABLE QT_PREPEND_NAMESPACE_AM(Window) *window(int index) const;
- Q_INVOKABLE QList<QObject *> windowsOfApplication(const QString &id) const;
+ Q_INVOKABLE QList<QT_PREPEND_NAMESPACE_AM(Window) *> windowsOfApplication(const QString &id) const;
Q_INVOKABLE int indexOfWindow(QT_PREPEND_NAMESPACE_AM(Window) *window) const;
Q_INVOKABLE QObject *addExtension(QQmlComponent *component) const;