Qt 4.8
Public Functions | Static Public Functions | Public Variables | Static Public Variables | List of all members
QActionPrivate Class Reference

#include <qaction_p.h>

Inheritance diagram for QActionPrivate:
QObjectPrivate QObjectData QWidgetActionPrivate

Public Functions

 QActionPrivate ()
 
void redoGrab (QShortcutMap &map)
 
void redoGrabAlternate (QShortcutMap &map)
 
void sendDataChanged ()
 
void setShortcutEnabled (bool enable, QShortcutMap &map)
 
bool showStatusText (QWidget *w, const QString &str)
 
 ~QActionPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Static Public Functions

static QActionPrivateget (QAction *q)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 

Public Variables

QList< int > alternateShortcutIds
 
QList< QKeySequencealternateShortcuts
 
uint autorepeat: 1
 
uint checkable: 1
 
uint checked: 1
 
uint enabled: 1
 
QFont font
 
uint fontSet: 1
 
uint forceDisabled: 1
 
uint forceEnabledInSoftkeys: 1
 
uint forceInvisible: 1
 
QList< QGraphicsWidget * > graphicsWidgets
 
QPointer< QActionGroupgroup
 
QIcon icon
 
QString iconText
 
int iconVisibleInMenu: 3
 
QPointer< QMenumenu
 
uint menuActionSoftkeys: 1
 
QAction::MenuRole menuRole
 
QAction::Priority priority
 
uint separator: 1
 
QKeySequence shortcut
 
Qt::ShortcutContext shortcutContext
 
int shortcutId
 
QAction::SoftKeyRole softKeyRole
 
QString statustip
 
QString text
 
QString tooltip
 
QVariant userData
 
uint visible: 1
 
QString whatsthis
 
QList< QWidget * > widgets
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Static Public Variables

static QShortcutMapglobalMap
 

Additional Inherited Members

- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 

Detailed Description

Definition at line 71 of file qaction_p.h.

Constructors and Destructors

◆ QActionPrivate()

QActionPrivate::QActionPrivate ( )

Definition at line 82 of file qaction.cpp.

82  : group(0), enabled(1), forceDisabled(0),
83  visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false),
88 {
89 #ifdef QT3_SUPPORT
90  static int qt_static_action_id = -1;
91  param = id = --qt_static_action_id;
92  act_signal = 0;
93 #endif
94 #ifndef QT_NO_SHORTCUT
95  shortcutId = 0;
97  autorepeat = true;
98 #endif
99 }
uint forceEnabledInSoftkeys
Definition: qaction_p.h:113
uint forceInvisible
Definition: qaction_p.h:106
QAction::Priority priority
Definition: qaction_p.h:119
QAction::SoftKeyRole softKeyRole
Definition: qaction_p.h:118
QPointer< QActionGroup > group
Definition: qaction_p.h:85
Qt::ShortcutContext shortcutContext
Definition: qaction_p.h:100
uint menuActionSoftkeys
Definition: qaction_p.h:114
QAction::MenuRole menuRole
Definition: qaction_p.h:117
int iconVisibleInMenu
Definition: qaction_p.h:115
uint forceDisabled
Definition: qaction_p.h:105

◆ ~QActionPrivate()

QActionPrivate::~QActionPrivate ( )

Definition at line 101 of file qaction.cpp.

102 {
103 }

Functions

◆ get()

static QActionPrivate* QActionPrivate::get ( QAction q)
inlinestatic

Definition at line 78 of file qaction_p.h.

Referenced by QSoftKeyManager::createAction(), QSoftKeyManager::isForceEnabledInSofkeys(), and QSoftKeyManager::setForceEnabledInSoftkeys().

79  {
80  return q->d_func();
81  }

◆ redoGrab()

void QActionPrivate::redoGrab ( QShortcutMap map)

Definition at line 140 of file qaction.cpp.

141 {
142  Q_Q(QAction);
143  if (shortcutId)
144  map.removeShortcut(shortcutId, q);
145  if (shortcut.isEmpty())
146  return;
148  if (!enabled)
149  map.setShortcutEnabled(false, shortcutId, q);
150  if (!autorepeat)
151  map.setShortcutAutoRepeat(false, shortcutId, q);
152 }
int setShortcutEnabled(bool enable, int id, QObject *owner, const QKeySequence &key=QKeySequence())
Changes the enable state of a shortcut to enable.
Qt::ShortcutContext shortcutContext
Definition: qaction_p.h:100
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isEmpty() const
Returns true if the key sequence is empty; otherwise returns false.
int setShortcutAutoRepeat(bool on, int id, QObject *owner, const QKeySequence &key=QKeySequence())
Changes the auto repeat state of a shortcut to enable.
int removeShortcut(int id, QObject *owner, const QKeySequence &key=QKeySequence())
Removes a shortcut from the global map.
int addShortcut(QObject *owner, const QKeySequence &key, Qt::ShortcutContext context)
Adds a shortcut to the global map.
QKeySequence shortcut
Definition: qaction_p.h:93
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64

◆ redoGrabAlternate()

void QActionPrivate::redoGrabAlternate ( QShortcutMap map)

Definition at line 154 of file qaction.cpp.

155 {
156  Q_Q(QAction);
157  for(int i = 0; i < alternateShortcutIds.count(); ++i) {
158  if (const int id = alternateShortcutIds.at(i))
159  map.removeShortcut(id, q);
160  }
163  return;
164  for(int i = 0; i < alternateShortcuts.count(); ++i) {
165  const QKeySequence& alternate = alternateShortcuts.at(i);
166  if (!alternate.isEmpty())
168  else
170  }
171  if (!enabled) {
172  for(int i = 0; i < alternateShortcutIds.count(); ++i) {
173  const int id = alternateShortcutIds.at(i);
174  map.setShortcutEnabled(false, id, q);
175  }
176  }
177  if (!autorepeat) {
178  for(int i = 0; i < alternateShortcutIds.count(); ++i) {
179  const int id = alternateShortcutIds.at(i);
180  map.setShortcutAutoRepeat(false, id, q);
181  }
182  }
183 }
int setShortcutEnabled(bool enable, int id, QObject *owner, const QKeySequence &key=QKeySequence())
Changes the enable state of a shortcut to enable.
QList< int > alternateShortcutIds
Definition: qaction_p.h:99
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
Qt::ShortcutContext shortcutContext
Definition: qaction_p.h:100
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void clear()
Removes all items from the list.
Definition: qlist.h:764
bool isEmpty() const
Returns true if the key sequence is empty; otherwise returns false.
int setShortcutAutoRepeat(bool on, int id, QObject *owner, const QKeySequence &key=QKeySequence())
Changes the auto repeat state of a shortcut to enable.
QList< QKeySequence > alternateShortcuts
Definition: qaction_p.h:94
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition: qkeysequence.h:72
int removeShortcut(int id, QObject *owner, const QKeySequence &key=QKeySequence())
Removes a shortcut from the global map.
int addShortcut(QObject *owner, const QKeySequence &key, Qt::ShortcutContext context)
Adds a shortcut to the global map.
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64

◆ sendDataChanged()

void QActionPrivate::sendDataChanged ( )

Definition at line 120 of file qaction.cpp.

121 {
122  Q_Q(QAction);
124  for (int i = 0; i < widgets.size(); ++i) {
125  QWidget *w = widgets.at(i);
127  }
128 #ifndef QT_NO_GRAPHICSVIEW
129  for (int i = 0; i < graphicsWidgets.size(); ++i) {
132  }
133 #endif
135 
136  emit q->changed();
137 }
QList< QWidget * > widgets
Definition: qaction_p.h:121
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QActionEvent class provides an event that is generated when a QAction is added, removed, or changed.
Definition: qevent.h:632
#define Q_Q(Class)
Definition: qglobal.h:2483
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
QList< QGraphicsWidget * > graphicsWidgets
Definition: qaction_p.h:123
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.

◆ setShortcutEnabled()

void QActionPrivate::setShortcutEnabled ( bool  enable,
QShortcutMap map 
)

Definition at line 185 of file qaction.cpp.

186 {
187  Q_Q(QAction);
188  if (shortcutId)
189  map.setShortcutEnabled(enable, shortcutId, q);
190  for(int i = 0; i < alternateShortcutIds.count(); ++i) {
191  if (const int id = alternateShortcutIds.at(i))
192  map.setShortcutEnabled(enable, id, q);
193  }
194 }
int setShortcutEnabled(bool enable, int id, QObject *owner, const QKeySequence &key=QKeySequence())
Changes the enable state of a shortcut to enable.
QList< int > alternateShortcutIds
Definition: qaction_p.h:99
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_Q(Class)
Definition: qglobal.h:2483
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64

◆ showStatusText()

bool QActionPrivate::showStatusText ( QWidget w,
const QString str 
)

Definition at line 105 of file qaction.cpp.

106 {
107 #ifdef QT_NO_STATUSTIP
108  Q_UNUSED(widget);
109  Q_UNUSED(str);
110 #else
111  if(QObject *object = widget ? widget : parent) {
112  QStatusTipEvent tip(str);
113  QApplication::sendEvent(object, &tip);
114  return true;
115  }
116 #endif
117  return false;
118 }
QPointer< QWidget > widget
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QStatusTipEvent class provides an event that is used to show messages in a status bar...
Definition: qevent.h:606
QObject * parent
Definition: qobject.h:92
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

Properties

◆ alternateShortcutIds

QList<int> QActionPrivate::alternateShortcutIds

Definition at line 99 of file qaction_p.h.

Referenced by redoGrabAlternate(), and setShortcutEnabled().

◆ alternateShortcuts

QList<QKeySequence> QActionPrivate::alternateShortcuts

Definition at line 94 of file qaction_p.h.

Referenced by redoGrabAlternate().

◆ autorepeat

uint QActionPrivate::autorepeat

Definition at line 101 of file qaction_p.h.

Referenced by QActionPrivate(), redoGrab(), and redoGrabAlternate().

◆ checkable

uint QActionPrivate::checkable

Definition at line 107 of file qaction_p.h.

◆ checked

uint QActionPrivate::checked

Definition at line 108 of file qaction_p.h.

◆ enabled

uint QActionPrivate::enabled

Definition at line 105 of file qaction_p.h.

Referenced by redoGrab(), and redoGrabAlternate().

◆ font

QFont QActionPrivate::font

Definition at line 103 of file qaction_p.h.

◆ fontSet

uint QActionPrivate::fontSet

Definition at line 110 of file qaction_p.h.

◆ forceDisabled

uint QActionPrivate::forceDisabled

Definition at line 105 of file qaction_p.h.

◆ forceEnabledInSoftkeys

uint QActionPrivate::forceEnabledInSoftkeys

◆ forceInvisible

uint QActionPrivate::forceInvisible

Definition at line 106 of file qaction_p.h.

◆ globalMap

QShortcutMap* QActionPrivate::globalMap
static

Definition at line 130 of file qaction_p.h.

◆ graphicsWidgets

QList<QGraphicsWidget *> QActionPrivate::graphicsWidgets

◆ group

QPointer<QActionGroup> QActionPrivate::group

Definition at line 85 of file qaction_p.h.

◆ icon

QIcon QActionPrivate::icon

Definition at line 88 of file qaction_p.h.

◆ iconText

QString QActionPrivate::iconText

Definition at line 87 of file qaction_p.h.

◆ iconVisibleInMenu

int QActionPrivate::iconVisibleInMenu

Definition at line 115 of file qaction_p.h.

◆ menu

QPointer<QMenu> QActionPrivate::menu

Definition at line 104 of file qaction_p.h.

◆ menuActionSoftkeys

uint QActionPrivate::menuActionSoftkeys

Definition at line 114 of file qaction_p.h.

Referenced by QSoftKeyManager::createAction().

◆ menuRole

QAction::MenuRole QActionPrivate::menuRole

Definition at line 117 of file qaction_p.h.

◆ priority

QAction::Priority QActionPrivate::priority

Definition at line 119 of file qaction_p.h.

◆ separator

uint QActionPrivate::separator

Definition at line 109 of file qaction_p.h.

◆ shortcut

QKeySequence QActionPrivate::shortcut

Definition at line 93 of file qaction_p.h.

Referenced by redoGrab().

◆ shortcutContext

Qt::ShortcutContext QActionPrivate::shortcutContext

Definition at line 100 of file qaction_p.h.

Referenced by QActionPrivate(), redoGrab(), and redoGrabAlternate().

◆ shortcutId

int QActionPrivate::shortcutId

Definition at line 98 of file qaction_p.h.

Referenced by QActionPrivate(), redoGrab(), and setShortcutEnabled().

◆ softKeyRole

QAction::SoftKeyRole QActionPrivate::softKeyRole

Definition at line 118 of file qaction_p.h.

◆ statustip

QString QActionPrivate::statustip

Definition at line 90 of file qaction_p.h.

◆ text

QString QActionPrivate::text

Definition at line 86 of file qaction_p.h.

◆ tooltip

QString QActionPrivate::tooltip

Definition at line 89 of file qaction_p.h.

◆ userData

QVariant QActionPrivate::userData

Definition at line 96 of file qaction_p.h.

◆ visible

uint QActionPrivate::visible

Definition at line 106 of file qaction_p.h.

◆ whatsthis

QString QActionPrivate::whatsthis

Definition at line 91 of file qaction_p.h.

◆ widgets

QList<QWidget *> QActionPrivate::widgets

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