From c84b4ff4958bf3be513b3108d5a07d6565f95a98 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 29 Aug 2017 11:44:27 +0700 Subject: QTabWidget: Don't build expensive parts of the style option when hidden We end up calling setUpLayout() quite a few times and, in particular, every time we add a new tab. Even if the tab widget is hidden, we set the layout item margins to ensure that whatever layout will contain the tab widget can get the proper sizing. For all practical purposes, layout item margins don't depend on the contents itself, but are rather a simple constant returned by the style. This means that QStyleOptionTabWidgetFrame ::tabBarSize, among a few other properties, is not needed right away. This property in particular is quite expensive to compute because it requires measuring the text size of each tab. This can lead to a quadratic behavior: the size of each tab's text will be computed for each tab we add. Besides, text size computing has become a relatively expensive function in itself (see QTBUG-53151, for example). The current solution just uses a partially initialized style option object for the sole purpose of getting the tab widget's layout item margins from the style. The performance improvements detailed show the creation time for QTabWidget with the specified amount of tabs (times in ms): Tabs Before After ------------------- 1 6 5 5 6 6 10 8 6 50 57 17 100 178 21 200 673 33 Task-number: QTBUG-55126 Change-Id: I79505dbd0014f6ed185da28047d8b68f9462ba94 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qtabwidget.cpp | 83 ++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 34 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qtabwidget.cpp b/src/widgets/widgets/qtabwidget.cpp index c496d267b3..dc866a38cf 100644 --- a/src/widgets/widgets/qtabwidget.cpp +++ b/src/widgets/widgets/qtabwidget.cpp @@ -195,6 +195,8 @@ public: void _q_tabMoved(int from, int to); void init(); + void initBasicStyleOption(QStyleOptionTabWidgetFrame *option) const; + QTabBar *tabs; QStackedWidget *stack; QRect panelRect; @@ -257,6 +259,43 @@ bool QTabWidget::hasHeightForWidth() const return has; } +/*! + \internal + + Initialize only time inexpensive parts of the style option + for QTabWidget::setUpLayout()'s non-visible code path. +*/ +void QTabWidgetPrivate::initBasicStyleOption(QStyleOptionTabWidgetFrame *option) const +{ + Q_Q(const QTabWidget); + option->initFrom(q); + + if (q->documentMode()) + option->lineWidth = 0; + else + option->lineWidth = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, q); + + switch (pos) { + case QTabWidget::North: + option->shape = shape == QTabWidget::Rounded ? QTabBar::RoundedNorth + : QTabBar::TriangularNorth; + break; + case QTabWidget::South: + option->shape = shape == QTabWidget::Rounded ? QTabBar::RoundedSouth + : QTabBar::TriangularSouth; + break; + case QTabWidget::West: + option->shape = shape == QTabWidget::Rounded ? QTabBar::RoundedWest + : QTabBar::TriangularWest; + break; + case QTabWidget::East: + option->shape = shape == QTabWidget::Rounded ? QTabBar::RoundedEast + : QTabBar::TriangularEast; + break; + } + + option->tabBarRect = q->tabBar()->geometry(); +} /*! Initialize \a option with the values from this QTabWidget. This method is useful @@ -271,12 +310,7 @@ void QTabWidget::initStyleOption(QStyleOptionTabWidgetFrame *option) const return; Q_D(const QTabWidget); - option->initFrom(this); - - if (documentMode()) - option->lineWidth = 0; - else - option->lineWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, this); + d->initBasicStyleOption(option); int exth = style()->pixelMetric(QStyle::PM_TabBarBaseHeight, 0, this); QSize t(0, d->stack->frameWidth()); @@ -307,31 +341,10 @@ void QTabWidget::initStyleOption(QStyleOptionTabWidgetFrame *option) const option->leftCornerWidgetSize = QSize(0, 0); } - switch (d->pos) { - case QTabWidget::North: - option->shape = d->shape == QTabWidget::Rounded ? QTabBar::RoundedNorth - : QTabBar::TriangularNorth; - break; - case QTabWidget::South: - option->shape = d->shape == QTabWidget::Rounded ? QTabBar::RoundedSouth - : QTabBar::TriangularSouth; - break; - case QTabWidget::West: - option->shape = d->shape == QTabWidget::Rounded ? QTabBar::RoundedWest - : QTabBar::TriangularWest; - break; - case QTabWidget::East: - option->shape = d->shape == QTabWidget::Rounded ? QTabBar::RoundedEast - : QTabBar::TriangularEast; - break; - } - option->tabBarSize = t; - QRect tbRect = tabBar()->geometry(); QRect selectedTabRect = tabBar()->tabRect(tabBar()->currentIndex()); - option->tabBarRect = tbRect; - selectedTabRect.moveTopLeft(selectedTabRect.topLeft() + tbRect.topLeft()); + selectedTabRect.moveTopLeft(selectedTabRect.topLeft() + option->tabBarRect.topLeft()); option->selectedTabRect = selectedTabRect; } @@ -763,17 +776,19 @@ void QTabWidget::setUpLayout(bool onlyCheck) if (onlyCheck && !d->dirty) return; // nothing to do - QStyleOptionTabWidgetFrame option; - initStyleOption(&option); - - // this must be done immediately, because QWidgetItem relies on it (even if !isVisible()) - d->setLayoutItemMargins(QStyle::SE_TabWidgetLayoutItem, &option); - if (!isVisible()) { + // this must be done immediately, because QWidgetItem relies on it (even if !isVisible()) + QStyleOptionTabWidgetFrame basicOption; + d->initBasicStyleOption(&basicOption); + d->setLayoutItemMargins(QStyle::SE_TabWidgetLayoutItem, &basicOption); d->dirty = true; return; // we'll do it later } + QStyleOptionTabWidgetFrame option; + initStyleOption(&option); + d->setLayoutItemMargins(QStyle::SE_TabWidgetLayoutItem, &option); + QRect tabRect = style()->subElementRect(QStyle::SE_TabWidgetTabBar, &option, this); d->panelRect = style()->subElementRect(QStyle::SE_TabWidgetTabPane, &option, this); QRect contentsRect = style()->subElementRect(QStyle::SE_TabWidgetTabContents, &option, this); -- cgit v1.2.3 From d29f0bc65c1817bb73153cd546d7ab76e0768be0 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 25 Aug 2017 16:24:44 +0700 Subject: Avoid calling QCompleter::popup() internally QCompleter::popup() is used to lazily create the popup itself. However, we oftentimes call this function only to check if the popup is visible. Change-Id: I55531e1e6810c02a44f5f65124cf641b1a89de69 Reviewed-by: Gabriel de Dietrich Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/widgets/qcombobox.cpp | 15 ++++++++------- src/widgets/widgets/qwidgetlinecontrol.cpp | 11 +++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index b6bb31c391..54d33a7eea 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -71,6 +71,7 @@ #include #include #include +#include #include #if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(effetcts) && QT_CONFIG(style_mac) #include @@ -3140,13 +3141,13 @@ void QComboBox::keyPressEvent(QKeyEvent *e) Q_D(QComboBox); #if QT_CONFIG(completer) - if (d->lineEdit - && d->lineEdit->completer() - && d->lineEdit->completer()->popup() - && d->lineEdit->completer()->popup()->isVisible()) { - // provide same autocompletion support as line edit - d->lineEdit->event(e); - return; + if (const auto *cmpltr = completer()) { + const auto *popup = QCompleterPrivate::get(cmpltr)->popup; + if (popup && popup->isVisible()) { + // provide same autocompletion support as line edit + d->lineEdit->event(e); + return; + } } #endif diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 1b7a41d547..32944b3918 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -44,6 +44,7 @@ #endif #include "qclipboard.h" #include +#include #include #include #ifndef QT_NO_ACCESSIBILITY @@ -1484,7 +1485,8 @@ void QWidgetLineControl::complete(int key) } else { #ifndef QT_KEYPAD_NAVIGATION if (text.isEmpty()) { - m_completer->popup()->hide(); + if (auto *popup = QCompleterPrivate::get(m_completer)->popup) + popup->hide(); return; } #endif @@ -1630,10 +1632,10 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) #if QT_CONFIG(completer) if (m_completer) { QCompleter::CompletionMode completionMode = m_completer->completionMode(); + auto *popup = QCompleterPrivate::get(m_completer)->popup; if ((completionMode == QCompleter::PopupCompletion || completionMode == QCompleter::UnfilteredPopupCompletion) - && m_completer->popup() - && m_completer->popup()->isVisible()) { + && popup && popup->isVisible()) { // The following keys are forwarded by the completer to the widget // Ignoring the events lets the completer provide suitable default behavior switch (event->key()) { @@ -1648,7 +1650,8 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) if (!QApplication::keypadNavigationEnabled()) break; #endif - m_completer->popup()->hide(); // just hide. will end up propagating to parent + popup->hide(); // just hide. will end up propagating to parent + break; default: break; // normal key processing } -- cgit v1.2.3 From 4c025ca9c73bda320f0e7577a4fbd141c31d7c8c Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 28 Aug 2017 10:04:35 +0700 Subject: QCompleter: Send activated() signal only once on return key Due to the complex event forwarding logic between QCompleter, QComboBox, QLineEdit and QWidgetLineControl, in some cases the same single user return key press could result in duplicated activated() signals being emitted by QComboBox. The first one would be emitted because QLineEdit emitted editingFinished() as a result of QCompleter::eventFilter() having forwarded the return key press event to QComboBox. The second one, would happen right after, as QCompleter::eventFilter() would process the same event on behalf of its popup. (We recall that QCompleter is installed as its own popup event filter. That's also the case for the completer's widget, although the purpose there is limited to focus-out events). The current fix consists on skipping the emit as a result of QLineEdit::editingFinished() if the completer's popup is still active. For this to be accurate, it helps to test whether the completer's popup is visible, so we will not be hiding it in QWidgetLineControl::processKeyEvent() anymore. Indeed, we know that if the popup is visible, that means that processKeyEvent() was called after being forwarded by the completer's popup event filter. Furthermore, the popup will be hidden by its event filter shortly after it returns from said event forwarding call. Based on a patch by Alexey Chernov <4ernov@gmail.com>. Task-number: QTBUG-51858 Task-number: QTBUG-51889 Change-Id: I013f6c3000ae37b5b0ec20eaf5cf7746c9c903e3 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qcombobox.cpp | 23 +++++++++++++++++++++-- src/widgets/widgets/qwidgetlinecontrol.cpp | 10 ---------- 2 files changed, 21 insertions(+), 12 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 54d33a7eea..e0bc198d2e 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1210,8 +1210,27 @@ Qt::MatchFlags QComboBoxPrivate::matchFlags() const void QComboBoxPrivate::_q_editingFinished() { Q_Q(QComboBox); - if (lineEdit && !lineEdit->text().isEmpty() && itemText(currentIndex) != lineEdit->text()) { - const int index = q_func()->findText(lineEdit->text(), matchFlags()); + if (!lineEdit) + return; + const auto leText = lineEdit->text(); + if (!leText.isEmpty() && itemText(currentIndex) != leText) { +#if QT_CONFIG(completer) + const auto *leCompleter = lineEdit->completer(); + const auto *popup = leCompleter ? QCompleterPrivate::get(leCompleter)->popup : nullptr; + if (popup && popup->isVisible()) { + // QLineEdit::editingFinished() will be emitted before the code flow returns + // to QCompleter::eventFilter(), where QCompleter::activated() may be emitted. + // We know that the completer popup will still be visible at this point, and + // that any selection should be valid. + const QItemSelectionModel *selModel = popup->selectionModel(); + const QModelIndex curIndex = popup->currentIndex(); + const bool completerIsActive = selModel && selModel->selectedIndexes().contains(curIndex); + + if (completerIsActive) + return; + } +#endif + const int index = q_func()->findText(leText, matchFlags()); if (index != -1) { q->setCurrentIndex(index); emitActivated(currentIndex); diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 32944b3918..4f4a6f70b5 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1642,16 +1642,6 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) case Qt::Key_Escape: event->ignore(); return; - case Qt::Key_Enter: - case Qt::Key_Return: - case Qt::Key_F4: -#ifdef QT_KEYPAD_NAVIGATION - case Qt::Key_Select: - if (!QApplication::keypadNavigationEnabled()) - break; -#endif - popup->hide(); // just hide. will end up propagating to parent - break; default: break; // normal key processing } -- cgit v1.2.3 From aa4fef88121f536f40760449fa81c03be076d68d Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 11 Sep 2017 18:14:51 +0200 Subject: Make QDateTimeParser a separate feature It was being mis-described in some places by a QT_CONFIG(timezone) test, replacing older QT_BOOTSTRAPPED checks; but it has no time-zone dependency (until 5.10). So make it a separate feature in its own right. It turns out QAbstractSpinBox's presumed dependency on datetimeedit was an illusion caused by use of QDATETIMEEDIT_*_MIN symbols actually provided by datetimeparser; so remove its bogus dependency. Change-Id: Ibc12f4a9ee35acb64a39a1c7a15d2934b5710dc0 Reviewed-by: Thiago Macieira --- src/widgets/widgets/qabstractspinbox.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index c72c060f9a..3427579d1f 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -39,7 +39,9 @@ #include #include +#if QT_CONFIG(datetimeparser) #include +#endif #include #include @@ -47,9 +49,6 @@ #include #include #include -#if QT_CONFIG(datetimeedit) -#include -#endif #include #if QT_CONFIG(menu) #include @@ -1962,12 +1961,15 @@ QVariant operator+(const QVariant &arg1, const QVariant &arg2) break; } case QVariant::Double: ret = QVariant(arg1.toDouble() + arg2.toDouble()); break; +#if QT_CONFIG(datetimeparser) case QVariant::DateTime: { QDateTime a2 = arg2.toDateTime(); QDateTime a1 = arg1.toDateTime().addDays(QDATETIMEEDIT_DATETIME_MIN.daysTo(a2)); a1.setTime(a1.time().addMSecs(QTime().msecsTo(a2.time()))); ret = QVariant(a1); + break; } +#endif // datetimeparser default: break; } return ret; @@ -2022,6 +2024,7 @@ QVariant operator*(const QVariant &arg1, double multiplier) ret = static_cast(qBound(INT_MIN, arg1.toInt() * multiplier, INT_MAX)); break; case QVariant::Double: ret = QVariant(arg1.toDouble() * multiplier); break; +#if QT_CONFIG(datetimeparser) case QVariant::DateTime: { double days = QDATETIMEEDIT_DATE_MIN.daysTo(arg1.toDateTime().date()) * multiplier; int daysInt = (int)days; @@ -2031,6 +2034,7 @@ QVariant operator*(const QVariant &arg1, double multiplier) ret = QDateTime(QDate().addDays(int(days)), QTime().addMSecs(msecs)); break; } +#endif // datetimeparser default: ret = arg1; break; } @@ -2053,11 +2057,14 @@ double operator/(const QVariant &arg1, const QVariant &arg2) a1 = arg1.toDouble(); a2 = arg2.toDouble(); break; +#if QT_CONFIG(datetimeparser) case QVariant::DateTime: a1 = QDATETIMEEDIT_DATE_MIN.daysTo(arg1.toDate()); a2 = QDATETIMEEDIT_DATE_MIN.daysTo(arg2.toDate()); a1 += (double)QDATETIMEEDIT_TIME_MIN.msecsTo(arg1.toDateTime().time()) / (long)(3600 * 24 * 1000); a2 += (double)QDATETIMEEDIT_TIME_MIN.msecsTo(arg2.toDateTime().time()) / (long)(3600 * 24 * 1000); + break; +#endif // datetimeparser default: break; } -- cgit v1.2.3 From 35781b358887facf954307b0d6c5958ce089eb72 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Wed, 23 Aug 2017 11:48:11 +0200 Subject: Return focus to correct widget after showing menu By the time we call setKeyboardMode(true), the menu may already have taken focus. This change sets keyboardFocusWidget before opening the popup, and makes sure that keyboardFocusWidget is not set to the popup. (We cannot remove the assignment from setKeyboardMode(), since it's called from several places.) [ChangeLog][QtWidgets] Fixed widget losing focus after showing menu second time. Task-number: QTBUG-56860 Change-Id: Ic01726bf694e6f365dd7b601ad555156e0fdf6c5 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qmenubar.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 3d24cc0387..41b6bf49f8 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -288,7 +288,7 @@ void QMenuBarPrivate::setKeyboardMode(bool b) keyboardState = b; if(b) { QWidget *fw = QApplication::focusWidget(); - if (fw != q) + if (fw && fw != q && fw->window() != QApplication::activePopupWidget()) keyboardFocusWidget = fw; focusFirstAction(); q->setFocus(Qt::MenuBarFocusReason); @@ -1706,6 +1706,7 @@ void QMenuBarPrivate::_q_internalShortcutActivated(int id) } } + keyboardFocusWidget = QApplication::focusWidget(); setCurrentAction(act, true, true); if (act && !act->menu()) { activateAction(act, QAction::Trigger); -- cgit v1.2.3 From 5ff9d6a470dbcf424f2f43206ab6ab6eb91edcc1 Mon Sep 17 00:00:00 2001 From: Oleg Yadrov Date: Mon, 2 Oct 2017 10:27:10 -0400 Subject: QMacStyle: smooth QMenu corners for real It's been for years that QMenu's rounded corners in qmacstyle_mac were done via QWidget::setMask(QRegion). Unfortunately, QRegion mask does not work well with retina displays and also does not support translucency. That's why in this change we explicitly make QMenu's background transparent and then draw a rectangle with rounded corners in QMacStyle::drawPrimitive(PE_PanelMenu). This not only gives much better result than the mask-based approach, but also de-HIThemes QMenu. As a consequence, QComboBoxPrivateContainer doesn't get any mask from QMacStyle anymore. Therefore, when the mask is empty, we need to paint PE_PanelMenu before invoking QFrame's paint event handler. Made-with: Gabriel de Dietrich Change-Id: Ia9236176113f23b86e45507fa6ddf77236084ce3 Reviewed-by: Oleg Yadrov Reviewed-by: Gabriel de Dietrich --- src/widgets/widgets/qcombobox.cpp | 14 ++++++++++++++ src/widgets/widgets/qcombobox_p.h | 1 + 2 files changed, 15 insertions(+) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 1338a496e6..9afb4b3ae6 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -428,6 +428,20 @@ void QComboBoxPrivateContainer::resizeEvent(QResizeEvent *e) QFrame::resizeEvent(e); } +void QComboBoxPrivateContainer::paintEvent(QPaintEvent *e) +{ + QStyleOptionComboBox cbOpt = comboStyleOption(); + if (combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &cbOpt, combo) + && mask().isEmpty()) { + QStyleOption opt; + opt.initFrom(this); + QPainter p(this); + style()->drawPrimitive(QStyle::PE_PanelMenu, &opt, &p, this); + } + + QFrame::paintEvent(e); +} + void QComboBoxPrivateContainer::leaveEvent(QEvent *) { // On Mac using the Mac style we want to clear the selection diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h index 835bbf866e..3f75a357e4 100644 --- a/src/widgets/widgets/qcombobox_p.h +++ b/src/widgets/widgets/qcombobox_p.h @@ -248,6 +248,7 @@ protected: void timerEvent(QTimerEvent *timerEvent) override; void leaveEvent(QEvent *e) override; void resizeEvent(QResizeEvent *e) override; + void paintEvent(QPaintEvent *e) override; QStyleOptionComboBox comboStyleOption() const; Q_SIGNALS: -- cgit v1.2.3 From ac35f9c44c0fb3b2f40ae5585c497200b2ba743d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 6 Oct 2017 15:50:29 +0200 Subject: macOS: Mark the widget's container as embedded when placed into NSMenuItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we'll end up creating a NSPanel for the QMacNativeWidget which is never closed, even if the backing NSView is moved to a new superview. Ideally this would be based on [NSView viewDidMoveToSuperview] and [NSView viewDidMoveToWindow], with retain/releases of the corresponding NSWindow, but that needs more research, especially as AppKit on macOS 10.13 will always keep a strong reference to the NSWindow. Task-number: QTBUG-63443 Change-Id: I9eec5ea871373d00dedf154600bf7005898cf37a Reviewed-by: Morten Johan Sørvig --- src/widgets/widgets/qmenu_mac.mm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm index 7d932c670f..0d680fb4dc 100644 --- a/src/widgets/widgets/qmenu_mac.mm +++ b/src/widgets/widgets/qmenu_mac.mm @@ -135,6 +135,11 @@ void QMenuPrivate::moveWidgetToPlatformItem(QWidget *widget, QPlatformMenuItem* containerWindow->setFlags(wf | Qt::SubWindow); [(NSView *)widget->winId() setAutoresizingMask:NSViewWidthSizable]; + if (QPlatformNativeInterface::NativeResourceForIntegrationFunction function = resolvePlatformFunction("setEmbeddedInForeignView")) { + typedef void (*SetEmbeddedInForeignViewFunction)(QPlatformWindow *window, bool embedded); + reinterpret_cast(function)(containerWindow->handle(), true); + } + item->setNativeContents((WId)containerView); container->show(); } -- cgit v1.2.3