<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QML&#x27;s Native parent Window]]></title><description><![CDATA[<p dir="auto">I write a QML Window like this</p>
<pre><code>import QtQuick 2.9
import QtQuick.Window 2.2

Window {
    visible: true
    width: text1.width
    height: text1.height
    title: qsTr("Hello World")
    flags: Qt.FramelessWindowHint
    color: "#70000000"
    x: 0
    y: 0
    Text {
        id: text1
        x: 0
        y: 0
        text: "Hello World"
        color: "#FFFF0000"
    }
}
</code></pre>
<pre><code>int main(int argc, char *argv[])
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QGuiApplication app(argc, argv);
    QQuickView::setSceneGraphBackend(QSGRendererInterface::Software);
    QQmlApplicationEngine engine;
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));

    if (engine.rootObjects().isEmpty())
        return -1;
    QQuickWindow *pMainWnd = qobject_cast&lt;QQuickWindow*&gt;(engine.rootObjects()[0]);
    HWND hShowWnd = (HWND)pMainWnd-&gt;winId();

    DWORD dwStyle = GetWindowLong(hShowWnd, GWL_STYLE);
    SetWindowLong(hShowWnd, GWL_STYLE, dwStyle | WS_POPUP | WS_VISIBLE);
    DWORD dwExStyle = GetWindowLong(hShowWnd, GWL_EXSTYLE);
    SetWindowLong(hShowWnd, GWL_EXSTYLE, dwExStyle | WS_EX_TOOLWINDOW);
    HWND hWndParent = FindWindow(nullptr, TEXT("MFCApplication1"));
    SetParent(hShowWnd, hWndParent); //Windows API
    return app.exec();
}
</code></pre>
<p dir="auto">it can not display on MFCApplication1 Window</p>
]]></description><link>https://forum.qt.io/topic/97832/qml-s-native-parent-window</link><generator>RSS for Node</generator><lastBuildDate>Tue, 01 Sep 2026 04:24:53 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/97832.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Dec 2018 07:08:10 GMT</pubDate><ttl>60</ttl></channel></rss>