Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.4.1
-
None
-
Windows 7 - x64
Qt5.4.1
Description
I want to use the QWidet::createWindowContainer to reparenting a QWidget from another process to my "main" application.
In the sample i used the createInContainer with a QWidget created outside the application and with a QWidget created inside the application. The createInContainer works when the widget is created in the application but when the widget comes from another application the display is wrong.
// Create the independent window ------------------------------- QWidget* widget = new QWidget(); widget->setWindowTitle(MY_TITLE); widget->setAttribute( Qt::WA_DeleteOnClose ); widget->setAttribute(Qt::WA_NativeWindow, true); widget->setAttribute(Qt::WA_NoSystemBackground, true); widget->setAutoFillBackground(false); QVBoxLayout *verticalLayout( new QVBoxLayout(widget) ); QComboBox* combo = new QComboBox(widget); combo->addItem("Combobox create outside this app - 1"); combo->addItem("Combobox create outside this app - 2"); verticalLayout->addWidget(combo); widget->show();
// Find the independent window ------------------------------- TCHAR* tTitle = (TCHAR*)MY_TITLE.utf16(); WId myWidgetId = (WId)::FindWindow(0, tTitle); //------------------------------------------------------------ QWindow* window = QWindow::fromWinId(myWidgetId); QWidget* container = QWidget::createWindowContainer(window); container->setFocusPolicy(Qt::TabFocus); container->setMinimumSize(100,50); ui->verticalLayout->addWidget(container);
The Qwidget from process A is embedded in the process B but:
- the initial display is wrong
- wrong display on combobox click
- after moving the window
Sample Source code attached but works only for windows:
- Run MyWidget First
- Then run CreateInContainer
(The application won't shut down after closing the window, i didn't find a solution for that)
Attachments
Issue Links
- depends on
-
QTBUG-67698 QQmlApplicationEngine/QWidget::createWindowContainer Interface drift
- Reported
- relates to
-
QTBUG-41186 Clarify functionality of QWindow::fromWinId() on the various platforms
- Reported
-
QTBUG-40320 Multiple issues with foreign windows from QWindow::fromWinId() and QWidget::createWindowContainer()
- Reported