diff options
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 07c55e4db6..0b52747b6a 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1521,7 +1521,7 @@ int QComboBox::maxCount() const /*! \obsolete - Use setCompleter() instead. + Use completer() instead. */ bool QComboBox::autoCompletion() const { @@ -1881,12 +1881,11 @@ void QComboBox::setLineEdit(QLineEdit *edit) d->updateFocusPolicy(); d->lineEdit->setFocusProxy(this); d->lineEdit->setAttribute(Qt::WA_MacShowFocusRect, false); +#if QT_DEPRECATED_SINCE(5, 13) #if QT_CONFIG(completer) setAutoCompletion(d->autoCompletion); -#endif #ifdef QT_KEYPAD_NAVIGATION -#if QT_CONFIG(completer) if (QApplication::keypadNavigationEnabled()) { // Editable combo boxes will have a completer that is set to UnfilteredPopupCompletion. // This means that when the user enters edit mode they are immediately presented with a @@ -1899,6 +1898,7 @@ void QComboBox::setLineEdit(QLineEdit *edit) } #endif #endif +#endif setAttribute(Qt::WA_InputMethodEnabled); d->updateLayoutDirection(); @@ -2618,7 +2618,7 @@ bool QComboBoxPrivate::showNativePopup() // We need to fake one here to un-press the button. QMouseEvent mouseReleased(QEvent::MouseButtonRelease, q->pos(), Qt::LeftButton, Qt::MouseButtons(Qt::LeftButton), Qt::KeyboardModifiers()); - qApp->sendEvent(q, &mouseReleased); + QCoreApplication::sendEvent(q, &mouseReleased); #endif return true; @@ -2838,19 +2838,15 @@ void QComboBox::showPopup() bool startTimer = !container->isVisible(); container->raise(); container->create(); - QWindow *containerWindow = container->window()->windowHandle(); - if (containerWindow) { - QWindow *win = window()->windowHandle(); - if (win) { - QScreen *currentScreen = win->screen(); - if (currentScreen && !currentScreen->virtualSiblings().contains(containerWindow->screen())) { - containerWindow->setScreen(currentScreen); - - // This seems to workaround an issue in xcb+multi GPU+multiscreen - // environment where the window might not always show up when screen - // is changed. - container->hide(); - } + if (QWindow *containerWindow = qt_widget_private(container)->windowHandle(QWidgetPrivate::WindowHandleMode::TopLevel)) { + QScreen *currentScreen = d->associatedScreen(); + if (currentScreen && !currentScreen->virtualSiblings().contains(containerWindow->screen())) { + containerWindow->setScreen(currentScreen); + + // This seems to workaround an issue in xcb+multi GPU+multiscreen + // environment where the window might not always show up when screen + // is changed. + container->hide(); } } container->show(); @@ -2919,7 +2915,7 @@ void QComboBox::hidePopup() bool didFade = false; if (needFade) { #if defined(Q_OS_MAC) - QPlatformNativeInterface *platformNativeInterface = qApp->platformNativeInterface(); + QPlatformNativeInterface *platformNativeInterface = QGuiApplication::platformNativeInterface(); int at = platformNativeInterface->metaObject()->indexOfMethod("fadeWindow()"); if (at != -1) { QMetaMethod windowFade = platformNativeInterface->metaObject()->method(at); |