Click on Window breaks text selection
-
Hello ! I'm currently trying to create a software which will embed non-Qt apps (A game) into a QWidget windowContainer in order to help the player with a few things.
The embedded app is inside a QTabWidget.Here's the code for embeding the window into my Qt app :
WId wid = (WId)FindWindow(NULL, reinterpret_cast<LPCTSTR>(Tab[i].Window_Name.utf16())); QWindow *m_window; m_window = QWindow::fromWinId(wid); QWidget *m_widget; m_widget = QWidget::createWindowContainer(m_window, this); ui->QTabWidget_Game->addTab(m_widget,Tab[i].Window_Name);When I execute the QT app, it automatically checks if the game is running, if yes, it embeds the game in the QTabWidget.
The problem is, I can't get my embedded app to accept text selection or even copy/paste after clicking on the QT window itself with my mouse.
If, after launching the QT app, I do not click on the app's border (see screenshot) and directly click on the game, text selection will work.
P.S : By text selection, I mean this :

It's been like 2 weeks and I can't find anything on the web and I can't find how to do.
Please, help .. 😥 -
Hi and welcome to devnet,
I wonder if your are not hitting QTBUG-40320 ?
-
Hello @SGaist , first thank you for trying to help me ! 😁
I did check the post you linked and it seems it isn't quite the same problem. Tho he use the same functions to embed his apps in a QWidget.
My problem only concern text selection. I can still type text, use my keyboard and my mouse but I can't select text and I can't copy/paste/cut anything.
I can't even paste text present in my clipboard.(I developed this Qt app 2 times, first one being C++ based with QTCreator, and the other one being Python based with PyQt. The bug occurs on both apps)
EDIT : I tested my app with another window (I tried embeding steam) and I get the same bug (but not everytime) as the post you linked ! I can't type anything, steam seems to soft-lock randomly. Some time i can select/type, sometime not.
-
I wonder if it's question of strange interaction with the native event dispatcher.
-
Rather thinking out loud about Qt's implementation of QAbstractEventDispatcher for Windows.
Trust me, if I had it I would have already told you how to.