6#include <QtWidgets/private/qtwidgetsglobal_p.h>
7#include <QtWidgets/private/qwidgetwindow_p.h>
9#include "qactiongroup.h"
16#include <qpa/qplatformtheme.h>
18#if QT_CONFIG(accessibility)
22# include <private/qeffects_p.h>
24#if QT_CONFIG(whatsthis)
33#if QT_CONFIG(toolbutton)
41#include <private/qpushbutton_p.h>
42#include <private/qaction_p.h>
43#include <private/qguiapplication_p.h>
44#include <qpa/qplatformtheme.h>
45#include <private/qstyle_p.h>
60 QTornOffMenuPrivate(
QMenu *
p) : causedMenu(
p), initialized(
false) {
64 causedStack =
p->d_func()->calcCausedStack();
67 void setMenuSize(
const QSize &menuSize) {
70 const QPoint p = (!initialized) ? causedMenu->
pos() :
q->pos();
79 size.setHeight(
screen.height() - desktopFrame * 2 - titleBarHeight);
81 q->setFixedSize(
size);
84 QList<QPointer<QWidget>> calcCausedStack()
const override {
return causedStack; }
85 QPointer<QMenu> causedMenu;
86 QList<QPointer<QWidget>> causedStack;
105#if QT_CONFIG(style_stylesheet)
108 if (
style() !=
p->style())
114 QList<QAction*>
items =
p->actions();
118 d->initialized =
true;
123 if (
menu !=
d->causedMenu)
125 auto action =
static_cast<QAction *
>(act->action());
135 if (
d->initialized) {
161#if QT_CONFIG(whatsthis)
167 setOverrideMenuAction(
nullptr);
169 if (!tornPopup.isNull())
170 tornPopup->updateWindowTitle();
178 sloppyState.initialize(
q);
179 delayState.initialize(
q);
211 const QList<QAction*>
actions =
q->actions();
214 beforeItem = menuItem;
246#if QT_CONFIG(shortcut)
247 item->setShortcut(action->shortcut());
256 if (action->
menu()) {
257 if (!action->
menu()->platformMenu())
259 item->setMenu(action->
menu()->platformMenu());
261 item->setMenu(
nullptr);
273 copyActionToPlatformItem(action, menuItem);
297 &&
q->graphicsProxyWidget() ==
nullptr
300 screen =
q->isVisible() ?
q->screen() : popupScreen.data();
302 if (useFullScreenForPopup())
311 QList<QPointer<QWidget>>
ret;
315 ret += qtmenu->d_func()->causedStack;
317 widget = qmenu->d_func()->causedPopup.widget;
326#if QT_CONFIG(menubar)
327 return qobject_cast<const QMenuBar *>(topCausedWidget()) ==
nullptr;
335 updateActionRects(popupGeometry());
348 actionRects.fill(
QRect());
350 int lastVisibleAction = getLastVisibleAction();
361 const int base_y = vmargin + fw + topmargin + (
scroll ?
scroll->scrollOffset : 0) + tearoffHeight;
362 const int column_max_y =
screen.height() - 2 * deskFw - (vmargin + bottommargin + fw);
363 int max_column_width = 0;
369 hasCheckableItems =
false;
380 maxIconWidth = qMax<uint>(maxIconWidth, icone + 4);
386 bool previousWasSeparator =
true;
387#if QT_CONFIG(shortcut)
388 const bool contextMenu = isContextMenu();
390 for(
int i = 0;
i <= lastVisibleAction;
i++) {
397 (collapsibleSeparators && previousWasSeparator && isPlainSeparator))
400 previousWasSeparator = isPlainSeparator;
404 q->initStyleOption(&
opt, action);
408 if (
QWidget *
w = widgetItems.value(action)) {
409 sz =
w->sizeHint().
expandedTo(
w->minimumSize()).expandedTo(
w->minimumSizeHint()).boundedTo(
w->maximumSize());
418 tabWidth =
qMax(
int(tabWidth), qfm.horizontalAdvance(
s.mid(
t+1)));
420#if QT_CONFIG(shortcut)
433 if (is_sz.height() > sz.
height())
442 max_column_width =
qMax(max_column_width, sz.
width());
455 max_column_width += tabWidth;
458 const int min_column_width =
q->minimumWidth() - (sfcMargin + leftmargin + rightmargin + 2 * (fw + hmargin));
459 max_column_width =
qMax(min_column_width, max_column_width);
463 int x = hmargin + fw + leftmargin;
471 x += max_column_width + hmargin;
492 for (;lastVisibleAction >= 0; --lastVisibleAction) {
496 if (action->
isSeparator() && collapsibleSeparators)
501 return lastVisibleAction;
514 return actionRects.at(
index);
522 QWidget *caused = causedPopup.widget;
525#if QT_CONFIG(menubar)
526 if (
QMenuBar *mb = qobject_cast<QMenuBar*>(caused)) {
527 mb->d_func()->setCurrentAction(
nullptr);
528 mb->d_func()->setKeyboardMode(
false);
532 if (
QMenu *
m = qobject_cast<QMenu*>(caused)) {
533 caused =
m->d_func()->causedPopup.widget;
534 if (!
m->d_func()->tornoff)
537 m->d_func()->setCurrentAction(
nullptr);
538 }
else { caused =
nullptr;
542 setCurrentAction(
nullptr);
560 q->installEventFilter(
this);
570 return deleteLater =
true;
575 bool deleteLater =
false;
578#if QT_CONFIG(effects)
582 QPointer<QMenu> stillAlive(
menu);
589 && currentAction && currentAction == actionAboutToTrigger
595 const Reposter deleteDeleteLate(
menu);
616 if (activeMenu ==
menu)
617 activeMenu =
nullptr;
619 menu->d_func()->causedPopup.action =
nullptr;
621 menu->d_func()->causedPopup.widget =
nullptr;
628 if (
parent->windowHandle())
629 return parent->windowHandle();
632 if (
const QWindow *
w =
q->windowHandle()) {
633 if (
w->transientParent())
634 return w->transientParent();
637 if (causedPopup.widget) {
638 if (
const QWidget *
w = causedPopup.widget.data()) {
640 return ww->windowHandle();
653 q->internalDelayedPopup();
654 else if (action->
menu() && !action->
menu()->isVisible())
655 delayState.start(delay, action);
656 else if (!action->
menu())
658 if (activateFirst && action->
menu())
659 action->
menu()->d_func()->setFirstActionActive();
669 QAction *current = currentAction;
673 if (
QMenu *
m = qobject_cast<QMenu*>(caused)) {
674 caused =
m->d_func()->causedPopup.widget;
675 if (
m->d_func()->eventLoop)
676 m->d_func()->syncAction = current;
692 if (
scroll &&
scroll->scrollFlags & QMenuScroller::ScrollUp) {
694 if (saccum >
scroll->scrollOffset - scrollerHeight())
701 setCurrentAction(act);
711 tearoffHighlighted = 0;
720 if (reason != SelectedFromKeyboard) {
721 if (
QMenu *
menu = qobject_cast<QMenu*>(causedPopup.widget)) {
722 if (causedPopup.action &&
menu->d_func()->activeMenu ==
q)
724 if (hasReceievedEnter &&
menu->d_func()->currentAction != causedPopup.action)
725 menu->d_func()->setCurrentAction(causedPopup.action, 0, reason,
false);
730 q->
update(actionRect(currentAction));
732 QMenu *hideActiveMenu = activeMenu;
733 QAction *previousAction = currentAction;
735 currentAction = action;
744 popupAction(currentAction,
popup, activateFirst);
746 q->update(actionRect(action));
748 if (reason == SelectedFromKeyboard) {
757 if (!
q->hasFocus()) {
763#if QT_CONFIG(statustip)
764 }
else if (previousAction) {
765 previousAction->d_func()->showStatusText(topCausedWidget(),
QString());
768 if (hideActiveMenu && previousAction != currentAction) {
770#if QT_CONFIG(effects)
775 hideMenu(hideActiveMenu);
776 }
else if (!currentAction || !currentAction->menu()) {
777 sloppyState.startTimerIfNotRunning();
785 m_first_mouse =
true;
786 m_init_guard =
false;
787 m_use_reset_action =
true;
788 m_uni_dir_discarded_count = 0;
790 m_reset_action =
nullptr;
791 m_origin_action =
nullptr;
792 m_action_rect =
QRect();
796 m_sub_menu =
nullptr;
803 if (m_discard_state_when_entering_parent && m_sub_menu == menuPriv->activeMenu) {
804 menuPriv->hideMenu(m_sub_menu);
808 m_parent->childEnter();
815 m_parent->childEnter();
820 if (!m_dont_start_time_on_leave) {
822 m_parent->childLeave();
823 startTimerIfNotRunning();
830 startTimerIfNotRunning();
832 m_parent->childLeave();
840 m_use_reset_action =
true;
842 m_action_rect = actionRect;
845 m_sub_menu = subMenu;
847 m_reset_action = resetAction;
848 m_origin_action = resetAction;
853 return m_parent && m_parent->m_menu &&
QMenuPrivate::get(m_parent->m_menu)->delayState.timer.isActive();
860 : toReset(sloppyState)
880 bool reallyHasMouse = menu_priv->hasReceievedEnter;
881 if (!reallyHasMouse) {
885 reallyHasMouse = m_menu->frameGeometry().contains(lastCursorPos);
888 if (menu_priv->currentAction == m_reset_action
890 && (menu_priv->currentAction
891 && menu_priv->currentAction->menu() == menu_priv->activeMenu)) {
897 if (hasParentActiveDelayTimer() || !m_menu->isVisible())
901 menu_priv->hideMenu(m_sub_menu);
903 if (reallyHasMouse) {
904 if (m_use_reset_action)
905 menu_priv->setCurrentAction(m_reset_action, 0);
907 menu_priv->setCurrentAction(
nullptr, 0);
915 while (
QMenu*
m = qobject_cast<QMenu *>(
top))
916 top =
m->d_func()->causedPopup.widget;
925 for(
int i = 0;
i < actionRects.size();
i++) {
926 if (actionRects.at(
i).contains(
p))
956 if (
QWidget *
w = causedPopup.widget)
957 setLayoutDirection_helper(
w->layoutDirection());
959 setLayoutDirection_helper(
w->layoutDirection());
979 menuOpt.maxIconWidth = 0;
980 menuOpt.reservedShortcutWidth = 0;
1004 menuOpt.maxIconWidth = 0;
1005 menuOpt.reservedShortcutWidth = 0;
1006 menuOpt.rect =
rect;
1008 if (tearoffHighlighted)
1024 return (
q->rect().adjusted(hmargin + fw + leftmargin, vmargin + fw + topmargin,
1025 -(hmargin + fw + rightmargin), -(vmargin + fw + bottommargin)));
1044 menuPrivate->drawScroller(&
p, scrollType,
QRect(0, 0,
width(), menuPrivate->scrollerHeight()));
1050 menuPrivate->drawTearOff(&
p,
rect);
1071 return d_func()->menuAction;
1094 return d_func()->menuAction->text();
1099 d_func()->menuAction->setText(
text);
1113 return d_func()->menuAction->icon();
1118 d_func()->menuAction->setIcon(
icon);
1138 newOffset = topScroll - saccum;
1148 newOffset = ((
q->height() / 2) - botScroll) - (saccum - topScroll);
1150 newOffset = (
q->height() - botScroll) - saccum;
1155 newOffset -= fw * 2;
1162 int saccum = newOffset;
1165 if (saccum >
q->height()) {
1182 newOffset -= vmargin;
1186 if (
q->height() <
screen.height()-(desktopFrame*2)-1) {
1187 QRect geom =
q->geometry();
1189 const int newHeight = geom.
height()-(newOffset-
scroll->scrollOffset);
1190 if (newHeight > geom.
height())
1193 int newTop = geom.
top() + (newOffset-
scroll->scrollOffset);
1194 if (newTop < desktopFrame+
screen.top())
1195 newTop = desktopFrame+
screen.top();
1196 if (newTop < geom.
top()) {
1204 if (geom.
top() < desktopFrame+
screen.top())
1206 if (geom !=
q->geometry()) {
1209 q->geometry().top() - geom.
top() >= -newOffset)
1212 q->setGeometry(geom);
1217 const int delta =
qMin(0, newOffset) -
scroll->scrollOffset;
1226 w->setGeometry(current);
1229 scroll->scrollOffset += delta;
1230 scroll->scrollFlags = newScrollFlags;
1285 const int offset = topScroll ? topScroll-vmargin : 0;
1289 if (saccum <= scroll->scrollOffset-
offset) {
1295 bool scrolled =
false;
1299 if (saccum <= scroll->scrollOffset-
offset) {
1300 const int scrollerArea =
q->height() - botScroll - fw*2;
1304 if (visible > scrollerArea - topScroll) {
1335 bool isScroll =
false;
1336 if (
pos.x() >= 0 &&
pos.x() <
q->width()) {
1351 scroll->scrollTimer.start(50,
q);
1354 scroll->scrollTimer.stop();
1363 q->update(tearRect);
1383 bool passOnEvent =
false;
1384 QWidget *next_widget =
nullptr;
1386#if QT_CONFIG(menubar)
1387 if (
QMenuBar *mb = qobject_cast<QMenuBar*>(caused)) {
1388 passOnEvent = mb->rect().contains(cpos.toPoint());
1391 if (
QMenu *
m = qobject_cast<QMenu*>(caused)) {
1392 passOnEvent =
m->rect().contains(cpos.toPoint());
1393 next_widget =
m->d_func()->causedPopup.widget;
1404 caused = next_widget;
1418 QPointer<QMenu> guard(
q);
1423 auto boolBlocker =
qScopeGuard([
this, activationRecursionGuardReset]{
1427 for(
int i = 0;
i < causedStack.size(); ++
i) {
1428 QPointer<QWidget>
widget = causedStack.at(
i);
1432 if (
QMenu *qmenu = qobject_cast<QMenu*>(
widget)) {
1433 widget = qmenu->d_func()->causedPopup.widget;
1435 emit qmenu->triggered(action);
1437 emit qmenu->hovered(action);
1439#if QT_CONFIG(menubar)
1440 }
else if (
QMenuBar *qmenubar = qobject_cast<QMenuBar*>(
widget)) {
1442 emit qmenubar->triggered(action);
1444 emit qmenubar->hovered(action);
1455#if QT_CONFIG(whatsthis)
1471#if QT_CONFIG(whatsthis)
1472 if (!inWhatsThisMode)
1480 if (
QMenu *qmenu = qobject_cast<QMenu*>(
widget)) {
1483 widget = qmenu->d_func()->causedPopup.widget;
1490#if QT_CONFIG(whatsthis)
1491 if (inWhatsThisMode) {
1501 QPointer<QMenu> thisGuard(
q);
1507#if QT_CONFIG(accessibility)
1508 if (QAccessible::isActive()) {
1509 int actionIndex =
indexOf(action);
1510 QAccessibleEvent focusEvent(
q, QAccessible::Focus);
1511 focusEvent.setChild(actionIndex);
1512 QAccessible::updateAccessibility(&focusEvent);
1524 if (
QAction *action = qobject_cast<QAction *>(
q->sender())) {
1525 QPointer<QAction> actionGuard = action;
1528 emit q->triggered(action);
1532 QList<QPointer<QWidget>>
list;
1534 if (qobject_cast<QMenu*>(
widget)
1535#if QT_CONFIG(menubar)
1536 || qobject_cast<QMenuBar*>(
widget)
1547 if (qobject_cast<QWidgetAction*>(action))
1556 if (
QAction * action = qobject_cast<QAction *>(
q->sender())) {
1557 emit q->hovered(action);
1565 emit q->aboutToShow();
1574 moveWidgetToPlatformItem(
widget, menuItem);
1609 if (
window()->isActiveWindow())
1612 && (!action->
menu() || action->
menu()->isEnabled()))
1620 if (
d->currentAction &&
d->currentAction == action && !
d->currentAction->
isSeparator()) {
1625 option->menuHasCheckableItems =
d->hasCheckableItems;
1637 else if (
d->defaultAction == action)
1644#ifndef QT_NO_SHORTCUT
1646 && textAndAccel.indexOf(u
'\t') == -1) {
1652 option->text = textAndAccel;
1653 option->reservedShortcutWidth =
d->tabWidth;
1654 option->maxIconWidth =
d->maxIconWidth;
1766 d->menuAction->setText(
title);
1784 if (!
d->widgetItems.isEmpty()) {
1786 for (;
it !=
d->widgetItems.
end(); ++
it) {
1796 d->eventLoop->exit();
1800#if QT_DEPRECATED_SINCE(6, 4)
1807#if QT_CONFIG(shortcut)
1857#if QT_CONFIG(shortcut)
2066 d_func()->defaultAction = act;
2076 return d_func()->defaultAction;
2095 if (
d->tearoff ==
b)
2101 d->itemsDirty =
true;
2108 return d_func()->tearoff;
2120 if (d_func()->tornPopup)
2121 return d_func()->tornPopup->isVisible();
2139 d->tornPopup->setGeometry(
pos.
x(),
pos.
y(),
s.width(),
s.height());
2140 d->tornPopup->show();
2167 d->tornPopup->close();
2172 d->tornPopup =
nullptr;
2183 d->setCurrentAction(act, 0);
2184 if (
d->scroll && act)
2195 return d_func()->currentAction;
2227 QList<QAction*> acts =
actions();
2229 for(
int i = 0;
i < acts.size();
i++) {
2231 if (acts[
i]->
parent() ==
this && acts[
i]->d_func()->associatedObjects.isEmpty())
2245 return d_func()->ncols;
2263 return d_func()->actionRect(act);
2272 d->updateActionRects();
2275 for (
int i = 0;
i <
d->actionRects.size(); ++
i) {
2313 d->popup(
p, atAction);
2323 if (
scroll->scrollOffset)
2325 scroll->scrollOffset = 0;
2333 q->ensurePolished();
2340 bool screenSet =
false;
2346 }
else if (
QMenu *parentMenu = qobject_cast<QMenu *>(
parent)) {
2372#if QT_CONFIG(menubar)
2378 emit q->aboutToShow();
2382#if QT_CONFIG(graphicsview)
2393 if (actionListChanged && causedButton)
2399 const QSize menuSizeHint(
q->sizeHint());
2402 if (positionFunction)
2403 pos = positionFunction(menuSizeHint);
2412 size.setWidth(
qMin(menuSizeHint.width(),
screen.width() - desktopFrame * 2));
2413 size.setHeight(
qMin(menuSizeHint.height(),
screen.height() - desktopFrame * 2));
2414 adjustToDesktop =
true;
2417#ifdef QT_KEYPAD_NAVIGATION
2418 if (!atAction && QApplicationPrivate::keypadNavigationEnabled()) {
2435 }
else if (atAction) {
2438 if (action == atAction) {
2439 int newY =
pos.y() - above_height;
2440 if (
scroll && newY < desktopFrame) {
2443 scroll->scrollOffset = newY;
2444 newY = desktopFrame;
2450 int below_height = above_height +
scroll->scrollOffset;
2453 size.setHeight(below_height);
2466 if (adjustToDesktop) {
2468 if (
q->isRightToLeft()) {
2470 pos.setX(mouse.x() -
size.width());
2472#if QT_CONFIG(menubar)
2478 if (
pos.x() <
screen.left() + desktopFrame)
2480 if (
pos.x() +
size.width() - 1 >
screen.right() - desktopFrame)
2483 if (
pos.x() +
size.width() - 1 >
screen.right() - desktopFrame)
2485 if (
pos.x() <
screen.left() + desktopFrame)
2488 if (
pos.y() +
size.height() - 1 >
screen.bottom() - desktopFrame) {
2490 pos.setY(
qMin(mouse.y() - (
size.height() + desktopFrame),
screen.bottom()-desktopFrame-
size.height()+1));
2495 if (
pos.y() <
screen.top() + desktopFrame)
2497 if (
pos.y() + menuSizeHint.height() - 1 >
screen.bottom() - desktopFrame) {
2501 size.setHeight(
screen.bottom() - (desktopFrame * 2) -
y);
2510 if (caused && caused->geometry().width() + menuSizeHint.width() + subMenuOffset <
screen.width()) {
2511 QRect parentActionRect(caused->d_func()->actionRect(caused->d_func()->currentAction));
2512 const QPoint actionTopLeft = caused->mapToGlobal(parentActionRect.topLeft());
2513 parentActionRect.moveTopLeft(actionTopLeft);
2514 if (
q->isRightToLeft()) {
2515 if ((
pos.x() + menuSizeHint.width() > parentActionRect.left() - subMenuOffset)
2516 && (
pos.x() < parentActionRect.right()))
2518 pos.
rx() = parentActionRect.left() - menuSizeHint.width();
2520 pos.rx() = parentActionRect.right();
2525 if ((
pos.x() < parentActionRect.right() + subMenuOffset)
2526 && (
pos.x() + menuSizeHint.width() > parentActionRect.left()))
2528 pos.rx() = parentActionRect.right();
2530 pos.rx() = parentActionRect.left() - menuSizeHint.width();
2538#if QT_CONFIG(effects)
2541 if (
q->isRightToLeft()) {
2542 if ((snapToMouse && (
pos.x() +
size.width() / 2 > mouse.x())) ||
2546 if ((snapToMouse && (
pos.x() +
size.width() / 2 < mouse.x())) ||
2551#if QT_CONFIG(menubar)
2552 if ((snapToMouse && (
pos.y() +
size.height() / 2 < mouse.y())) ||
2559#if QT_CONFIG(menubar)
2562 mb->d_func()->doChildEffects =
false;
2567 m->d_func()->doChildEffects =
false;
2590#if QT_CONFIG(accessibility)
2591 QAccessibleEvent
event(
q, QAccessible::PopupMenuStart);
2592 QAccessible::updateAccessibility(&
event);
2657 return d->exec(
p, action);
2663 q->ensurePolished();
2667 popup(
p, action, positionFunction);
2669 QPointer<QObject> guard =
q;
2670 (
void) evtLoop.exec();
2718 d->eventLoop->exit();
2719 d->setCurrentAction(
nullptr);
2720#if QT_CONFIG(accessibility)
2721 QAccessibleEvent
event(
this, QAccessible::PopupMenuEnd);
2722 QAccessible::updateAccessibility(&
event);
2724#if QT_CONFIG(menubar)
2725 if (
QMenuBar *mb = qobject_cast<QMenuBar*>(
d->causedPopup.widget))
2726 mb->d_func()->setCurrentAction(
nullptr);
2730 d->hasHadMouse =
false;
2732 d->hideMenu(
d->activeMenu);
2733 d->causedPopup.widget =
nullptr;
2734 d->causedPopup.action =
nullptr;
2736 d->scroll->scrollTimer.stop();
2745 d->updateActionRects();
2753 menuOpt.maxIconWidth = 0;
2754 menuOpt.reservedShortcutWidth = 0;
2762 QRect scrollUpRect, scrollDownRect;
2763 const int leftmargin = fw + hmargin +
d->leftmargin;
2764 const int topmargin = fw + vmargin +
d->topmargin;
2765 const int bottommargin = fw + vmargin +
d->bottommargin;
2766 const int contentWidth =
width() - (fw + hmargin) * 2 -
d->leftmargin -
d->rightmargin;
2769 scrollUpRect.setRect(leftmargin, topmargin, contentWidth,
d->scrollerHeight());
2772 scrollDownRect.setRect(leftmargin,
height() -
d->scrollerHeight() - bottommargin,
2773 contentWidth,
d->scrollerHeight());
2779 tearOffRect.
setRect(leftmargin, topmargin, contentWidth,
2782 tearOffRect.translate(0,
d->scrollerHeight());
2786 QRect scrollUpTearOffRect = scrollUpRect.
united(tearOffRect);
2787 for (
int i = 0;
i <
d->actions.size(); ++
i) {
2789 QRect actionRect =
d->actionRects.at(
i);
2791 ||
d->widgetItems.value(action))
2794 emptyArea -=
QRegion(actionRect);
2796 QRect adjustedActionRect = actionRect;
2797 if (!scrollUpTearOffRect.isEmpty() && adjustedActionRect.bottom() <= scrollUpTearOffRect.top())
2800 if (!scrollDownRect.isEmpty() && adjustedActionRect.top() >= scrollDownRect.bottom())
2803 if (adjustedActionRect.intersects(scrollUpTearOffRect)) {
2804 if (adjustedActionRect.bottom() <= scrollUpTearOffRect.bottom())
2807 adjustedActionRect.
setTop(scrollUpTearOffRect.bottom()+1);
2810 if (adjustedActionRect.intersects(scrollDownRect)) {
2811 if (adjustedActionRect.top() >= scrollDownRect.top())
2814 adjustedActionRect.setBottom(scrollDownRect.top()-1);
2817 QRegion adjustedActionReg(adjustedActionRect);
2818 p.setClipRegion(adjustedActionReg);
2826 emptyArea -=
QRegion(scrollUpTearOffRect);
2827 emptyArea -=
QRegion(scrollDownRect);
2829 if (
d->scrollUpTearOffItem ||
d->scrollDownItem) {
2830 if (
d->scrollUpTearOffItem)
2831 d->scrollUpTearOffItem->updateScrollerRects(scrollUpTearOffRect);
2832 if (
d->scrollDownItem)
2833 d->scrollDownItem->updateScrollerRects(scrollDownRect);
2839 d->drawTearOff(&
p, tearOffRect);
2849 p.setClipRegion(borderReg);
2850 emptyArea -= borderReg;
2861 p.setClipRegion(emptyArea);
2865 menuOpt.rect =
rect();
2866 menuOpt.menuRect =
rect();
2870#if QT_CONFIG(wheelevent)
2874void QMenu::wheelEvent(QWheelEvent *e)
2878 d->scrollMenu(e->angleDelta().y() > 0 ?
2889 if (
d->aboutToHide ||
d->mouseEventTaken(e))
2900 d->syncAction =
nullptr;
2901 d->hideUpToMenuBar();
2907 d->setCurrentAction(action, 20);
2917 if (
d->aboutToHide ||
d->mouseEventTaken(e))
2928 if (action && action ==
d->currentAction) {
2929 if (!action->
menu()) {
2930#if defined(Q_OS_WIN)
2937 d->hideUpToMenuBar();
2955 d->scroll =
nullptr;
2956 }
else if (!
d->scroll) {
2964 if (!
d->platformMenu.isNull())
2977 switch (e->
type()) {
2979 d->updateLayoutDirection();
2986#ifndef QT_NO_SHORTCUT
3004 bool canPopup =
true;
3007 if (canPopup &&
d->delayState.timer.isActive()) {
3008 d->delayState.stop();
3009 internalDelayedPopup();
3021 d->updateActionRects();
3025 d->updateActionRects();
3026 d->sloppyState.reset();
3027 if (
d->currentAction)
3028 d->popupAction(
d->currentAction, 0,
false);
3032#if QT_CONFIG(tooltip)
3034 if (
d->toolTipsVisible) {
3037 const QString toolTip = action->d_func()->tooltip;
3047#if QT_CONFIG(whatsthis)
3079 d->updateActionRects();
3094 bool key_consumed =
false;
3097 key_consumed =
true;
3102 key_consumed =
true;
3107 key_consumed =
true;
3108 if (
d->currentAction &&
d->scroll) {
3116 key_consumed =
true;
3117 if (
d->currentAction &&
d->scroll) {
3126 key_consumed =
true;
3127 QAction *nextAction =
nullptr;
3129 if (!
d->currentAction) {
3131 for(
int i = 0;
i <
d->actions.size(); ++
i) {
3133 if (
d->actionRects.at(
i).isNull())
3143 for(
int i =
d->actions.size()-1;
i >= 0; --
i) {
3145 if (
d->actionRects.at(
i).isNull())
3156 for(
int i = 0,
y = 0; !nextAction &&
i <
d->actions.size();
i++) {
3158 if (act ==
d->currentAction) {
3160 for(
int next_i =
i-1;
true; next_i--) {
3166 next_i =
d->actionRects.size()-1;
3169 if (
next ==
d->currentAction)
3171 if (
d->actionRects.at(next_i).isNull())
3173 if (
next->isSeparator() ||
3174 (!
next->isEnabled() &&
3179 int topVisible =
d->scrollerHeight();
3182 if (((
y +
d->scroll->scrollOffset) - topVisible) <=
d->actionRects.at(next_i).height())
3187 if (!nextAction &&
d->tearoff)
3188 d->tearoffHighlighted = 1;
3190 y +=
d->actionRects.at(
i).height();
3191 for(
int next_i =
i+1;
true; next_i++) {
3192 if (next_i ==
d->actionRects.size()) {
3200 if (
next ==
d->currentAction)
3202 if (
d->actionRects.at(next_i).isNull())
3204 if (
next->isSeparator() ||
3205 (!
next->isEnabled() &&
3210 int bottomVisible =
height() -
d->scrollerHeight();
3212 bottomVisible -=
d->scrollerHeight();
3215 if ((
y +
d->scroll->scrollOffset +
d->actionRects.at(next_i).height()) > bottomVisible)
3223 y +=
d->actionRects.at(
i).height();
3228 d->scroll->scrollTimer.stop();
3229 d->scrollMenu(nextAction, scroll_loc);
3236 if (
d->currentAction &&
d->currentAction->isEnabled() &&
d->currentAction->menu()) {
3237 d->popupAction(
d->currentAction, 0,
true);
3238 key_consumed =
true;
3243 if (
d->currentAction && !
d->scroll) {
3244 QAction *nextAction =
nullptr;
3246 QRect actionR =
d->actionRect(
d->currentAction);
3247 for(
int x = actionR.left()-1; !nextAction &&
x >= 0;
x--)
3248 nextAction =
d->actionAt(
QPoint(
x, actionR.center().y()));
3250 QRect actionR =
d->actionRect(
d->currentAction);
3251 for(
int x = actionR.right()+1; !nextAction &&
x <
width();
x++)
3252 nextAction =
d->actionAt(
QPoint(
x, actionR.center().y()));
3256 key_consumed =
true;
3259 if (!key_consumed &&
key ==
Qt::Key_Left && qobject_cast<QMenu*>(
d->causedPopup.widget)) {
3260 QPointer<QWidget> caused =
d->causedPopup.widget;
3264 key_consumed =
true;
3272 key_consumed =
true;
3276#if QT_CONFIG(menubar)
3278 mb->d_func()->setKeyboardMode(
false);
3289#ifdef QT_KEYPAD_NAVIGATION
3294 if (!
d->currentAction) {
3295 d->setFirstActionActive();
3296 key_consumed =
true;
3302 if (
d->currentAction->menu())
3303 d->popupAction(
d->currentAction, 0,
true);
3306 key_consumed =
true;
3309#if QT_CONFIG(whatsthis)
3311 if (!
d->currentAction ||
d->currentAction->whatsThis().isNull())
3318 key_consumed =
false;
3321 if (!key_consumed && (
3323#ifndef QT_NO_SHORTCUT
3326#ifdef QT_KEYPAD_NAVIGATION
3330 key_consumed =
true;
3336 QPointer<QWidget> caused =
d->causedPopup.widget;
3338#if QT_CONFIG(menubar)
3339 if (
QMenuBar *mb = qobject_cast<QMenuBar*>(caused)) {
3340 mb->d_func()->setCurrentAction(
d->menuAction);
3341 mb->d_func()->setKeyboardMode(
true);
3347 if (!key_consumed) {
3350 bool activateAction =
false;
3351 QAction *nextAction =
nullptr;
3353 int best_match_count = 0;
3354 d->searchBufferTimer.start(2000,
this);
3355 d->searchBuffer += e->
text();
3356 for(
int i = 0;
i <
d->actions.size(); ++
i) {
3357 int match_count = 0;
3358 if (
d->actionRects.at(
i).isNull())
3362 for(
int c = 0;
c <
d->searchBuffer.size(); ++
c) {
3366 if (match_count > best_match_count) {
3367 best_match_count = match_count;
3372#ifndef QT_NO_SHORTCUT
3375 QAction *
first =
nullptr, *currentSelected =
nullptr, *firstAfterCurrent =
nullptr;
3377 for(
int i = 0;
i <
d->actions.size(); ++
i) {
3378 if (
d->actionRects.at(
i).isNull())
3382 int key = sequence[0].toCombined() & 0xffff;
3383 if (
key ==
c.unicode()) {
3387 if (act ==
d->currentAction)
3388 currentSelected = act;
3389 else if (!firstAfterCurrent && currentSelected)
3390 firstAfterCurrent = act;
3393 if (clashCount == 1)
3394 activateAction =
true;
3395 if (clashCount >= 1) {
3396 if (clashCount == 1 || !currentSelected || !firstAfterCurrent)
3399 nextAction = firstAfterCurrent;
3404 key_consumed =
true;
3408 if (!nextAction->menu() && activateAction) {
3414 if (!key_consumed) {
3415#if QT_CONFIG(menubar)
3416 if (
QMenuBar *mb = qobject_cast<QMenuBar*>(
d->topCausedWidget())) {
3417 QAction *oldAct = mb->d_func()->currentAction;
3419 if (mb->d_func()->currentAction != oldAct)
3420 key_consumed =
true;
3442 if (!
isVisible() ||
d->aboutToHide ||
d->mouseEventTaken(e))
3452 if ((!action || action->
isSeparator()) && !
d->sloppyState.enabled()) {
3454 || (!
d->currentAction || !
d->currentAction->menu() || !
d->currentAction->menu()->isVisible())) {
3455 d->setCurrentAction(action);
3464 d->activeMenu->d_func()->setCurrentAction(
nullptr);
3468 d->setCurrentAction(action,
d->mousePopupDelay);
3470 d->sloppyState.reset();
3471 d->hideMenu(
d->activeMenu);
3481 d->hasReceievedEnter =
true;
3482 d->sloppyState.enter();
3492 d->hasReceievedEnter =
false;
3493 if (!
d->activeMenu &&
d->currentAction)
3504 if (
d->scroll &&
d->scroll->scrollTimer.timerId() == e->
timerId()) {
3507 d->scroll->scrollTimer.stop();
3508 }
else if (
d->delayState.timer.timerId() == e->
timerId()) {
3509 if (
d->currentAction && !
d->currentAction->menu())
3511 d->delayState.stop();
3512 d->sloppyState.stopTimer();
3513 internalDelayedPopup();
3514 }
else if (
d->sloppyState.isTimerId(e->
timerId())) {
3515 d->sloppyState.timeout();
3516 }
else if (
d->searchBufferTimer.timerId() == e->
timerId()) {
3517 d->searchBuffer.clear();
3530 d->tornPopup->syncWithMenu(
this, e);
3535 && !qobject_cast<QMenuBar*>(e->action()->parent())
3543 if (
QWidgetAction *wa = qobject_cast<QWidgetAction *>(e->action())) {
3546 d->widgetItems.insert(wa,
widget);
3548 if (!
d->scrollUpTearOffItem)
3549 d->scrollUpTearOffItem =
3551 if (!
d->scrollDownItem)
3558 e->action()->disconnect(
this);
3559 if (e->action() ==
d->currentAction)
3560 d->currentAction =
nullptr;
3561 if (
QWidgetAction *wa = qobject_cast<QWidgetAction *>(e->action())) {
3563 wa->releaseWidget(
widget);
3565 d->widgetItems.remove(
static_cast<QAction *
>(e->action()));
3568 if (!
d->platformMenu.isNull()) {
3569 auto action =
static_cast<QAction *
>(e->action());
3572 ?
d->platformMenu->menuItemForTag(
reinterpret_cast<quintptr>(e->before()))
3574 d->insertActionInPlatformMenu(action, beforeItem);
3577 d->platformMenu->removeMenuItem(menuItem);
3582 d->copyActionToPlatformItem(action, menuItem);
3583 d->platformMenu->syncMenuItem(menuItem);
3587 d->platformMenu->syncSeparatorsCollapsible(
d->collapsibleSeparators);
3599void QMenu::internalDelayedPopup()
3604 if (
d->activeMenu->menuAction() !=
d->currentAction)
3608 if (!
d->currentAction || !
d->currentAction->isEnabled() || !
d->currentAction->menu() ||
3609 !
d->currentAction->menu()->isEnabled() ||
d->currentAction->menu()->isVisible())
3613 d->activeMenu =
d->currentAction->menu();
3614 d->activeMenu->d_func()->causedPopup.widget =
this;
3615 d->activeMenu->d_func()->causedPopup.action =
d->currentAction;
3618#if QT_CONFIG(graphicsview)
3627 const QRect actionRect(
d->actionRect(
d->currentAction));
3629 if (subMenuPos.x() >
screen.right())
3632 const auto &subMenuActions =
d->activeMenu->actions();
3633 if (!subMenuActions.isEmpty()) {
3635 const auto subMenuActionRect =
d->activeMenu->actionGeometry(subMenuActions.first());
3636 subMenuPos.ry() -= subMenuActionRect.top();
3639 d->activeMenu->popup(subMenuPos);
3640 d->sloppyState.setSubMenuPopup(actionRect,
d->currentAction,
d->activeMenu);
3642#if !defined(Q_OS_DARWIN)
3705 d_func()->noReplayFor = noReplayFor;
3713 return d_func()->platformMenu;
3721 d_func()->syncPlatformMenu();
3739 return d->collapsibleSeparators;
3745 if (
d->collapsibleSeparators == collapse)
3748 d->collapsibleSeparators = collapse;
3751 d->updateActionRects();
3754 if (!
d->platformMenu.isNull())
3755 d->platformMenu->syncSeparatorsCollapsible(collapse);
3772 return d->toolTipsVisible;
3787#include "moc_qmenu.cpp"
The QActionEvent class provides an event that is generated when a QAction is added,...
bool isExclusive() const
Returns true if the group is exclusive.
The QAction class provides an abstraction for user commands that can be added to different user inter...
ActionEvent
This enum type is used when calling QAction::activate()
T menu() const
Returns the menu contained by this action.
void hovered()
This signal is emitted when an action is highlighted by the user; for example, when the user pauses w...
bool isSeparator() const
Returns true if this action is a separator action; otherwise it returns false.
QActionGroup * actionGroup() const
Returns the action group for this action.
void setMenu(T m)
Sets the menu contained by this action to the specified menu.
bool isShortcutVisibleInContextMenu() const
void setSeparator(bool b)
If b is true then this action will be considered a separator.
QString whatsThis
the action's "What's This?" help text
QFont font
the action's font
bool showStatusText(QObject *object=nullptr)
Updates the relevant status bar for the UI represented by object by sending a QStatusTipEvent.
bool isIconVisibleInMenu() const
void activate(ActionEvent event)
Sends the relevant signals for ActionEvent event.
QString text
the action's descriptive text
void changed()
This signal is emitted when an action has changed.
MenuRole menuRole
the action's menu role
void trigger()
This is a convenience slot that calls activate(Trigger).
QIcon icon
the action's icon
static QStyle * style()
Returns the application's style object.
static void beep()
Sounds the bell, using the default volume and sound.
static bool isEffectEnabled(Qt::UIEffect)
Returns true if effect is enabled; otherwise returns false.
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or \nullptr if no widget in this ap...
static QWidget * activePopupWidget()
Returns the active popup widget.
int startDragDistance
the minimum distance required for a drag and drop operation to start.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
virtual void setAccepted(bool accepted)
Type type() const
Returns the event type.
void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
\reentrant \inmodule QtGui
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
int midLineWidth
the width of the mid-line
int lineWidth
the line width
void setEnabled(bool enabled)
If enabled is true, the item is enabled; otherwise, it is disabled.
void setVisible(bool visible)
If visible is true, the item is made visible.
static struct QGuiApplicationPrivate::QLastCursorPosition lastCursorPosition
static QPlatformTheme * platformTheme()
Qt::LayoutDirection layoutDirection
the default layout direction for this application
static QScreen * screenAt(const QPoint &point)
Returns the screen at point, or \nullptr if outside of any screen.
T value(const Key &key) const noexcept
The QHelpEvent class provides an event that is used to request helpful information about a particular...
const QPoint & pos() const
Returns the mouse cursor position when the event was generated, relative to the widget to which the e...
The QHideEvent class provides an event which is sent after a widget is hidden.
The QIcon class provides scalable icons in different modes and states.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
The QKeyEvent class describes a key event.
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
QString text() const
Returns the Unicode text that this key generated.
int key() const
Returns the code of the key that was pressed or released.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
static QKeySequence mnemonic(const QString &text)
Returns the shortcut key sequence for the mnemonic in text, or an empty key sequence if no mnemonics ...
bool isEmpty() const
Returns true if the key sequence is empty; otherwise returns false.
QString toString(SequenceFormat format=PortableText) const
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
std::reverse_iterator< const_iterator > const_reverse_iterator
reverse_iterator rbegin()
void append(parameter_type t)
Qt::MouseEventSource source() const
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched object.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
bool signalsBlocked() const noexcept
Returns true if signals are blocked; otherwise returns false.
bool blockSignals(bool b) noexcept
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke...
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
The QPaintEvent class contains event parameters for paint events.
const QRect & rect() const
Returns the rectangle that needs to be updated.
The QPainter class performs low-level painting on widgets and other paint devices.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation.
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
\inmodule QtCore\reentrant
constexpr int & rx() noexcept
Returns a reference to the x coordinate of this point.
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
const QPointingDevice * pointingDevice() const
Returns the source device from which this event originates.
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
bool intersects(const QRect &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e., there is at least one pixel...
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void setBottom(int pos) noexcept
Sets the bottom edge of the rectangle to the given y coordinate.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr void setRect(int x, int y, int w, int h) noexcept
Sets the coordinates of the rectangle's top-left corner to ({x}, {y}), and its size to the given widt...
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setWidth(int w) noexcept
Sets the width of the rectangle to the given width.
constexpr void translate(int dx, int dy) noexcept
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position.
constexpr int width() const noexcept
Returns the width of the rectangle.
QRect united(const QRect &other) const noexcept
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void setHeight(int h) noexcept
Sets the height of the rectangle to the given height.
constexpr void moveTop(int pos) noexcept
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
constexpr void setTop(int pos) noexcept
Sets the top edge of the rectangle to the given y coordinate.
The QRegion class specifies a clip region for a painter.
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect availableGeometry
the screen's available geometry in pixels
QRect geometry
the screen's geometry in pixels
QPointF globalPosition() const
Returns the position of the point in this event on the screen or virtual desktop.
QPointF position() const
Returns the position of the point in this event, relative to the widget or item that received the eve...
Qt::MouseButton button() const
Returns the button that caused the event.
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype indexOf(QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
qsizetype size() const noexcept
Returns the number of characters in this string.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
The QStyleHintReturnMask class provides style hints that return a QRegion.
\variable QStyleOptionFocusRect::backgroundColor
The QStyleOption class stores the parameters used by QStyle functions.
void initFrom(const QWidget *w)
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
static bool useFullScreenForPopup()
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
@ SH_MenuBar_AltKeyNavigation
@ SH_Menu_FlashTriggeredItem
@ SH_Menu_SubMenuPopupDelay
@ SH_Menu_SupportsSections
@ SH_Menu_AllowActiveAndDisabled
@ SH_Menu_FillScreenWithScroll
@ SH_Menu_SpaceActivatesItem
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
@ PM_MenuDesktopFrameWidth
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
bool singleShot
whether the timer is a single-shot timer
static void enterWhatsThisMode()
This function switches the user interface into "What's This?" mode.
static void showText(const QPoint &pos, const QString &text, QWidget *w=nullptr)
Shows text as a "What's This?" window, at global position pos.
static bool inWhatsThisMode()
Returns true if the user interface is in "What's This?" mode; otherwise returns false.
ResetOnDestroy(QMenuSloppyState *sloppyState, bool *guard)
QMenuSloppyState * toReset
QSet< QString >::iterator it
Combined button and popup list for selecting options.
@ WA_X11NetWmWindowTypePopupMenu
@ WA_X11NetWmWindowTypeDropDownMenu
@ WA_X11NetWmWindowTypeMenu
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
void qScrollEffect(QWidget *w, QEffects::DirFlags orient, int time)
void qFadeEffect(QWidget *w, int time)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLenum GLuint GLintptr offset
GLdouble GLdouble GLdouble GLdouble q
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
#define QT_CONFIG(feature)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
bool contains(const AT &t) const noexcept