Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowsmenu.cpp File Reference

(65cda1f06aa24d9b75e81b37a5c23dcedbc53b92)

#include "qwindowsmenu.h"
#include "qwindowscontext.h"
#include "qwindowswindow.h"
#include <QtGui/qwindow.h>
#include <QtGui/private/qpixmap_win_p.h>
#include <QtCore/qdebug.h>
#include <QtCore/qvariant.h>
#include <QtCore/qmetaobject.h>
#include <QtCore/qpointer.h>
#include <algorithm>
+ Include dependency graph for qwindowsmenu.cpp:

Go to the source code of this file.

Functions

template<class Derived , class Needle >
static int indexOf (const QList< Derived * > &v, const Needle *needle)
 
template<class Derived , class Base >
static int insertBefore (QList< Derived * > *v, Base *newItemIn, const Base *before=nullptr)
 
static const wchar_t * qStringToWChar (const QString &s)
 
template<class Predicate >
static QWindowsMenuItemtraverseMenuItems (const QWindowsMenu *menu, Predicate p)
 
template<class Predicate >
static QWindowsMenuItemtraverseMenuItems (const QWindowsMenuBar *menuBar, Predicate p)
 
template<class Menu >
static QWindowsMenuItemfindMenuItemById (const Menu *menu, uint id)
 
template<class Predicate >
static QWindowsMenutraverseMenus (const QWindowsMenu *menu, Predicate p)
 
template<class Predicate >
static QWindowsMenutraverseMenus (const QWindowsMenuBar *menuBar, Predicate p)
 
template<class Menu >
static QWindowsMenufindMenuByHandle (const Menu *menu, HMENU hMenu)
 
template<class MenuType >
static int findNextVisibleEntry (const QList< MenuType * > &entries, int pos)
 
static void menuItemInfoInit (MENUITEMINFO &menuItemInfo)
 
static void menuItemInfoSetText (MENUITEMINFO &menuItemInfo, const QString &text)
 
static UINT menuItemState (HMENU hMenu, UINT uItem, BOOL fByPosition)
 
static void menuItemSetState (HMENU hMenu, UINT uItem, BOOL fByPosition, UINT flags)
 
static void menuItemSetChangeState (HMENU hMenu, UINT uItem, BOOL fByPosition, bool value, UINT trueState, UINT falseState)
 
template<class M >
static void formatTextSequence (QDebug &d, const QList< M * > &v)
 
QDebug operator<< (QDebug d, const QPlatformMenuItem *i)
 
QDebug operator<< (QDebug d, const QPlatformMenu *m)
 
QDebug operator<< (QDebug d, const QPlatformMenuBar *mb)
 

Variables

static uint nextId = 1
 
static QPointer< QWindowsPopupMenulastShownPopupMenu
 
static const char menuBarPropertyName [] = "_q_windowsNativeMenuBar"
 

Function Documentation

◆ findMenuByHandle()

template<class Menu >
static QWindowsMenu * findMenuByHandle ( const Menu * menu,
HMENU hMenu )
static

Definition at line 137 of file qwindowsmenu.cpp.

References i, menu, and traverseMenus().

Referenced by QWindowsPopupMenu::notifyAboutToShow(), and QWindowsMenuBar::notifyAboutToShow().

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

◆ findMenuItemById()

template<class Menu >
static QWindowsMenuItem * findMenuItemById ( const Menu * menu,
uint id )
static

Definition at line 99 of file qwindowsmenu.cpp.

References i, menu, and traverseMenuItems().

Referenced by QWindowsPopupMenu::notifyTriggered(), and QWindowsMenuBar::notifyTriggered().

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

◆ findNextVisibleEntry()

template<class MenuType >
static int findNextVisibleEntry ( const QList< MenuType * > & entries,
int pos )
static

Definition at line 143 of file qwindowsmenu.cpp.

References i, and pos.

Referenced by QWindowsMenu::insertIntoMenuBar().

+ Here is the caller graph for this function:

◆ formatTextSequence()

template<class M >
static void formatTextSequence ( QDebug & d,
const QList< M * > & v )
static

Definition at line 828 of file qwindowsmenu.cpp.

References d, and i.

Referenced by QWindowsMenu::formatDebug(), and QWindowsMenuBar::formatDebug().

+ Here is the caller graph for this function:

◆ indexOf()

template<class Derived , class Needle >
static int indexOf ( const QList< Derived * > & v,
const Needle * needle )
static

Definition at line 40 of file qwindowsmenu.cpp.

References i.

Referenced by insertBefore().

+ Here is the caller graph for this function:

◆ insertBefore()

template<class Derived , class Base >
static int insertBefore ( QList< Derived * > * v,
Base * newItemIn,
const Base * before = nullptr )
static

Definition at line 51 of file qwindowsmenu.cpp.

References indexOf().

Referenced by QWindowsMenuBar::insertMenu(), and QWindowsMenu::insertMenuItem().

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

◆ menuItemInfoInit()

static void menuItemInfoInit ( MENUITEMINFO & menuItemInfo)
inlinestatic

Definition at line 152 of file qwindowsmenu.cpp.

Referenced by menuItemInfoSetText(), menuItemSetState(), menuItemState(), and QWindowsMenuItem::setIsSeparator().

+ Here is the caller graph for this function:

◆ menuItemInfoSetText()

static void menuItemInfoSetText ( MENUITEMINFO & menuItemInfo,
const QString & text )
inlinestatic

Definition at line 158 of file qwindowsmenu.cpp.

References menuItemInfoInit(), qStringToWChar(), QString::size(), and text.

Referenced by QWindowsMenu::setText().

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

◆ menuItemSetChangeState()

static void menuItemSetChangeState ( HMENU hMenu,
UINT uItem,
BOOL fByPosition,
bool value,
UINT trueState,
UINT falseState )
static

Definition at line 183 of file qwindowsmenu.cpp.

References menuItemSetState(), menuItemState(), and newState().

Referenced by QWindowsMenuItem::setChecked(), QWindowsMenuItem::setEnabled(), and QWindowsMenu::setEnabled().

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

◆ menuItemSetState()

static void menuItemSetState ( HMENU hMenu,
UINT uItem,
BOOL fByPosition,
UINT flags )
static

Definition at line 174 of file qwindowsmenu.cpp.

References menuItemInfoInit().

Referenced by menuItemSetChangeState(), and QWindowsMenuItem::setCheckable().

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

◆ menuItemState()

static UINT menuItemState ( HMENU hMenu,
UINT uItem,
BOOL fByPosition )
static

Definition at line 166 of file qwindowsmenu.cpp.

References menuItemInfoInit().

Referenced by menuItemSetChangeState(), and QWindowsMenuItem::setCheckable().

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

◆ operator<<() [1/3]

QDebug operator<< ( QDebug d,
const QPlatformMenu * m )

Definition at line 906 of file qwindowsmenu.cpp.

References d.

◆ operator<<() [2/3]

QDebug operator<< ( QDebug d,
const QPlatformMenuBar * mb )

Definition at line 921 of file qwindowsmenu.cpp.

References d.

◆ operator<<() [3/3]

QDebug operator<< ( QDebug d,
const QPlatformMenuItem * i )

Definition at line 868 of file qwindowsmenu.cpp.

References d, and i.

◆ qStringToWChar()

static const wchar_t * qStringToWChar ( const QString & s)
inlinestatic

Definition at line 63 of file qwindowsmenu.cpp.

Referenced by QWindowsMenu::insertIntoMenuBar(), menuItemInfoSetText(), and QWindowsMenuItem::setMenu().

+ Here is the caller graph for this function:

◆ traverseMenuItems() [1/2]

template<class Predicate >
static QWindowsMenuItem * traverseMenuItems ( const QWindowsMenu * menu,
Predicate p )
static

Definition at line 71 of file qwindowsmenu.cpp.

References item, items, menu, and traverseMenuItems().

Referenced by findMenuItemById(), QWindowsMenu::menuItemForTag(), traverseMenuItems(), and traverseMenuItems().

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

◆ traverseMenuItems() [2/2]

template<class Predicate >
static QWindowsMenuItem * traverseMenuItems ( const QWindowsMenuBar * menuBar,
Predicate p )
static

Definition at line 88 of file qwindowsmenu.cpp.

References item, menu, menuBar, and traverseMenuItems().

+ Here is the call graph for this function:

◆ traverseMenus() [1/2]

template<class Predicate >
static QWindowsMenu * traverseMenus ( const QWindowsMenu * menu,
Predicate p )
static

Definition at line 107 of file qwindowsmenu.cpp.

References item, items, menu, and traverseMenus().

Referenced by findMenuByHandle(), QWindowsMenuBar::menuForTag(), traverseMenus(), and traverseMenus().

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

◆ traverseMenus() [2/2]

template<class Predicate >
static QWindowsMenu * traverseMenus ( const QWindowsMenuBar * menuBar,
Predicate p )
static

Definition at line 124 of file qwindowsmenu.cpp.

References menu, menuBar, and traverseMenus().

+ Here is the call graph for this function:

Variable Documentation

◆ lastShownPopupMenu

◆ menuBarPropertyName

const char menuBarPropertyName[] = "_q_windowsNativeMenuBar"
static

◆ nextId