45 #include <QtGui/qkeysequence.h> 46 #include <QtCore/qstring.h> 47 #include <QtGui/qwidget.h> 48 #include <QtCore/qvariant.h> 49 #include <QtGui/qicon.h> 82 #ifndef QT_NO_SHORTCUT 95 AboutRole, PreferencesRole, QuitRole };
97 NoSoftKey, PositiveSoftKey, NegativeSoftKey, SelectSoftKey };
117 void setIcon(
const QIcon &icon);
120 void setText(
const QString &text);
123 void setIconText(
const QString &text);
126 void setToolTip(
const QString &tip);
129 void setStatusTip(
const QString &statusTip);
132 void setWhatsThis(
const QString &what);
135 void setPriority(
Priority priority);
140 void setMenu(
QMenu *menu);
143 void setSeparator(
bool b);
146 #ifndef QT_NO_SHORTCUT 157 void setAutoRepeat(
bool);
158 bool autoRepeat()
const;
161 void setFont(
const QFont &font);
164 void setCheckable(
bool);
165 bool isCheckable()
const;
170 bool isChecked()
const;
172 bool isEnabled()
const;
174 bool isVisible()
const;
180 void setMenuRole(
MenuRole menuRole);
186 void setIconVisibleInMenu(
bool visible);
187 bool isIconVisibleInMenu()
const;
190 inline QT3_SUPPORT
void setMenuText(
const QString &text) { setText(text); }
191 inline QT3_SUPPORT
QString menuText()
const {
return text(); }
192 inline QT3_SUPPORT
bool isOn()
const {
return isChecked(); }
193 inline QT3_SUPPORT
bool isToggleAction()
const {
return isCheckable(); }
194 inline QT3_SUPPORT
void setToggleAction(
bool b) { setCheckable(b); }
195 inline QT3_SUPPORT
void setIconSet(
const QIcon &i) { setIcon(i); }
196 inline QT3_SUPPORT
QIcon iconSet()
const {
return icon(); }
197 inline QT3_SUPPORT
bool addTo(
QWidget *w) { w->
addAction(
this);
return true; }
199 inline QT3_SUPPORT
void setAccel(
const QKeySequence &shortcut) { setShortcut(shortcut); }
200 inline QT3_SUPPORT
QKeySequence accel()
const {
return shortcut(); }
206 #ifndef QT_NO_GRAPHICSVIEW 220 void setChecked(
bool);
222 void setEnabled(
bool);
224 void setVisible(
bool);
228 void triggered(
bool checked =
false);
239 friend class QMenuItem;
250 friend void qt_mac_clear_status_text(
QAction *action);
255 #include <QtGui/qactiongroup.h> 258 #endif // QT_NO_ACTION The QVariant class acts like a union for the most common Qt data types.
void hover()
This is a convenience slot that calls activate(Hover).
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
QKeySequence shortcut
the action's primary shortcut key
ActionEvent
This enum type is used when calling QAction::activate()
Priority
This enum defines priorities for actions in user interface.
void setDisabled(bool b)
This is a convenience function for the enabled property, that is useful for signals–slots connection...
#define QT_END_INCLUDE_NAMESPACE
This macro is equivalent to QT_BEGIN_NAMESPACE.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
StandardKey
This enum represent standard key bindings.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
bool iconVisibleInMenu
Whether or not an action should show an icon in a menu.
The QActionGroup class groups actions together.
MenuRole menuRole
the action's menu role
#define QT_BEGIN_NAMESPACE
This macro expands to.
void trigger()
This is a convenience slot that calls activate(Trigger).
static bool setData(const QByteArray &data, STGMEDIUM *pmedium)
static const char * data(const QByteArray &arr)
bool visible
whether the action can be seen (e.g.
static bool isSeparator(register char c)
SoftKeyRole
This enum describes how an action should be placed in the softkey bar.
Priority priority
the actions's priority in the user interface.
static QWidget * parentWidget(const QWidget *w)
bool autoRepeat
whether the action can auto repeat
SoftKeyRole softKeyRole
the action's softkey role
The QKeySequence class encapsulates a key sequence as used by shortcuts.
The QFont class specifies a font used for drawing text.
Qt::ShortcutContext shortcutContext
the context for the action's shortcut
MenuRole
This enum describes how an action should be moved into the application menu on Mac OS X...
#define QT_BEGIN_INCLUDE_NAMESPACE
This macro is equivalent to QT_END_NAMESPACE.
#define Q_DECLARE_PRIVATE(Class)
The QEvent class is the base class of all event classes.
The QAction class provides an abstract user interface action that can be inserted into widgets...
The QIcon class provides scalable icons in different modes and states.