[Interest] Showing QGuiApplication/QML application on a given HWND ref.

Nuno Santos nunosantos at imaginando.pt
Wed Jun 3 12:56:41 CEST 2015


In my case I have a related app which opens the plugin. 

The host provides a window handle to the plugin.

I was trying to make that handle into a QWidget with the following code:

MyWindow::MyWindow(void* ptr) :
    QWidget(0)
{
    HWND w = (HWND) ptr;

    setGeometry(QRect(0,0,640,480));

    QPalette Pal(palette());

    // set black background
    Pal.setColor(QPalette::Background, Qt::black);
    setAutoFillBackground(true);
    setPalette(Pal);

    create((WId)w, false, false);
}

The problem is that two windows appear, the one the host provides and the one created by QWidget.

It seems that the create call is not working as intended.

MyWindow subclasses QWidget in order to call the create method since it’s protected.

Do you have any clue why this technic isn’t working?

Thanks,

Nuno Santos
Founder / CEO / CTO
www.imaginando.pt
+351 91 621 69 62

> On 03 Jun 2015, at 11:37, Bo Thorsen <bo at vikingsoft.eu> wrote:
> 
> Den 03-06-2015 kl. 12:35 skrev Nuno Santos:
>> Thanks for sharing your code.
>> 
>> I will try and give some feedback.
>> 
>> Any thoughts regarding the initial approach? Is there any reason for you
>> not having followed that path?
> 
> My application inserts an overlay over a complete unrelated application (the pokerstars or bet365 poker clients actually), so this is the only approach that can work.
> 
> Bo Thorsen,
> Director, Viking Software.
> 
> -- 
> Viking Software
> Qt and C++ developers for hire
> http://www.vikingsoft.eu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150603/5e16c0e6/attachment.html>


More information about the Interest mailing list