55 class QMenuBarPrivate;
66 Q_PROPERTY(
bool defaultUp READ isDefaultUp WRITE setDefaultUp)
67 Q_PROPERTY(
bool nativeMenuBar READ isNativeMenuBar WRITE setNativeMenuBar)
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);
152 inline QT3_SUPPORT uint
count()
const {
return actions().count(); }
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);
157 inline QT3_SUPPORT
int insertItem(
const QIcon& icon,
const QString &text,
160 return insertAny(&icon, &text, receiver, member, &shortcut, 0,
id,
index);
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);
170 inline QT3_SUPPORT
int insertItem(
const QIcon& icon,
const QString &text,
int id=-1,
int index=-1) {
171 return insertAny(&icon, &text, 0, 0, 0, 0,
id,
index);
173 inline QT3_SUPPORT
int insertItem(
const QString &text,
QMenu *popup,
int id=-1,
int index=-1) {
174 return insertAny(0, &text, 0, 0, 0, popup,
id,
index);
176 inline QT3_SUPPORT
int insertItem(
const QIcon& icon,
const QString &text,
QMenu *popup,
int id=-1,
int index=-1) {
177 return insertAny(&icon, &text, 0, 0, 0, popup,
id,
index);
181 return insertAny(&icon, 0, 0, 0, 0, 0,
id,
index);
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();
199 inline QT3_SUPPORT
void setAccel(
const QKeySequence& key,
int id) {
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))
208 inline QT3_SUPPORT
QString text(
int id)
const {
209 if(
QAction *act = findActionForId(
id))
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 {
260 return index >= 0 && index <
actions().size()
261 ? findIdForAction(
actions().at(index))
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;
319 QT_MOC_COMPAT
void activated(
int itemId);
320 QT_MOC_COMPAT
void highlighted(
int itemId);
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;
351 friend class QMenuPrivate;
355 friend class QApplicationPrivate;
356 friend class QWidgetPrivate;
361 #endif // QT_NO_MENUBAR
virtual bool eventFilter(QObject *, QEvent *)
GLXFBConfig Pixmap pixmap
GLXDrawable GLXDrawable member
#define Q_PRIVATE_SLOT(d, signature)
virtual void timerEvent(QTimerEvent *)
#define QT_BEGIN_NAMESPACE
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
GLuint GLuint GLsizei count
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
GLsizei const GLfloat * value
GLuint const GLchar * name
struct OpaqueMenuRef * MenuRef
GLubyte GLubyte GLubyte GLubyte w