summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/widgets/qmenu.cpp')
-rw-r--r--src/widgets/widgets/qmenu.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index c5b912e35b..c4bb02fd5b 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -116,7 +116,7 @@ class QTornOffMenu : public QMenu
q->setFixedSize(size);
}
- QVector<QPointer<QWidget> > calcCausedStack() const Q_DECL_OVERRIDE { return causedStack; }
+ QVector<QPointer<QWidget> > calcCausedStack() const override { return causedStack; }
QPointer<QMenu> causedMenu;
QVector<QPointer<QWidget> > causedStack;
bool initialized;
@@ -162,7 +162,7 @@ public:
} else if (act->type() == QEvent::ActionRemoved)
removeAction(act->action());
}
- void actionEvent(QActionEvent *e) Q_DECL_OVERRIDE
+ void actionEvent(QActionEvent *e) override
{
Q_D(QTornOffMenu);
QMenu::actionEvent(e);
@@ -240,7 +240,7 @@ void QMenuPrivate::syncPlatformMenu()
if (platformMenu.isNull())
return;
- QPlatformMenuItem *beforeItem = Q_NULLPTR;
+ QPlatformMenuItem *beforeItem = nullptr;
const QList<QAction*> actions = q->actions();
for (QList<QAction*>::const_reverse_iterator it = actions.rbegin(), end = actions.rend(); it != end; ++it) {
QPlatformMenuItem *menuItem = insertActionInPlatformMenu(*it, beforeItem);
@@ -665,7 +665,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
if (action
&& (action->isSeparator()
|| (!action->isEnabled() && !q->style()->styleHint(QStyle::SH_Menu_AllowActiveAndDisabled, 0, q))))
- action = Q_NULLPTR;
+ action = nullptr;
// Reselect the currently active action in case mouse moved over other menu items when
// moving from sub menu action to sub menu (QTBUG-20094).
@@ -739,13 +739,13 @@ void QMenuSloppyState::reset()
m_use_reset_action = true;
m_uni_dir_discarded_count = 0;
m_time.stop();
- m_reset_action = Q_NULLPTR;
- m_origin_action = Q_NULLPTR;
+ m_reset_action = nullptr;
+ m_origin_action = nullptr;
m_action_rect = QRect();
m_previous_point = QPointF();
if (m_sub_menu) {
- QMenuPrivate::get(m_sub_menu)->sloppyState.m_parent = Q_NULLPTR;
- m_sub_menu = Q_NULLPTR;
+ QMenuPrivate::get(m_sub_menu)->sloppyState.m_parent = nullptr;
+ m_sub_menu = nullptr;
}
}
void QMenuSloppyState::enter()
@@ -854,7 +854,7 @@ void QMenuSloppyState::timeout()
if (m_use_reset_action)
menu_priv->setCurrentAction(m_reset_action, 0);
} else {
- menu_priv->setCurrentAction(Q_NULLPTR, 0);
+ menu_priv->setCurrentAction(nullptr, 0);
}
}
@@ -904,8 +904,7 @@ void QMenuPrivate::adjustMenuScreen(const QPoint &p)
// so a wrong screen would often cause wrong sizes (on high DPI)
const QScreen *primaryScreen = QApplication::primaryScreen();
const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : primaryScreen;
- const int screenNumberForPoint = QApplication::desktop()->screenNumber(p);
- QScreen *actualScreen = QGuiApplication::screens().at(screenNumberForPoint);
+ QScreen *actualScreen = QGuiApplication::screenAt(p);
if (actualScreen && currentScreen != actualScreen) {
if (!q->windowHandle()) // Try to create a window handle if not created.
createWinId();
@@ -2227,7 +2226,7 @@ void QMenu::hideTearOffMenu()
// should consider the torn-off menu deleted.
// This way showTearOffMenu() will not try to
// reuse the dying torn-off menu.
- d->tornPopup = Q_NULLPTR;
+ d->tornPopup = nullptr;
}
}