-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.7.0
-
None
-
-
988039729 (dev), 4d5aedac1 (6.7)
The native NSSearchField, which is added using QWidget::createWindowContainer is no longer visible after hide/show of the QDialog.
It used to work with in Qt 5 with QMacCocoaViewContainer(), but the same code no longer works in Qt 5 or Qt 6 using the new QWidget::createWindowContainer.
Specifically, it's added to the QDialog using:
layout()->addWidget(QWidget::createWindowContainer(QWindow::fromWinId(WId(nsSearchField)), this));
See attached test project.
To reproduce:
1. Press the button to open the dialog, search field appears.
2. Close the dialog
3. Press the button again to open the dialog, search field is no longer visible.
| For Gerrit Dashboard: QTBUG-124160 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 553610,6 | QWindow: Persist foreign winId to support destroy/create cycles | dev | qt/qtbase | Status: MERGED | +2 | +1 |
| 556264,2 | QWindow: Persist foreign winId to support destroy/create cycles | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
| 556370,1 | QWindow: Persist foreign winId to support destroy/create cycles | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: ABANDONED | 0 | 0 |