From 903a59042e4017d851d8b32f2f8568fd36aeb2c8 Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Tue, 24 Jan 2017 20:12:04 +0200 Subject: Fix QComboBox popup from opening on wrong screen Nothing seems to be telling the popup on which screen it should be shown on. To fix this, simply set same screen the QComboBox uses to the popup. Task-number: QTBUG-58392 Change-Id: If62a26fe4e51bcf3d770ee72c9baa998541618f4 Reviewed-by: Andy Shaw --- src/widgets/widgets/qcombobox.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index b18066c174..2376a18e43 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -2746,6 +2746,22 @@ 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(); + } + } + } container->show(); container->updateScrollers(); view()->setFocus(); -- cgit v1.2.3 From 38bedf34c9190e3ab7d662eed39a1248698095d8 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Thu, 20 Apr 2017 20:12:20 +0200 Subject: Remove wrong features.rubberband condition of features.dockwidget Change-Id: I8259274e7eba7943eb3a944a18fa8b598eb697d7 Reviewed-by: Lars Knoll --- src/widgets/widgets/qdockwidget.cpp | 1 - src/widgets/widgets/qdockwidget_p.h | 1 - 2 files changed, 2 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 307a261a43..6d9731e962 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include diff --git a/src/widgets/widgets/qdockwidget_p.h b/src/widgets/widgets/qdockwidget_p.h index 84bf8efacf..2d62cf5acd 100644 --- a/src/widgets/widgets/qdockwidget_p.h +++ b/src/widgets/widgets/qdockwidget_p.h @@ -63,7 +63,6 @@ QT_BEGIN_NAMESPACE class QGridLayout; class QWidgetResizeHandler; -class QRubberBand; class QDockWidgetTitleButton; class QSpacerItem; class QDockWidgetItem; -- cgit v1.2.3 From 72b3fa702ab9ea7cc2252ef33a72a791aa032058 Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Thu, 20 Apr 2017 19:50:15 +0200 Subject: Remove features.rubberband dependency of features.splitter Change-Id: Ia55850f37f9384c8e00cef699fa308a02af64fd5 Reviewed-by: Lars Knoll --- src/widgets/widgets/qsplitter.cpp | 6 ++++++ src/widgets/widgets/qsplitter_p.h | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 1676c188a6..4c077f5f9f 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -975,7 +975,9 @@ QSplitter::QSplitter(Qt::Orientation orientation, QWidget *parent) QSplitter::~QSplitter() { Q_D(QSplitter); +#if QT_CONFIG(rubberband) delete d->rubberBand; +#endif while (!d->list.isEmpty()) delete d->list.takeFirst(); } @@ -1325,6 +1327,7 @@ void QSplitter::childEvent(QChildEvent *c) void QSplitter::setRubberBand(int pos) { +#if QT_CONFIG(rubberband) Q_D(QSplitter); if (pos < 0) { if (d->rubberBand) @@ -1345,6 +1348,9 @@ void QSplitter::setRubberBand(int pos) : QRect(QPoint(r.x(), pos + hw / 2 - rBord), QSize(r.width(), 2 * rBord)); d->rubberBand->setGeometry(newGeom); d->rubberBand->show(); +#else + Q_UNUSED(pos); +#endif } /*! diff --git a/src/widgets/widgets/qsplitter_p.h b/src/widgets/widgets/qsplitter_p.h index 07b43e56b8..0730fab824 100644 --- a/src/widgets/widgets/qsplitter_p.h +++ b/src/widgets/widgets/qsplitter_p.h @@ -81,11 +81,17 @@ class QSplitterPrivate : public QFramePrivate { Q_DECLARE_PUBLIC(QSplitter) public: - QSplitterPrivate() : rubberBand(0), opaque(true), firstShow(true), + QSplitterPrivate() : +#if QT_CONFIG(rubberband) + rubberBand(0), +#endif + opaque(true), firstShow(true), childrenCollapsible(true), compatMode(false), handleWidth(-1), blockChildAdd(false), opaqueResizeSet(false) {} ~QSplitterPrivate(); +#if QT_CONFIG(rubberband) QPointer rubberBand; +#endif mutable QList list; Qt::Orientation orient; bool opaque : 8; -- cgit v1.2.3 From 41eefd7493bf0119a4fd1a069e31ab4f2c4d10f9 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 20 Apr 2017 16:07:06 +0200 Subject: Deprecate QCoreApplication::flush() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... as it has outlived its original purpose: Qt3 implementation on X11: void QApplication::flush() { flushX(); } void QApplication::flushX() { if (appDpy) XFlush( appDpy ); } Qt4 implementation on X11: Did nothing when QApplication::flush() was called (the flush() overrides in {unix,glib} event dispatchers with empty bodies). In Qt5 this function somehow has been repurposed (inconsistently) to do what QCoreApplication::sendPostedEvents already does: QAbstractEventDispatcher::flush() = 0; => QCocoaEventDispatcher::flush() {} => QEventDispatcherCoreFoundation::flush() {} => QIOSEventDispatcher (does not override ::flush()) => QEventDispatcherGlib::flush() {} => QPAEventDispatcherGlib (does not override ::flush()) => QEventDispatcherUNIX::flush() {} => QUnixEventDispatcherQPA (when QT_NO_GLIB=true) ::flush() { if (qApp) qApp->sendPostedEvents(); }) ==> QAndroidEventDispatcher (does not override ::flush()) => QEventDispatcherWin32::flush() {} => QOffscreenEventDispatcher::flush() { if (qApp) qApp->sendPostedEvents(); QEventDispatcherWin32::flush(); } => QWindowsGuiEventDispatcher (does not override ::flush()) => QWindowsDirect2DEventDispatcher (does not override ::flush()) => QEventDispatcherWinRT::flush() {} => QOffscreenEventDispatcher::flush() { if (qApp) qApp->sendPostedEvents(); QEventDispatcherWinRT::flush(); } => QWinRTEventDispatcher (qminimaleglintegration.cpp) (does not override ::flush()) => QWinRTEventDispatcher (qwinrteventdispatcher.h) (does not override ::flush()) Whatever this function was doing on macOS in Qt3 and Qt4 also has been dropped in Qt5. It appears that the other event dispatchers in Qt5 that have overrides for flush() have simply copy-pasted this logic. Clearly the documentation of QCoreApplication::flush() is outdated and has nothing to do with the actual implementation in Qt5. This function is rarely used in Qt5 sources. It should be safe to remove the calls to QCoreApplication::flush() from Qt source code, as this function has been doing nothing on most platforms anyways. Repurposing it even broke handling of posted events (see QTBUG-48717). [ChangeLog][QtCore][Event loop] QCoreApplication::flush() is now deprecated. Use QCoreApplication::processEvents() and QCoreApplication::sendPostedEvents() instead. Task-number: QTBUG-33489 Task-number: QTBUG-48717 Change-Id: Icc7347ff203024b7153ea74be6bf527dd07ce821 Reviewed-by: Tor Arne Vestbø Reviewed-by: David Faure Reviewed-by: Gunnar Sletta --- src/widgets/widgets/qabstractbutton.cpp | 18 ++++++------------ src/widgets/widgets/qsplashscreen.cpp | 19 +++++++------------ 2 files changed, 13 insertions(+), 24 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index c0bd8bce5a..77fb203b82 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -396,8 +396,7 @@ void QAbstractButtonPrivate::click() } blockRefresh = false; refresh(); - q->repaint(); //flush paint event before invoking potentially expensive operation - QApplication::flush(); + q->repaint(); if (guard) emitReleased(); if (guard) @@ -834,8 +833,7 @@ void QAbstractButton::animateClick(int msec) if (d->checkable && focusPolicy() & Qt::ClickFocus) setFocus(); setDown(true); - repaint(); //flush paint event before invoking potentially expensive operation - QApplication::flush(); + repaint(); if (!d->animateTimer.isActive()) d->emitPressed(); d->animateTimer.start(msec, this); @@ -977,8 +975,7 @@ void QAbstractButton::mousePressEvent(QMouseEvent *e) if (hitButton(e->pos())) { setDown(true); d->pressed = true; - repaint(); //flush paint event before invoking potentially expensive operation - QApplication::flush(); + repaint(); d->emitPressed(); e->accept(); } else { @@ -1025,8 +1022,7 @@ void QAbstractButton::mouseMoveEvent(QMouseEvent *e) if (hitButton(e->pos()) != d->down) { setDown(!d->down); - repaint(); //flush paint event before invoking potentially expensive operation - QApplication::flush(); + repaint(); if (d->down) d->emitPressed(); else @@ -1051,8 +1047,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e) case Qt::Key_Space: if (!e->isAutoRepeat()) { setDown(true); - repaint(); //flush paint event before invoking potentially expensive operation - QApplication::flush(); + repaint(); d->emitPressed(); } break; @@ -1103,8 +1098,7 @@ void QAbstractButton::keyPressEvent(QKeyEvent *e) #ifndef QT_NO_SHORTCUT if (e->matches(QKeySequence::Cancel) && d->down) { setDown(false); - repaint(); //flush paint event before invoking potentially expensive operation - QApplication::flush(); + repaint(); d->emitReleased(); return; } diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp index 4ad2b83582..2758af53ef 100644 --- a/src/widgets/widgets/qsplashscreen.cpp +++ b/src/widgets/widgets/qsplashscreen.cpp @@ -164,15 +164,14 @@ void QSplashScreen::mousePressEvent(QMouseEvent *) } /*! - This overrides QWidget::repaint(). It differs from the standard - repaint function in that it also calls QApplication::flush() to - ensure the updates are displayed, even when there is no event loop - present. + This overrides QWidget::repaint(). It differs from the standard repaint + function in that it also calls QApplication::processEvents() to ensure + the updates are displayed, even when there is no event loop present. */ void QSplashScreen::repaint() { QWidget::repaint(); - QApplication::flush(); + QApplication::processEvents(); } /*! @@ -190,13 +189,9 @@ void QSplashScreen::repaint() /*! Draws the \a message text onto the splash screen with color \a color and aligns the text according to the flags in \a alignment. - - To make sure the splash screen is repainted immediately, you can - call \l{QCoreApplication}'s - \l{QCoreApplication::}{processEvents()} after the call to - showMessage(). You usually want this to make sure that the message - is kept up to date with what your application is doing (e.g., - loading files). + This function calls repaint() to make sure the splash screen is + repainted immediately. As a result the message is kept up + to date with what your application is doing (e.g. loading files). \sa Qt::Alignment, clearMessage(), message() */ -- cgit v1.2.3 From 2eee24702b8f3a83e8fdd810fa22f2fe65ee848b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 19 Apr 2017 11:16:14 +0200 Subject: Fix UB in QSplitter::childEvent The widget might be in the QObject destructor when the event is received, so we can't static cast. There is no need to check for isWindow for ChildRemoved because it would not otherwise be on our list. Change-Id: Ifc0a2979f1f6720f1963399276a28ac4a3224fff Reviewed-by: Marc Mutz Reviewed-by: Giuseppe D'Angelo --- src/widgets/widgets/qsplitter.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 4c077f5f9f..0c98c3875a 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -1298,18 +1298,19 @@ void QSplitter::childEvent(QChildEvent *c) qWarning("Adding a QLayout to a QSplitter is not supported."); return; } - QWidget *w = static_cast(c->child()); - if (w->isWindow()) - return; - if (c->added() && !d->blockChildAdd && !d->findWidget(w)) { - d->insertWidget_helper(d->list.count(), w, false); - } else if (c->polished() && !d->blockChildAdd) { - if (d->shouldShowWidget(w)) + if (c->added()) { + QWidget *w = static_cast(c->child()); + if (!d->blockChildAdd && !w->isWindow() && !d->findWidget(w)) + d->insertWidget_helper(d->list.count(), w, false); + } else if (c->polished()) { + QWidget *w = static_cast(c->child()); + if (!d->blockChildAdd && !w->isWindow() && d->shouldShowWidget(w)) w->show(); - } else if (c->type() == QEvent::ChildRemoved) { + } else if (c->removed()) { + QObject *child = c->child(); for (int i = 0; i < d->list.size(); ++i) { QSplitterLayoutStruct *s = d->list.at(i); - if (s->widget == w) { + if (s->widget == child) { d->list.removeAt(i); delete s; d->recalc(isVisible()); -- cgit v1.2.3 From 445191bba8216276e6200157906ca9d138d7be04 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 25 Apr 2017 16:54:29 -0700 Subject: QMenu: Display the menu title on the torn-off menu's title bar Change-Id: If16e262a6c8b39dff517cc105cf55686d4c22582 Task-number: QTBUG-11693 Reviewed-by: Shawn Rutledge --- src/widgets/widgets/qmenu.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 98dc6d0a11..d62c010c60 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -72,6 +72,7 @@ #include #include #include +#include QT_BEGIN_NAMESPACE @@ -127,7 +128,7 @@ public: setParent(parentWidget, Qt::Window | Qt::Tool); setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_X11NetWmWindowTypeMenu, true); - setWindowTitle(p->windowTitle()); + updateWindowTitle(); setEnabled(p->isEnabled()); #if QT_CONFIG(cssparser) setStyleSheet(p->styleSheet()); @@ -165,6 +166,15 @@ public: } } + void updateWindowTitle() + { + Q_D(QTornOffMenu); + if (!d->causedMenu) + return; + const QString &cleanTitle = QPlatformTheme::removeMnemonics(d->causedMenu->title()).trimmed(); + setWindowTitle(cleanTitle); + } + public slots: void onTrigger(QAction *action) { d_func()->activateAction(action, QAction::Trigger, false); } void onHovered(QAction *action) { d_func()->activateAction(action, QAction::Hover, false); } @@ -183,6 +193,10 @@ void QMenuPrivate::init() q->setAttribute(Qt::WA_X11NetWmWindowTypePopupMenu); defaultMenuAction = menuAction = new QAction(q); menuAction->d_func()->menu = q; + QObject::connect(menuAction, &QAction::changed, [=] { + if (!tornPopup.isNull()) + tornPopup->updateWindowTitle(); + }); q->setMouseTracking(q->style()->styleHint(QStyle::SH_Menu_MouseTracking, 0, q)); if (q->style()->styleHint(QStyle::SH_Menu_Scrollable, 0, q)) { scroll = new QMenuPrivate::QMenuScroller; -- cgit v1.2.3 From a9e0879ee16932d8155850b52162ee5429164982 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Tue, 25 Apr 2017 15:36:48 +0900 Subject: Fix build without features.shortcut Change-Id: I87a7ba1a77b0671559616a3ea4722bcc233af32d Reviewed-by: Oswald Buddenhagen Reviewed-by: Paul Olav Tvete --- src/widgets/widgets/qwidgetlinecontrol.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 363e7157ac..905bc0f586 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1704,7 +1704,9 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) } bool unknown = false; +#if QT_CONFIG(shortcut) bool visual = cursorMoveStyle() == Qt::VisualMoveStyle; +#endif if (false) { } -- cgit v1.2.3 From 9b8a7de7946c6fa32d72fef37aa18a59054208d7 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Wed, 26 Apr 2017 10:03:52 +0900 Subject: Fix build without features.style-stylesheet Change-Id: Ib7cf5db6c9a49e7f359410bc0ec3d1ceadcde5cf Reviewed-by: Stephan Binner Reviewed-by: Paul Olav Tvete --- src/widgets/widgets/qmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index d62c010c60..4a3291b2ca 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -130,7 +130,7 @@ public: setAttribute(Qt::WA_X11NetWmWindowTypeMenu, true); updateWindowTitle(); setEnabled(p->isEnabled()); -#if QT_CONFIG(cssparser) +#if QT_CONFIG(style_stylesheet) setStyleSheet(p->styleSheet()); #endif if (style() != p->style()) -- cgit v1.2.3 From 46543bb462c4709d622080a0c32901a95f8d8963 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 1 May 2017 12:54:48 +0700 Subject: QMenu: Refactor column layout logic Change-Id: I30f1c87092447abf1c94e69c0124eeeee43666e2 Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qmenu.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 4a3291b2ca..75704f73de 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -327,8 +327,8 @@ void QMenuPrivate::updateActionRects(const QRect &screen) const const int deskFw = style->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, &opt, q); const int tearoffHeight = tearoff ? style->pixelMetric(QStyle::PM_MenuTearoffHeight, &opt, q) : 0; const int base_y = vmargin + fw + topmargin + (scroll ? scroll->scrollOffset : 0) + tearoffHeight; + const int column_max_y = screen.height() - 2 * deskFw - (vmargin + bottommargin + fw); int max_column_width = 0; - int dh = screen.height(); int y = base_y; //for compatibility now - will have to refactor this away @@ -406,8 +406,7 @@ void QMenuPrivate::updateActionRects(const QRect &screen) const if (!sz.isEmpty()) { max_column_width = qMax(max_column_width, sz.width()); //wrapping - if (!scroll && - y + sz.height() + vmargin + bottommargin + fw > dh - (deskFw * 2)) { + if (!scroll && y + sz.height() > column_max_y) { ncols++; y = base_y; } else { @@ -433,8 +432,7 @@ void QMenuPrivate::updateActionRects(const QRect &screen) const QRect &rect = actionRects[i]; if (rect.isNull()) continue; - if (!scroll && - y + rect.height() + vmargin + bottommargin + fw > dh - deskFw * 2) { + if (!scroll && y + rect.height() > column_max_y) { x += max_column_width + hmargin; y = base_y; } -- cgit v1.2.3 From 35f927e719eb50b90dcfc76ca63c72a38ef821d7 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 1 May 2017 11:43:05 +0700 Subject: QMenu: Ensure popup() gets the right screen geometry Many QMenu related functions end up calling sizeHint() which does call updateActionRects(). Since we try not to update the action rects if no action has changed, we must be careful to call it the first time with the right screen geometry. Other- wise, multi-display setups may get the action rects based on the wrong display. In QMenu::popup(), this can be solved by using the position passed as argument. Incidentally, we were already computing the right display geometry in the same function, only a bit later. The updated position around an eventual push button menu should not change the screen onto which the menu popup will be displayed. Tested with the multiscreen-menus manual test. Change-Id: Id7fc24be6908b4a9d24b8b9c8b8006efe45d69be Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/widgets/qmenu.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 75704f73de..2cafe462b1 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -2323,16 +2323,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) ensurePolished(); // Get the right font emit aboutToShow(); const bool actionListChanged = d->itemsDirty; - d->updateActionRects(); - QPoint pos; - QPushButton *causedButton = qobject_cast(d->causedPopup.widget); - if (actionListChanged && causedButton) - pos = QPushButtonPrivate::get(causedButton)->adjustedMenuPosition(); - else - pos = p; - const QSize menuSizeHint(sizeHint()); - QSize size = menuSizeHint; QRect screen; #ifndef QT_NO_GRAPHICSVIEW bool isEmbedded = !bypassGraphicsProxyWidget(this) && d->nearestGraphicsProxyWidget(this); @@ -2341,6 +2332,17 @@ void QMenu::popup(const QPoint &p, QAction *atAction) else #endif screen = d->popupGeometry(QApplication::desktop()->screenNumber(p)); + d->updateActionRects(screen); + + QPoint pos; + QPushButton *causedButton = qobject_cast(d->causedPopup.widget); + if (actionListChanged && causedButton) + pos = QPushButtonPrivate::get(causedButton)->adjustedMenuPosition(); + else + pos = p; + + const QSize menuSizeHint(sizeHint()); + QSize size = menuSizeHint; const int desktopFrame = style()->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, 0, this); bool adjustToDesktop = !window()->testAttribute(Qt::WA_DontShowOnScreen); -- cgit v1.2.3