diff options
author | Miguel Costa <[email protected]> | 2025-06-22 19:36:56 +0200 |
---|---|---|
committer | Miguel Costa <[email protected]> | 2025-06-25 14:00:48 +0000 |
commit | 059df9cd95a82ff6febec4dcc448962393bf2e88 (patch) | |
tree | 7be1802cd4a315a08c8e33bbef1dbd94ea014957 /examples/EmbeddedWindow/QmlApp/embeddedwindow.cpp | |
parent | 251910aacf46f2c97c7d7f80adabd47d8d23b819 (diff) |
Includes:
* Implement QDotNetNativeInterface: specialization of QDotNetInterface
that wraps a pointer to native data.
* Implement IQVariant: QDotNetNativeInterface that wraps a QVariant.
* Implement IQModelIndex interface: QDotNetNativeInterface that wraps
a QModelIndex.
* Implement QDotNetAbstractListModel base class: allows extending
QAbstractListModel in C#.
* Add class QDotNetDelegate
* Remove old examples
Change-Id: I2eb21df29e1cf9379e14a64d5174eb934b5bf18a
Reviewed-by: Karsten Heimrich <[email protected]>
Diffstat (limited to 'examples/EmbeddedWindow/QmlApp/embeddedwindow.cpp')
-rw-r--r-- | examples/EmbeddedWindow/QmlApp/embeddedwindow.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/examples/EmbeddedWindow/QmlApp/embeddedwindow.cpp b/examples/EmbeddedWindow/QmlApp/embeddedwindow.cpp deleted file mode 100644 index 3b7b17d..0000000 --- a/examples/EmbeddedWindow/QmlApp/embeddedwindow.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************************************** - Copyright (C) 2023 The Qt Company Ltd. - SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -***************************************************************************************************/ - -#include "embeddedwindow.h" - -#include <QQmlContext> -#include <QQmlEngine> -#include <QQuickView> -#include <QWindow> - -#include "mainwindow.h" - -EmbeddedWindow::EmbeddedWindow(QQmlEngine *qmlEngine, MainWindow *mainWindow) - : qmlEngine(qmlEngine), mainWindow(mainWindow) -{ - connect(mainWindow, &MainWindow::contentRendered, this, &EmbeddedWindow::show); - connect(mainWindow, &MainWindow::closed, this, &EmbeddedWindow::close); -} - -EmbeddedWindow::~EmbeddedWindow() -{ - delete quickView; -} - -void EmbeddedWindow::show() -{ - embeddedWindow = QWindow::fromWinId((WId)mainWindow->hostHandle()); - quickView = new QQuickView(qmlEngine, embeddedWindow); - qmlEngine->rootContext()->setContextProperty("window", quickView); - quickView->setSource(QUrl(QStringLiteral("qrc:/main.qml"))); - quickView->show(); -} - -void EmbeddedWindow::close() -{ - embeddedWindow->close(); -} |