45 #include <QtGui/qmenu.h> 73 #ifdef Q_NO_USING_KEYWORD 94 void setActiveAction(
QAction *action);
96 void setDefaultUp(
bool);
97 bool isDefaultUp()
const;
111 static bool macUpdateMenuBar();
115 void setDefaultAction(
QAction *);
116 QAction *defaultAction()
const;
118 static void wceCommands(
uint command);
119 static void wceRefresh();
122 bool isNativeMenuBar()
const;
123 void setNativeMenuBar(
bool nativeMenuBar);
129 void triggered(
QAction *action);
153 inline QT3_SUPPORT
int insertItem(
const QString &
text,
const QObject *receiver,
const char* member,
155 return insertAny(0, &text, receiver, member, &shortcut, 0,
id,
index);
158 const QObject *receiver,
const char* member,
160 return insertAny(&icon, &text, receiver, member, &shortcut, 0,
id,
index);
162 inline QT3_SUPPORT
int insertItem(
const QPixmap &pixmap,
const QObject *receiver,
const char* member,
165 return insertAny(&icon, 0, receiver, member, &shortcut, 0,
id,
index);
167 inline QT3_SUPPORT
int insertItem(
const QString &
text,
int id=-1,
int index=-1) {
168 return insertAny(0, &text, 0, 0, 0, 0,
id,
index);
171 return insertAny(&icon, &text, 0, 0, 0, 0,
id,
index);
174 return insertAny(0, &text, 0, 0, 0, popup,
id,
index);
177 return insertAny(&icon, &text, 0, 0, 0, popup,
id,
index);
179 inline QT3_SUPPORT
int insertItem(
const QPixmap &pixmap,
int id=-1,
int index=-1) {
181 return insertAny(&icon, 0, 0, 0, 0, 0,
id,
index);
183 inline QT3_SUPPORT
int insertItem(
const QPixmap &pixmap,
QMenu *popup,
int id=-1,
int index=-1) {
185 return insertAny(&icon, 0, 0, 0, 0, popup,
id,
index);
187 QT3_SUPPORT
int insertSeparator(
int index=-1);
188 inline QT3_SUPPORT
void removeItem(
int id) {
189 if(
QAction *act = findActionForId(
id))
191 inline QT3_SUPPORT
void removeItemAt(
int index) {
194 #ifndef QT_NO_SHORTCUT 196 if(
QAction *act = findActionForId(
id))
197 return act->shortcut();
200 if(
QAction *act = findActionForId(
id))
201 act->setShortcut(key);
204 inline QT3_SUPPORT
QIcon iconSet(
int id)
const {
205 if(
QAction *act = findActionForId(
id))
209 if(
QAction *act = findActionForId(
id))
212 inline QT3_SUPPORT
QPixmap pixmap(
int id)
const {
213 if(
QAction *act = findActionForId(
id))
214 return act->icon().pixmap(
QSize(22,22));
217 if(
QAction *act = findActionForId(
id))
218 act->setWhatsThis(w); }
220 if(
QAction *act = findActionForId(
id))
221 return act->whatsThis();
224 inline QT3_SUPPORT
void changeItem(
int id,
const QString &
text) {
225 if(
QAction *act = findActionForId(
id))
226 act->setText(text); }
227 inline QT3_SUPPORT
void changeItem(
int id,
const QPixmap &pixmap) {
228 if(
QAction *act = findActionForId(
id))
229 act->setIcon(
QIcon(pixmap)); }
230 inline QT3_SUPPORT
void changeItem(
int id,
const QIcon &icon,
const QString &text) {
231 if(
QAction *act = findActionForId(
id)) {
236 inline QT3_SUPPORT
bool isItemActive(
int id)
const {
return findActionForId(
id) == activeAction(); }
237 inline QT3_SUPPORT
bool isItemEnabled(
int id)
const {
238 if(
QAction *act = findActionForId(
id))
239 return act->isEnabled();
241 inline QT3_SUPPORT
void setItemEnabled(
int id,
bool enable) {
242 if(
QAction *act = findActionForId(
id))
243 act->setEnabled(enable); }
244 inline QT3_SUPPORT
bool isItemChecked(
int id)
const {
245 if(
QAction *act = findActionForId(
id))
246 return act->isChecked();
248 inline QT3_SUPPORT
void setItemChecked(
int id,
bool check) {
249 if(
QAction *act = findActionForId(
id))
250 act->setChecked(check); }
251 inline QT3_SUPPORT
bool isItemVisible(
int id)
const {
252 if(
QAction *act = findActionForId(
id))
253 return act->isVisible();
255 inline QT3_SUPPORT
void setItemVisible(
int id,
bool visible) {
256 if(
QAction *act = findActionForId(
id))
257 act->setVisible(visible); }
258 inline QT3_SUPPORT
int indexOf(
int id)
const {
return actions().
indexOf(findActionForId(
id)); }
259 inline QT3_SUPPORT
int idAt(
int index)
const {
264 inline QT3_SUPPORT
void activateItemAt(
int index) {
266 setActiveAction(ret);
268 inline QT3_SUPPORT
bool connectItem(
int id,
const QObject *receiver,
const char* member) {
269 if(
QAction *act = findActionForId(
id)) {
275 inline QT3_SUPPORT
bool disconnectItem(
int id,
const QObject *receiver,
const char* member) {
276 if(
QAction *act = findActionForId(
id)) {
282 inline QT3_SUPPORT QMenuItem *findItem(
int id)
const {
283 return (QMenuItem*)findActionForId(
id);
285 QT3_SUPPORT
bool setItemParameter(
int id,
int param);
286 QT3_SUPPORT
int itemParameter(
int id)
const;
289 QT3_SUPPORT
int frameWidth()
const;
291 QT3_SUPPORT
void setFrameRect(
QRect) {}
292 QT3_SUPPORT
QRect frameRect()
const {
return QRect(); }
293 enum DummyFrame { Box, Sunken, Plain, Raised, MShadow, NoFrame, Panel, StyledPanel,
294 HLine, VLine, GroupBoxPanel, WinPanel, ToolBarPanel, MenuBarPanel,
295 PopupPanel, LineEditPanel, TabWidgetPanel, MShape };
296 QT3_SUPPORT
void setFrameShadow(DummyFrame) {}
297 QT3_SUPPORT DummyFrame frameShadow()
const {
return Plain; }
298 QT3_SUPPORT
void setFrameShape(DummyFrame) {}
299 QT3_SUPPORT DummyFrame frameShape()
const {
return NoFrame; }
300 QT3_SUPPORT
void setFrameStyle(
int) {}
301 QT3_SUPPORT
int frameStyle()
const {
return 0; }
302 QT3_SUPPORT
void setLineWidth(
int) {}
303 QT3_SUPPORT
int lineWidth()
const {
return 0; }
304 QT3_SUPPORT
void setMargin(
int margin) {
setContentsMargins(margin, margin, margin, margin); }
305 QT3_SUPPORT
int margin()
const 306 {
int margin;
int dummy;
getContentsMargins(&margin, &dummy, &dummy, &dummy);
return margin; }
307 QT3_SUPPORT
void setMidLineWidth(
int) {}
308 QT3_SUPPORT
int midLineWidth()
const {
return 0; }
311 enum Separator { Never=0, InWindowsStyle=1 };
312 inline QT3_SUPPORT Separator separator()
const {
return InWindowsStyle; }
313 inline QT3_SUPPORT
void setSeparator(Separator) { }
315 QT3_SUPPORT
void setAutoGeometry(
bool);
316 QT3_SUPPORT
bool autoGeometry()
const;
323 inline QT3_SUPPORT
QRect itemRect(
int index) {
325 return actionGeometry(act);
328 inline QT3_SUPPORT
int itemAtPos(
const QPoint &p) {
329 return findIdForAction(actionAt(p));
332 QAction *findActionForId(
int id)
const;
333 int insertAny(
const QIcon *icon,
const QString *text,
const QObject *receiver,
const char *member,
335 int findIdForAction(
QAction*)
const;
361 #endif // QT_NO_MENUBAR
The QKeyEvent class describes a key event.
#define QT_END_NAMESPACE
This macro expands to.
ActionEvent
This enum type is used when calling QAction::activate()
#define at(className, varName)
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
static void clear(QVariant::Private *d)
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QActionEvent class provides an event that is generated when a QAction is added, removed, or changed.
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
The QResizeEvent class contains event parameters for resize events.
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
The QMouseEvent class contains parameters that describe a mouse event.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
The QTimerEvent class contains parameters that describe a timer event.
The QPoint class defines a point in the plane using integer precision.
int size() const
Returns the number of items in the list.
The QRect class defines a rectangle in the plane using integer precision.
struct OpaqueMenuRef * MenuRef
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
The QWindowsStyle class provides a Microsoft Windows-like look and feel.
The QPaintEvent class contains event parameters for paint events.
The QEvent class is the base class of all event classes.
The QFocusEvent class contains event parameters for widget focus events.
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.