Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QMenuPrivate Class Reference

#include <qmenu_p.h>

+ Inheritance diagram for QMenuPrivate:
+ Collaboration diagram for QMenuPrivate:

Classes

struct  DelayState
 
struct  QMenuCaused
 
struct  QMenuScroller
 
class  ScrollerTearOffItem
 

Public Types

enum  SelectionReason { SelectedFromKeyboard , SelectedFromElsewhere }
 
using PositionFunction = std::function< QPoint(const QSize &)>
 
- Public Types inherited from QWidgetPrivate
enum  DrawWidgetFlag {
  DrawAsRoot = 0x01 , DrawPaintOnScreen = 0x02 , DrawRecursive = 0x04 , DrawInvisible = 0x08 ,
  DontSubtractOpaqueChildren = 0x10 , DontDrawOpaqueChildren = 0x20 , DontDrawNativeChildren = 0x40 , DontSetCompositionMode = 0x80 ,
  UseEffectRegionBounds = 0x100
}
 
enum  Direction { DirectionNorth = 0x01 , DirectionEast = 0x10 , DirectionSouth = 0x02 , DirectionWest = 0x20 }
 
enum class  WindowHandleMode { Direct , Closest , TopLevel }
 
enum  CloseMode { CloseNoEvent , CloseWithEvent , CloseWithSpontaneousEvent }
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData >
 

Public Member Functions

 QMenuPrivate ()
 
 ~QMenuPrivate ()
 
void init ()
 
QPlatformMenucreatePlatformMenu ()
 
void setPlatformMenu (QPlatformMenu *menu)
 
void syncPlatformMenu ()
 
void copyActionToPlatformItem (const QAction *action, QPlatformMenuItem *item)
 
QPlatformMenuIteminsertActionInPlatformMenu (const QAction *action, QPlatformMenuItem *beforeItem)
 
int scrollerHeight () const
 
bool isContextMenu () const
 
QRect actionRect (QAction *) const
 
void updateActionRects () const
 
void updateActionRects (const QRect &screen) const
 
QRect popupGeometry (QScreen *screen=nullptr) const
 
bool useFullScreenForPopup () const
 
int getLastVisibleAction () const
 
void popup (const QPoint &p, QAction *atAction, PositionFunction positionFunction={})
 
QActionexec (const QPoint &p, QAction *action, PositionFunction positionFunction={})
 
QWidgettopCausedWidget () const
 
QActionactionAt (QPoint p) const
 
void setFirstActionActive ()
 
void setCurrentAction (QAction *, int popup=-1, SelectionReason reason=SelectedFromElsewhere, bool activateFirst=false)
 
void popupAction (QAction *, int, bool)
 
void setSyncAction ()
 
void scrollMenu (QMenuScroller::ScrollLocation location, bool active=false)
 
void scrollMenu (QMenuScroller::ScrollDirection direction, bool page=false, bool active=false)
 
void scrollMenu (QAction *action, QMenuScroller::ScrollLocation location, bool active=false)
 
bool mouseEventTaken (QMouseEvent *)
 
virtual QList< QPointer< QWidget > > calcCausedStack () const
 
void hideUpToMenuBar ()
 
void hideMenu (QMenu *menu)
 
QWindowtransientParentWindow () const
 
QActionactionAt (int i) const
 
int indexOf (QAction *act) const
 
void setOverrideMenuAction (QAction *)
 
void _q_overrideMenuActionDestroyed ()
 
void activateAction (QAction *, QAction::ActionEvent, bool self=true)
 
void activateCausedStack (const QList< QPointer< QWidget > > &, QAction *, QAction::ActionEvent, bool)
 
void _q_actionTriggered ()
 
void _q_actionHovered ()
 
void _q_platformMenuAboutToShow ()
 
bool hasMouseMoved (const QPoint &globalPos)
 
void updateLayoutDirection ()
 
void drawScroller (QPainter *painter, ScrollerTearOffItem::Type type, const QRect &rect)
 
void drawTearOff (QPainter *painter, const QRect &rect)
 
QRect rect () const
 
- Public Member Functions inherited from QWidgetPrivate
 QWidgetPrivate (int version=QObjectPrivateVersion)
 
 ~QWidgetPrivate ()
 
QWExtraextraData () const
 
QTLWExtratopData () const
 
QTLWExtramaybeTopData () const
 
QPaintersharedPainter () const
 
void setSharedPainter (QPainter *painter)
 
QWidgetRepaintManagermaybeRepaintManager () const
 
QWindowwindowHandle (WindowHandleMode mode=WindowHandleMode::Direct) const
 
QWindow_q_closestWindowHandle () const
 
QScreenassociatedScreen () const
 
template<typename T >
void repaint (T t)
 
template<typename T >
void update (T t)
 
void init (QWidget *desktopWidget, Qt::WindowFlags f)
 
void create ()
 
void createRecursively ()
 
void createWinId ()
 
bool setScreenForPoint (const QPoint &pos)
 
bool setScreen (QScreen *screen)
 
void createTLExtra ()
 
void createExtra ()
 
void deleteExtra ()
 
void createSysExtra ()
 
void deleteSysExtra ()
 
void createTLSysExtra ()
 
void deleteTLSysExtra ()
 
void updateSystemBackground ()
 
void propagatePaletteChange ()
 
void setPalette_helper (const QPalette &)
 
void resolvePalette ()
 
QPalette naturalWidgetPalette (QPalette::ResolveMask inheritedMask) const
 
void setMask_sys (const QRegion &)
 
void raise_sys ()
 
void lower_sys ()
 
void stackUnder_sys (QWidget *)
 
QWidgetdeepestFocusProxy () const
 
void setFocus_sys ()
 
void updateFocusChild ()
 
void updateFont (const QFont &)
 
void setFont_helper (const QFont &font)
 
QFont localFont () const
 
void resolveFont ()
 
QFont naturalWidgetFont (uint inheritedMask) const
 
void setLayoutDirection_helper (Qt::LayoutDirection)
 
void resolveLayoutDirection ()
 
void setLocale_helper (const QLocale &l, bool forceUpdate=false)
 
void resolveLocale ()
 
void setStyle_helper (QStyle *newStyle, bool propagate)
 
void inheritStyle ()
 
void setUpdatesEnabled_helper (bool)
 
bool updateBrushOrigin (QPainter *, const QBrush &brush) const
 
void paintBackground (QPainter *, const QRegion &, DrawWidgetFlags flags=DrawAsRoot) const
 
bool isAboutToShow () const
 The graphicsEffect function returns a pointer to the widget's graphics effect.
 
QRegion prepareToRender (const QRegion &region, QWidget::RenderFlags renderFlags)
 
void render_helper (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void drawWidget (QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, DrawWidgetFlags flags, QPainter *sharedPainter=nullptr, QWidgetRepaintManager *repaintManager=nullptr)
 
void sendPaintEvent (const QRegion &toBePainted)
 
void paintSiblingsRecursive (QPaintDevice *pdev, const QObjectList &children, int index, const QRegion &rgn, const QPoint &offset, DrawWidgetFlags flags, QPainter *sharedPainter, QWidgetRepaintManager *repaintManager)
 
bool shouldPaintOnScreen () const
 
void paintOnScreen (const QRegion &rgn)
 
QRect clipRect () const
 
QRegion clipRegion () const
 
void setSystemClip (QPaintEngine *paintEngine, qreal devicePixelRatio, const QRegion &region)
 
void subtractOpaqueChildren (QRegion &rgn, const QRect &clipRect) const
 
void subtractOpaqueSiblings (QRegion &source, bool *hasDirtySiblingsAbove=nullptr, bool alsoNonOpaque=false) const
 
void clipToEffectiveMask (QRegion &region) const
 
void updateIsOpaque ()
 
void setOpaque (bool opaque)
 
void updateIsTranslucent ()
 
const QRegiongetOpaqueChildren () const
 
void setDirtyOpaqueRegion ()
 
bool close ()
 
bool handleClose (CloseMode mode)
 
void setWindowIcon_helper ()
 
void setWindowIcon_sys ()
 
void setWindowOpacity_sys (qreal opacity)
 
void adjustQuitOnCloseAttribute ()
 
void scrollChildren (int dx, int dy)
 
void moveRect (const QRect &, int dx, int dy)
 
void scrollRect (const QRect &, int dx, int dy)
 
void invalidateBackingStore_resizeHelper (const QPoint &oldPos, const QSize &oldSize)
 Invalidates the backing store when the widget is resized.
 
template<class T >
void invalidateBackingStore (const T &)
 
QRegion overlappedRegion (const QRect &rect, bool breakAfterFirst=false) const
 
bool isOverlapped (const QRect &rect) const
 
void syncBackingStore ()
 
void syncBackingStore (const QRegion &region)
 
bool shouldDiscardSyncRequest () const
 
void updateWidgetTransform (QEvent *event)
 
void reparentFocusWidgets (QWidget *oldtlw)
 
void setWinId (WId)
 
void showChildren (bool spontaneous)
 
void hideChildren (bool spontaneous)
 
void setParent_sys (QWidget *parent, Qt::WindowFlags)
 
void scroll_sys (int dx, int dy)
 
void scroll_sys (int dx, int dy, const QRect &r)
 
void deactivateWidgetCleanup ()
 
void setGeometry_sys (int, int, int, int, bool)
 
void fixPosIncludesFrame ()
 
void sendPendingMoveAndResizeEvents (bool recursive=false, bool disableUpdates=false)
 
void activateChildLayoutsRecursively ()
 
void show_recursive ()
 
void show_helper ()
 
void show_sys ()
 
void hide_sys ()
 
void hide_helper ()
 
void _q_showIfNotHidden ()
 
void setVisible (bool)
 
void setEnabled_helper (bool)
 
void updateFrameStrut ()
 
QRect frameStrut () const
 
void setWindowIconText_sys (const QString &cap)
 
void setWindowIconText_helper (const QString &cap)
 
void setWindowTitle_sys (const QString &cap)
 
void setWindowFilePath_sys (const QString &filePath)
 
void setCursor_sys (const QCursor &cursor)
 
void unsetCursor_sys ()
 
void setWindowTitle_helper (const QString &cap)
 
void setWindowFilePath_helper (const QString &filePath)
 
void setWindowModified_helper ()
 
virtual void setWindowFlags (Qt::WindowFlags windowFlags)
 
bool setMinimumSize_helper (int &minw, int &minh)
 
bool setMaximumSize_helper (int &maxw, int &maxh)
 
void setConstraints_sys ()
 
bool pointInsideRectAndMask (const QPoint &) const
 
QWidgetchildAt_helper (const QPoint &, bool) const
 
QWidgetchildAtRecursiveHelper (const QPoint &p, bool) const
 
void updateGeometry_helper (bool forceUpdate)
 
void getLayoutItemMargins (int *left, int *top, int *right, int *bottom) const
 
void setLayoutItemMargins (int left, int top, int right, int bottom)
 
void setLayoutItemMargins (QStyle::SubElement element, const QStyleOption *opt=nullptr)
 
void updateContentsRect ()
 
QMargins safeAreaMargins () const
 
virtual void aboutToDestroy ()
 
QWidgeteffectiveFocusWidget ()
 
void setModal_sys ()
 
void setRedirected (QPaintDevice *replacement, const QPoint &offset)
 
QPaintDeviceredirected (QPoint *offset) const
 
void restoreRedirected ()
 
void enforceNativeChildren ()
 
bool nativeChildrenForced () const
 
QRect effectiveRectFor (const QRegion &region) const
 
QRect effectiveRectFor (const QRect &rect) const
 
QSize adjustedSize () const
 
void handleSoftwareInputPanel (Qt::MouseButton button, bool clickCausedFocus)
 
void handleSoftwareInputPanel (bool clickCausedFocus=false)
 
void setWSGeometry ()
 
QPoint mapToWS (const QPoint &p) const
 
QPoint mapFromWS (const QPoint &p) const
 
QRect mapToWS (const QRect &r) const
 
QRect mapFromWS (const QRect &r) const
 
virtual QObjectfocusObject ()
 
virtual QPlatformBackingStoreRhiConfig rhiConfig () const
 
virtual TextureData texture () const
 
virtual QPlatformTextureList::Flags textureListFlags ()
 
virtual QImage grabFramebuffer ()
 
virtual void beginBackingStorePainting ()
 
virtual void endBackingStorePainting ()
 
virtual void beginCompose ()
 
virtual void endCompose ()
 
void setRenderToTexture ()
 
void setTextureChildSeen ()
 
virtual void initializeViewportFramebuffer ()
 
virtual void resizeViewportFramebuffer ()
 
virtual void resolveSamples ()
 
virtual bool isStereoEnabled ()
 
virtual bool toggleStereoTargetBuffer ()
 
std::string flagsForDumping () const override
 
void setNetWmWindowTypes (bool skipIfMissing=false)
 
bool stealKeyboardGrab (bool grab)
 
bool stealMouseGrab (bool grab)
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
void setParent_helper (QObject *)
 
void moveToThread_helper ()
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
 
void _q_reregisterTimers (void *pointer)
 
bool isSender (const QObject *receiver, const char *signal) const
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void ensureConnectionData ()
 
void addConnection (int signal, Connection *c)
 
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
 
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
 
bool maybeSignalConnected (uint signalIndex) const
 
bool isDeclarativeSignalConnected (uint signalIdx) const
 
void connectNotify (const QMetaMethod &signal)
 
void disconnectNotify (const QMetaMethod &signal)
 
void reinitBindingStorageAfterThreadMove ()
 
virtual std::string flagsForDumping () const
 
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
 
- Public Member Functions inherited from QObjectData
 QObjectData ()=default
 
virtual ~QObjectData ()=0
 
QMetaObjectdynamicMetaObject () const
 

Static Public Member Functions

static QMenuPrivateget (QMenu *m)
 
- Static Public Member Functions inherited from QWidgetPrivate
static QWidgetPrivateget (QWidget *w)
 
static const QWidgetPrivateget (const QWidget *w)
 
static void checkRestoredGeometry (const QRect &availableGeometry, QRect *restoredGeometry, int frameHeight)
 
static void adjustFlags (Qt::WindowFlags &flags, QWidget *w=nullptr)
 
static QWidgetparentGraphicsView (const QWidget *widget)
 
static QRect screenGeometry (const QWidget *widget)
 
static QRect availableScreenGeometry (const QWidget *widget)
 
static QScreenscreen (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true)
 
static QRect screenGeometry (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true)
 
static QRect availableScreenGeometry (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true)
 
static void sendComposeStatus (QWidget *w, bool end)
 
static void setWidgetParentHelper (QObject *widgetAsObject, QObject *newParent)
 
- Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
 
static QObjectPrivateget (QObject *o)
 
static const QObjectPrivateget (const QObject *o)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
 
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
 
static bool disconnect (const QObject *sender, int signal_index, void **slot)
 
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)
 

Public Attributes

QList< QRectactionRects
 
QHash< QAction *, QWidget * > widgetItems
 
QPoint mousePopupPos
 
QActioncurrentAction = nullptr
 
struct QMenuPrivate::DelayState delayState
 
struct QMenuPrivate::QMenuScrollerscroll = nullptr
 
QEventLoopeventLoop = nullptr
 
QPointer< QActionsyncAction
 
QString searchBuffer
 
QBasicTimer searchBufferTimer
 
QPointer< QMenuactiveMenu
 
QMenuCaused causedPopup
 
QPointer< QTornOffMenutornPopup
 
QMenuSloppyState sloppyState
 
QPointer< QActiondefaultAction
 
QActionmenuAction = nullptr
 
QActiondefaultMenuAction = nullptr
 
QPointer< QPlatformMenuplatformMenu
 
QPointer< QActionactionAboutToTrigger
 
QPointer< QWidgetnoReplayFor
 
ScrollerTearOffItemscrollUpTearOffItem = nullptr
 
ScrollerTearOffItemscrollDownItem = nullptr
 
uint maxIconWidth = 0
 
uint tabWidth = 0
 
int motions = 0
 
int mousePopupDelay = 0
 
bool activationRecursionGuard = false
 
quint8 ncols = 0
 
bool itemsDirty: 1
 
bool hasCheckableItems: 1
 
bool lastContextMenu: 1
 
bool collapsibleSeparators: 1
 
bool toolTipsVisible: 1
 
bool delayedPopupGuard: 1
 
bool hasReceievedEnter: 1
 
bool hasHadMouse: 1
 
bool aboutToHide: 1
 
bool tearoff: 1
 
bool tornoff: 1
 
bool tearoffHighlighted: 1
 
bool doChildEffects: 1
 
- Public Attributes inherited from QWidgetPrivate
std::unique_ptr< QWExtraextra
 
QWidgetfocus_next
 
QWidgetfocus_prev
 
QWidgetfocus_child
 
QLayoutlayout
 
QRegionneedsFlush
 
QPaintDeviceredirectDev
 
QWidgetItemV2widgetItem
 
QPaintEngineextraPaintEngine
 
const QMetaObjectpolished
 
QGraphicsEffectgraphicsEffect
 
Qt::InputMethodHints imHints
 
QRegion opaqueChildren
 
QRegion dirty
 
uint directFontResolveMask
 
uint inheritedFontResolveMask
 
decltype(std::declval< QPalette >().resolveMask()) directPaletteResolveMask
 
QPalette::ResolveMask inheritedPaletteResolveMask
 
short leftmargin
 
short topmargin
 
short rightmargin
 
short bottommargin
 
signed char leftLayoutItemMargin
 
signed char topLayoutItemMargin
 
signed char rightLayoutItemMargin
 
signed char bottomLayoutItemMargin
 
Qt::HANDLE hd
 
QWidgetData data
 
QSizePolicy size_policy
 
QLocale locale
 
QPoint redirectOffset
 
QList< QAction * > actions
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
uint high_attributes [4]
 
QPalette::ColorRole fg_role: 8
 
QPalette::ColorRole bg_role: 8
 
uint dirtyOpaqueChildren: 1
 
uint isOpaque: 1
 
uint retainSizeWhenHiddenChanged: 1
 
uint inDirtyList: 1
 
uint isScrolled: 1
 
uint isMoved: 1
 
uint usesDoubleBufferedGLContext: 1
 
uint mustHaveWindowHandle: 1
 
uint renderToTexture: 1
 
uint textureChildSeen: 1
 
uint inheritsInputMethodHints: 1
 
uint renderToTextureReallyDirty: 1
 
uint usesRhiFlush: 1
 
uint childrenHiddenByWState: 1
 
uint childrenShownByExpose: 1
 
- Public Attributes inherited from QObjectPrivate
ExtraDataextraData
 
QAtomicPointer< QThreadDatathreadData
 
QAtomicPointer< ConnectionDataconnections
 
union { 
 
   QObject *   currentChildBeingDeleted 
 
   QAbstractDeclarativeData *   declarativeData 
 
};  
 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
 
- Public Attributes inherited from QObjectData
QObjectq_ptr
 
QObjectparent
 
QObjectList children
 
uint isWidget: 1
 
uint blockSig: 1
 
uint wasDeleted: 1
 
uint isDeletingChildren: 1
 
uint sendChildEvents: 1
 
uint receiveChildEvents: 1
 
uint isWindow: 1
 
uint deleteLaterCalled: 1
 
uint isQuickItem: 1
 
uint willBeWidget: 1
 
uint wasWidget: 1
 
uint unused: 21
 
QAtomicInt postedEvents
 
QDynamicMetaObjectDatametaObject
 
QBindingStorage bindingStorage
 

Static Public Attributes

static QMenumouseDown = nullptr
 
- Static Public Attributes inherited from QWidgetPrivate
static QWidgetMappermapper = nullptr
 
static QWidgetSetallWidgets = nullptr
 
static int instanceCounter = 0
 
static int maxInstances = 0
 

Detailed Description

Definition at line 268 of file qmenu_p.h.

Member Typedef Documentation

◆ PositionFunction

using QMenuPrivate::PositionFunction = std::function<QPoint(const QSize &)>

Definition at line 272 of file qmenu_p.h.

Member Enumeration Documentation

◆ SelectionReason

Enumerator
SelectedFromKeyboard 
SelectedFromElsewhere 

Definition at line 359 of file qmenu_p.h.

Constructor & Destructor Documentation

◆ QMenuPrivate()

QMenuPrivate::QMenuPrivate ( )
inline

Definition at line 274 of file qmenu_p.h.

◆ ~QMenuPrivate()

QMenuPrivate::~QMenuPrivate ( )
inline

Definition at line 290 of file qmenu_p.h.

References QPointer< T >::data(), QPointer< T >::isNull(), QObject::parent(), platformMenu, and scroll.

+ Here is the call graph for this function:

Member Function Documentation

◆ _q_actionHovered()

void QMenuPrivate::_q_actionHovered ( )

Definition at line 1531 of file qmenu.cpp.

References emit.

◆ _q_actionTriggered()

void QMenuPrivate::_q_actionTriggered ( )

Definition at line 1499 of file qmenu.cpp.

References activateCausedStack(), activationRecursionGuard, QList< T >::append(), QPlatformMenu::dismiss(), emit, hideUpToMenuBar(), list, QWidget::parentWidget(), platformMenu, QAction::Trigger, QHash< Key, T >::value(), widget, and widgetItems.

+ Here is the call graph for this function:

◆ _q_overrideMenuActionDestroyed()

void QMenuPrivate::_q_overrideMenuActionDestroyed ( )

Definition at line 922 of file qmenu.cpp.

References QMenu::menuAction().

+ Here is the call graph for this function:

◆ _q_platformMenuAboutToShow()

void QMenuPrivate::_q_platformMenuAboutToShow ( )

Definition at line 1539 of file qmenu.cpp.

References QWidgetPrivate::actions, emit, QPlatformMenu::menuItemForTag(), QObject::parent(), platformMenu, QPlatformMenu::syncMenuItem(), QHash< Key, T >::value(), widget, and widgetItems.

+ Here is the call graph for this function:

◆ actionAt() [1/2]

QAction * QMenuPrivate::actionAt ( int  i) const
inline

Definition at line 410 of file qmenu_p.h.

References i.

◆ actionAt() [2/2]

QAction * QMenuPrivate::actionAt ( QPoint  p) const

Definition at line 898 of file qmenu.cpp.

References QWidget::actions(), QList< T >::at(), contains(), i, and QWidget::rect.

+ Here is the call graph for this function:

◆ actionRect()

QRect QMenuPrivate::actionRect ( QAction act) const

Definition at line 498 of file qmenu.cpp.

References QWidget::actions(), and QListSpecialMethodsBase< T >::indexOf().

Referenced by activateAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ activateAction()

void QMenuPrivate::activateAction ( QAction action,
QAction::ActionEvent  action_e,
bool  self = true 
)

◆ activateCausedStack()

void QMenuPrivate::activateCausedStack ( const QList< QPointer< QWidget > > &  causedStack,
QAction action,
QAction::ActionEvent  action_e,
bool  self 
)

Definition at line 1389 of file qmenu.cpp.

References QAction::activate(), activationRecursionGuard, emit, QAction::Hover, i, qScopeGuard(), QAction::Trigger, and widget.

Referenced by _q_actionTriggered(), and activateAction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calcCausedStack()

QList< QPointer< QWidget > > QMenuPrivate::calcCausedStack ( ) const
virtual

Definition at line 302 of file qmenu.cpp.

References ret, and widget.

Referenced by activateAction().

+ Here is the caller graph for this function:

◆ copyActionToPlatformItem()

◆ createPlatformMenu()

QPlatformMenu * QMenuPrivate::createPlatformMenu ( )

Definition at line 183 of file qmenu.cpp.

References QMenu::platformMenu(), and QGuiApplicationPrivate::platformTheme().

+ Here is the call graph for this function:

◆ drawScroller()

◆ drawTearOff()

void QMenuPrivate::drawTearOff ( QPainter painter,
const QRect rect 
)

◆ exec()

QAction * QMenuPrivate::exec ( const QPoint p,
QAction action,
PositionFunction  positionFunction = {} 
)

Definition at line 2633 of file qmenu.cpp.

References eventLoop, QEventLoop::exec(), QPointer< T >::isNull(), popup(), syncAction, and void.

+ Here is the call graph for this function:

◆ get()

static QMenuPrivate * QMenuPrivate::get ( QMenu m)
inlinestatic

Definition at line 307 of file qmenu_p.h.

Referenced by QMenuSloppyState::childLeave(), QWidgetTextControlPrivate::contextMenuEvent(), QMenuSloppyState::enter(), QMenuSloppyState::hasParentActiveDelayTimer(), QMenuBarPrivate::popupAction(), QMenuSloppyState::reset(), QMenuSloppyState::setSubMenuPopup(), and QMenuSloppyState::timeout().

+ Here is the caller graph for this function:

◆ getLastVisibleAction()

int QMenuPrivate::getLastVisibleAction ( ) const

Definition at line 481 of file qmenu.cpp.

References QWidget::actions(), QList< T >::at(), QAction::isSeparator(), QAction::isVisible(), and QList< T >::size().

+ Here is the call graph for this function:

◆ hasMouseMoved()

bool QMenuPrivate::hasMouseMoved ( const QPoint globalPos)

Definition at line 1560 of file qmenu.cpp.

References motions, mousePopupPos, and QApplication::startDragDistance.

Referenced by mouseEventTaken().

+ Here is the caller graph for this function:

◆ hideMenu()

void QMenuPrivate::hideMenu ( QMenu menu)

Definition at line 538 of file qmenu.cpp.

References QMenu::aboutToHide(), QWidget::actions(), QMenu::activeAction(), QWidget::close(), QListSpecialMethodsBase< T >::contains(), QEvent::DeferredDelete, QObject::eventFilter(), QEventLoop::exec(), menu, Q_ASSERT, QMenu::setActiveAction(), QStyle::SH_Menu_FlashTriggeredItem, QTimer::singleShot, SLOT, QWidget::style(), QStyle::styleHint(), and QSignalBlocker::unblock().

Referenced by QMenuSloppyState::enter(), and QMenuSloppyState::timeout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hideUpToMenuBar()

void QMenuPrivate::hideUpToMenuBar ( )

Definition at line 510 of file qmenu.cpp.

References QStyle::SH_Menu_FadeOutOnHide.

Referenced by _q_actionTriggered(), activateAction(), and mouseEventTaken().

+ Here is the caller graph for this function:

◆ indexOf()

int QMenuPrivate::indexOf ( QAction act) const
inline

Definition at line 411 of file qmenu_p.h.

Referenced by activateAction().

+ Here is the caller graph for this function:

◆ init()

void QMenuPrivate::init ( )

Definition at line 158 of file qmenu.cpp.

References QAction::changed(), QObject::connect(), QMenu::menuAction(), QWidget::scroll(), QMenuPrivate::QMenuScroller::ScrollNone, QAction::setMenu(), QStyle::SH_Menu_MouseTracking, QStyle::SH_Menu_Scrollable, QStyle::SH_Menu_SubMenuPopupDelay, Qt::WA_CustomWhatsThis, and Qt::WA_X11NetWmWindowTypePopupMenu.

+ Here is the call graph for this function:

◆ insertActionInPlatformMenu()

QPlatformMenuItem * QMenuPrivate::insertActionInPlatformMenu ( const QAction action,
QPlatformMenuItem beforeItem 
)

Definition at line 265 of file qmenu.cpp.

References QPlatformMenuItem::activated(), QObject::connect(), QPlatformMenu::createMenuItem(), QAction::hovered(), QPlatformMenuItem::hovered(), QPlatformMenu::insertMenuItem(), QMenu::platformMenu(), Q_ASSERT, Qt::QueuedConnection, QPlatformMenuItem::setTag(), and QAction::trigger().

+ Here is the call graph for this function:

◆ isContextMenu()

bool QMenuPrivate::isContextMenu ( ) const

Definition at line 317 of file qmenu.cpp.

Referenced by popup().

+ Here is the caller graph for this function:

◆ mouseEventTaken()

◆ popup()

void QMenuPrivate::popup ( const QPoint p,
QAction atAction,
PositionFunction  positionFunction = {} 
)

Definition at line 2294 of file qmenu.cpp.

References actionRects, QWidgetPrivate::actions, QList< T >::at(), bypassGraphicsProxyWidget(), causedPopup, QRect::contains(), QWidgetPrivate::createWinId(), currentAction, defaultAction, doChildEffects, QEffects::DownScroll, emit, eventLoop, QWidget::geometry, QPushButtonPrivate::get(), QRect::height(), QSize::height(), i, QTLWExtra::initialScreen, isContextMenu(), QApplication::isEffectEnabled(), isEmbedded(), QAction::isEnabled(), itemsDirty, lastContextMenu, QRect::left(), QEffects::LeftScroll, QWidget::mapToGlobal(), motions, mousePopupPos, QRect::moveTopLeft(), ncols, QObjectData::parent, QStyle::PM_MenuDesktopFrameWidth, QStyle::PM_SubMenuOverlap, popupGeometry(), pos, QCursor::pos(), QWidget::pos, qFadeEffect(), qMax(), qMin(), qScrollEffect(), QRect::right(), QEffects::RightScroll, screen, QGuiApplication::screenAt(), scroll, QMenuPrivate::QMenuScroller::ScrollDown, QMenuPrivate::QMenuScroller::scrollFlags, QMenuPrivate::QMenuScroller::ScrollNone, QMenuPrivate::QMenuScroller::scrollOffset, QMenuPrivate::QMenuScroller::ScrollUp, QWidgetPrivate::setScreen(), QWidgetPrivate::setScreenForPoint(), QStyle::SH_Menu_FillScreenWithScroll, QList< T >::size(), tearoffHighlighted, topCausedWidget(), QWidgetPrivate::topData(), QRect::topLeft(), Qt::UI_AnimateMenu, Qt::UI_FadeMenu, updateActionRects(), updateLayoutDirection(), QEffects::UpScroll, Qt::WA_DontShowOnScreen, Qt::WA_X11NetWmWindowTypeDropDownMenu, QMenuPrivate::QMenuCaused::widget, QRect::width(), QSize::width(), QWidgetPrivate::windowHandle(), QPoint::x(), QWidget::x, QPoint::y(), and QPointF::y().

Referenced by exec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ popupAction()

void QMenuPrivate::popupAction ( QAction action,
int  delay,
bool  activateFirst 
)

Definition at line 625 of file qmenu.cpp.

References QAction::isEnabled(), QAction::menu(), and menu.

+ Here is the call graph for this function:

◆ popupGeometry()

QRect QMenuPrivate::popupGeometry ( QScreen screen = nullptr) const

Definition at line 292 of file qmenu.cpp.

References QScreen::availableGeometry, QWidgetPrivate::availableScreenGeometry(), QScreen::geometry, QWidget::screen(), and QWidgetPrivate::screenGeometry().

Referenced by popup(), and scrollMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rect()

QRect QMenuPrivate::rect ( ) const

Definition at line 993 of file qmenu.cpp.

References QStyleOption::initFrom(), opt, QStyle::pixelMetric(), QStyle::PM_MenuHMargin, QStyle::PM_MenuPanelWidth, QStyle::PM_MenuVMargin, and QWidget::style().

Referenced by QMenu::initStyleOption(), QMenuPrivate::ScrollerTearOffItem::paintEvent(), and QMenuPrivate::ScrollerTearOffItem::updateScrollerRects().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ scrollerHeight()

int QMenuPrivate::scrollerHeight ( ) const

Definition at line 279 of file qmenu.cpp.

References QStyle::PM_MenuScrollerHeight.

Referenced by mouseEventTaken(), scrollMenu(), and scrollMenu().

+ Here is the caller graph for this function:

◆ scrollMenu() [1/3]

◆ scrollMenu() [2/3]

◆ scrollMenu() [3/3]

void QMenuPrivate::scrollMenu ( QMenuScroller::ScrollLocation  location,
bool  active = false 
)

Definition at line 1215 of file qmenu.cpp.

References actionRects, QWidgetPrivate::actions, QList< T >::at(), i, QAction::isEnabled(), QRect::isNull(), QAction::isSeparator(), scroll, QMenuPrivate::QMenuScroller::ScrollBottom, QMenuPrivate::QMenuScroller::ScrollDown, QMenuPrivate::QMenuScroller::scrollFlags, scrollMenu(), QMenuPrivate::QMenuScroller::ScrollTop, QMenuPrivate::QMenuScroller::ScrollUp, SelectedFromKeyboard, setCurrentAction(), QStyle::SH_Menu_AllowActiveAndDisabled, QList< T >::size(), and updateActionRects().

Referenced by scrollMenu(), and scrollMenu().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCurrentAction()

void QMenuPrivate::setCurrentAction ( QAction action,
int  popup = -1,
SelectionReason  reason = SelectedFromElsewhere,
bool  activateFirst = false 
)

Definition at line 686 of file qmenu.cpp.

References QWidget::focusPolicy, QAction::Hover, QAction::isEnabled(), QAction::isSeparator(), menu, Qt::NoFocus, QMenu::popup(), Qt::PopupFocusReason, qFadeEffect(), qScrollEffect(), QWidget::setFocus(), QStyle::SH_Menu_AllowActiveAndDisabled, QAction::showStatusText(), Qt::TabFocusReason, QWidget::update(), and widget.

Referenced by mouseEventTaken(), scrollMenu(), scrollMenu(), and QMenuSloppyState::timeout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFirstActionActive()

void QMenuPrivate::setFirstActionActive ( )

Definition at line 662 of file qmenu.cpp.

References QWidget::actions(), QList< T >::at(), QRect::height(), i, QAction::isEnabled(), QRect::isNull(), QAction::isSeparator(), QWidget::rect, QWidget::scroll(), QStyle::SH_Menu_AllowActiveAndDisabled, and QList< T >::size().

+ Here is the call graph for this function:

◆ setOverrideMenuAction()

void QMenuPrivate::setOverrideMenuAction ( QAction a)

Definition at line 910 of file qmenu.cpp.

References QObject::connect(), QObject::destroyed(), QObject::disconnect(), QMenu::menuAction(), SIGNAL, and SLOT.

+ Here is the call graph for this function:

◆ setPlatformMenu()

void QMenuPrivate::setPlatformMenu ( QPlatformMenu menu)

Definition at line 191 of file qmenu.cpp.

References QMenu::aboutToHide(), QMenu::aboutToShow(), QObject::connect(), menu, QObject::parent(), QMenu::platformMenu(), SIGNAL, and SLOT.

+ Here is the call graph for this function:

◆ setSyncAction()

void QMenuPrivate::setSyncAction ( )

Definition at line 644 of file qmenu.cpp.

References QAction::isEnabled(), QAction::isSeparator(), and QAction::menu().

+ Here is the call graph for this function:

◆ syncPlatformMenu()

void QMenuPrivate::syncPlatformMenu ( )

Definition at line 204 of file qmenu.cpp.

References QWidget::actions(), it, QMenu::platformMenu(), QList< T >::rbegin(), QList< T >::rend(), QPlatformMenu::setEnabled(), and QPlatformMenu::syncSeparatorsCollapsible().

+ Here is the call graph for this function:

◆ topCausedWidget()

QWidget * QMenuPrivate::topCausedWidget ( ) const

Definition at line 890 of file qmenu.cpp.

Referenced by activateAction(), and popup().

+ Here is the caller graph for this function:

◆ transientParentWindow()

QWindow * QMenuPrivate::transientParentWindow ( ) const

Definition at line 602 of file qmenu.cpp.

References QObject::parent(), and QWidget::window().

+ Here is the call graph for this function:

◆ updateActionRects() [1/2]

void QMenuPrivate::updateActionRects ( ) const

Definition at line 326 of file qmenu.cpp.

Referenced by popup(), scrollMenu(), scrollMenu(), and scrollMenu().

+ Here is the caller graph for this function:

◆ updateActionRects() [2/2]

◆ updateLayoutDirection()

void QMenuPrivate::updateLayoutDirection ( )

Definition at line 927 of file qmenu.cpp.

References QGuiApplication::layoutDirection, QWidget::parentWidget(), and Qt::WA_SetLayoutDirection.

Referenced by popup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ useFullScreenForPopup()

bool QMenuPrivate::useFullScreenForPopup ( ) const
inline

Definition at line 287 of file qmenu.cpp.

References QStylePrivate::useFullScreenForPopup().

+ Here is the call graph for this function:

Member Data Documentation

◆ aboutToHide

bool QMenuPrivate::aboutToHide

Definition at line 483 of file qmenu_p.h.

◆ actionAboutToTrigger

QPointer<QAction> QMenuPrivate::actionAboutToTrigger

Definition at line 442 of file qmenu_p.h.

Referenced by activateAction().

◆ actionRects

QList<QRect> QMenuPrivate::actionRects
mutable

Definition at line 315 of file qmenu_p.h.

Referenced by popup(), scrollMenu(), scrollMenu(), and scrollMenu().

◆ activationRecursionGuard

bool QMenuPrivate::activationRecursionGuard = false

Definition at line 470 of file qmenu_p.h.

Referenced by _q_actionTriggered(), and activateCausedStack().

◆ activeMenu

QPointer<QMenu> QMenuPrivate::activeMenu

Definition at line 395 of file qmenu_p.h.

Referenced by QMenuSloppyState::enter(), mouseEventTaken(), and QMenuSloppyState::timeout().

◆ causedPopup

QMenuCaused QMenuPrivate::causedPopup

Definition at line 404 of file qmenu_p.h.

Referenced by mouseEventTaken(), and popup().

◆ collapsibleSeparators

bool QMenuPrivate::collapsibleSeparators

Definition at line 477 of file qmenu_p.h.

◆ currentAction

QAction* QMenuPrivate::currentAction = nullptr

Definition at line 329 of file qmenu_p.h.

Referenced by popup(), and QMenuSloppyState::timeout().

◆ defaultAction

QPointer<QAction> QMenuPrivate::defaultAction

Definition at line 419 of file qmenu_p.h.

Referenced by popup().

◆ defaultMenuAction

QAction* QMenuPrivate::defaultMenuAction = nullptr

Definition at line 422 of file qmenu_p.h.

◆ delayedPopupGuard

bool QMenuPrivate::delayedPopupGuard

Definition at line 479 of file qmenu_p.h.

◆ delayState

struct QMenuPrivate::DelayState QMenuPrivate::delayState

◆ doChildEffects

bool QMenuPrivate::doChildEffects

Definition at line 489 of file qmenu_p.h.

Referenced by popup().

◆ eventLoop

QEventLoop* QMenuPrivate::eventLoop = nullptr

Definition at line 387 of file qmenu_p.h.

Referenced by exec(), and popup().

◆ hasCheckableItems

bool QMenuPrivate::hasCheckableItems
mutable

Definition at line 475 of file qmenu_p.h.

◆ hasHadMouse

bool QMenuPrivate::hasHadMouse

Definition at line 482 of file qmenu_p.h.

◆ hasReceievedEnter

bool QMenuPrivate::hasReceievedEnter

Definition at line 480 of file qmenu_p.h.

Referenced by QMenuSloppyState::timeout().

◆ itemsDirty

bool QMenuPrivate::itemsDirty
mutable

Definition at line 474 of file qmenu_p.h.

Referenced by popup(), and scrollMenu().

◆ lastContextMenu

bool QMenuPrivate::lastContextMenu

Definition at line 476 of file qmenu_p.h.

Referenced by popup().

◆ maxIconWidth

uint QMenuPrivate::maxIconWidth = 0
mutable

Definition at line 465 of file qmenu_p.h.

◆ menuAction

QAction* QMenuPrivate::menuAction = nullptr

Definition at line 421 of file qmenu_p.h.

◆ motions

int QMenuPrivate::motions = 0

Definition at line 467 of file qmenu_p.h.

Referenced by hasMouseMoved(), and popup().

◆ mouseDown

◆ mousePopupDelay

int QMenuPrivate::mousePopupDelay = 0

Definition at line 468 of file qmenu_p.h.

◆ mousePopupPos

QPoint QMenuPrivate::mousePopupPos

Definition at line 327 of file qmenu_p.h.

Referenced by hasMouseMoved(), and popup().

◆ ncols

quint8 QMenuPrivate::ncols = 0
mutable

Definition at line 472 of file qmenu_p.h.

Referenced by popup().

◆ noReplayFor

QPointer<QWidget> QMenuPrivate::noReplayFor

Definition at line 444 of file qmenu_p.h.

◆ platformMenu

QPointer<QPlatformMenu> QMenuPrivate::platformMenu

Definition at line 440 of file qmenu_p.h.

Referenced by ~QMenuPrivate(), _q_actionTriggered(), and _q_platformMenuAboutToShow().

◆ scroll

◆ scrollDownItem

ScrollerTearOffItem* QMenuPrivate::scrollDownItem = nullptr

Definition at line 459 of file qmenu_p.h.

◆ scrollUpTearOffItem

ScrollerTearOffItem* QMenuPrivate::scrollUpTearOffItem = nullptr

Definition at line 458 of file qmenu_p.h.

◆ searchBuffer

QString QMenuPrivate::searchBuffer

Definition at line 391 of file qmenu_p.h.

◆ searchBufferTimer

QBasicTimer QMenuPrivate::searchBufferTimer

Definition at line 392 of file qmenu_p.h.

◆ sloppyState

QMenuSloppyState QMenuPrivate::sloppyState

◆ syncAction

QPointer<QAction> QMenuPrivate::syncAction

Definition at line 388 of file qmenu_p.h.

Referenced by exec().

◆ tabWidth

uint QMenuPrivate::tabWidth = 0
mutable

Definition at line 466 of file qmenu_p.h.

◆ tearoff

bool QMenuPrivate::tearoff

Definition at line 485 of file qmenu_p.h.

Referenced by mouseEventTaken(), and scrollMenu().

◆ tearoffHighlighted

bool QMenuPrivate::tearoffHighlighted

Definition at line 487 of file qmenu_p.h.

Referenced by mouseEventTaken(), and popup().

◆ toolTipsVisible

bool QMenuPrivate::toolTipsVisible

Definition at line 478 of file qmenu_p.h.

◆ tornoff

bool QMenuPrivate::tornoff

Definition at line 486 of file qmenu_p.h.

◆ tornPopup

QPointer<QTornOffMenu> QMenuPrivate::tornPopup

Definition at line 414 of file qmenu_p.h.

Referenced by mouseEventTaken().

◆ widgetItems

QHash<QAction *, QWidget *> QMenuPrivate::widgetItems
mutable

Definition at line 316 of file qmenu_p.h.

Referenced by _q_actionTriggered(), _q_platformMenuAboutToShow(), and scrollMenu().


The documentation for this class was generated from the following files: