📄 qmenubar.cpp
字号:
addAction(act); else insertAction(actions().value(index), act); return findIdForAction(act);}/*! \since 4.2 Use addSeparator() or insertAction() instead. \oldcode menuBar->insertSeparator(); \newcode menuBar->addSeparator(); \endcode*/int QMenuBar::insertSeparator(int index){ QAction *act = new QAction(this); act->setSeparator(true); if(index == -1 || index >= actions().count()) addAction(act); else insertAction(actions().value(index), act); return findIdForAction(act);}/*! Use QAction::setData() instead.*/bool QMenuBar::setItemParameter(int id, int param){ if(QAction *act = findActionForId(id)) { act->d_func()->param = param; return true; } return false;}/*! Use QAction::data() instead.*/int QMenuBar::itemParameter(int id) const{ if(QAction *act = findActionForId(id)) return act->d_func()->param; return id;}QAction *QMenuBar::findActionForId(int id) const{ QList<QAction *> list = actions(); for (int i = 0; i < list.size(); ++i) { QAction *act = list.at(i); if (findIdForAction(act) == id) return act; } return 0;}int QMenuBar::findIdForAction(QAction *act) const{ Q_ASSERT(act); return act->d_func()->id;}#endif/*! \enum QMenuBar::Separator \compat \value Never \value InWindowsStyle*//*! \fn void QMenuBar::addAction(QAction *action) \overload Appends the action \a action to the menu bar's list of actions. \sa QMenu::addAction(), QWidget::addAction()*//*! \fn uint QMenuBar::count() const Use actions().count() instead.*//*! \fn int QMenuBar::insertItem(const QString &text, const QObject *receiver, const char* member, const QKeySequence& shortcut, int id, int index) Use one of the insertAction() or addAction() overloads instead.*//*! \fn int QMenuBar::insertItem(const QIcon& icon, const QString &text, const QObject *receiver, const char* member, const QKeySequence& shortcut, int id, int index) Use one of the insertAction() or addAction() overloads instead.*//*! \fn int QMenuBar::insertItem(const QPixmap &pixmap, const QObject *receiver, const char* member, const QKeySequence& shortcut, int id, int index) Use one of the insertAction(), addAction(), insertMenu(), or addMenu() overloads instead.*//*! \fn int QMenuBar::insertItem(const QString &text, int id, int index) Use one of the insertAction() or addAction() overloads instead.*//*! \fn int QMenuBar::insertItem(const QIcon& icon, const QString &text, int id, int index) Use one of the insertAction(), addAction(), insertMenu(), or addMenu() overloads instead.*//*! \fn int QMenuBar::insertItem(const QString &text, QMenu *popup, int id, int index) Use one of the insertMenu(), or addMenu() overloads instead.*//*! \fn int QMenuBar::insertItem(const QIcon& icon, const QString &text, QMenu *popup, int id, int index) Use one of the insertMenu(), or addMenu() overloads instead.*//*! \fn int QMenuBar::insertItem(const QPixmap &pixmap, int id, int index) Use one of the insertAction(), addAction(), insertMenu(), or addMenu() overloads instead.*//*! \fn int QMenuBar::insertItem(const QPixmap &pixmap, QMenu *popup, int id, int index) Use one of the insertMenu(), or addMenu() overloads instead.*//*! \fn void QMenuBar::removeItem(int id) Use removeAction() instead.*//*! \fn void QMenuBar::removeItemAt(int index) Use removeAction() instead.*//*! \fn QKeySequence QMenuBar::accel(int id) const Use shortcut() on the relevant QAction instead.*//*! \fn void QMenuBar::setAccel(const QKeySequence& key, int id) Use setShortcut() on the relevant QAction instead.*//*! \fn QIcon QMenuBar::iconSet(int id) const Use icon() on the relevant QAction instead.*//*! \fn QString QMenuBar::text(int id) const Use text() on the relevant QAction instead.*//*! \fn QPixmap QMenuBar::pixmap(int id) const Use QPixmap(icon()) on the relevant QAction instead.*//*! \fn void QMenuBar::setWhatsThis(int id, const QString &w) Use setWhatsThis() on the relevant QAction instead.*//*! \fn QString QMenuBar::whatsThis(int id) const Use whatsThis() on the relevant QAction instead.*//*! \fn void QMenuBar::changeItem(int id, const QString &text) Use setText() on the relevant QAction instead.*//*! \fn void QMenuBar::changeItem(int id, const QPixmap &pixmap) Use setText() on the relevant QAction instead.*//*! \fn void QMenuBar::changeItem(int id, const QIcon &icon, const QString &text) Use setIcon() and setText() on the relevant QAction instead.*//*! \fn bool QMenuBar::isItemActive(int id) const Use activeAction() instead.*//*! \fn bool QMenuBar::isItemEnabled(int id) const Use isEnabled() on the relevant QAction instead.*//*! \fn void QMenuBar::setItemEnabled(int id, bool enable) Use setEnabled() on the relevant QAction instead.*//*! \fn bool QMenuBar::isItemChecked(int id) const Use isChecked() on the relevant QAction instead.*//*! \fn void QMenuBar::setItemChecked(int id, bool check) Use setChecked() on the relevant QAction instead.*//*! \fn bool QMenuBar::isItemVisible(int id) const Use isVisible() on the relevant QAction instead.*//*! \fn void QMenuBar::setItemVisible(int id, bool visible) Use setVisible() on the relevant QAction instead.*//*! \fn int QMenuBar::indexOf(int id) const Use actions().indexOf(action) on the relevant QAction instead.*//*! \fn int QMenuBar::idAt(int index) const Use actions instead.*//*! \fn void QMenuBar::activateItemAt(int index) Use activate() on the relevant QAction instead.*//*! \fn bool QMenuBar::connectItem(int id, const QObject *receiver, const char* member) Use connect() on the relevant QAction instead.*//*! \fn bool QMenuBar::disconnectItem(int id,const QObject *receiver, const char* member) Use disconnect() on the relevant QAction instead.*//*! \fn QMenuItem *QMenuBar::findItem(int id) const Use actions instead.*//*! \fn Separator QMenuBar::separator() const This function is provided only to make old code compile.*//*! \fn void QMenuBar::setSeparator(Separator sep) This function is provided only to make old code compile.*//*! \fn QRect QMenuBar::itemRect(int index) Use actionGeometry() on the relevant QAction instead.*//*! \fn int QMenuBar::itemAtPos(const QPoint &p) There is no equivalent way to achieve this in Qt 4.*//*! \fn void QMenuBar::activated(int itemId); Use triggered() instead.*//*! \fn void QMenuBar::highlighted(int itemId); Use hovered() instead.*//*! \fn void QMenuBar::setFrameRect(QRect) \internal*//*! \fn QRect QMenuBar::frameRect() const \internal*//*! \enum QMenuBar::DummyFrame \internal \value Box \value Sunken \value Plain \value Raised \value MShadow \value NoFrame \value Panel \value StyledPanel \value HLine \value VLine \value GroupBoxPanel \value WinPanel \value ToolBarPanel \value MenuBarPanel \value PopupPanel \value LineEditPanel \value TabWidgetPanel \value MShape*//*! \fn void QMenuBar::setFrameShadow(DummyFrame) \internal*//*! \fn DummyFrame QMenuBar::frameShadow() const \internal*//*! \fn void QMenuBar::setFrameShape(DummyFrame) \internal*//*! \fn DummyFrame QMenuBar::frameShape() const \internal*//*! \fn void QMenuBar::setFrameStyle(int) \internal*//*! \fn int QMenuBar::frameStyle() const \internal*//*! \fn void QMenuBar::setLineWidth(int) \internal*//*! \fn int QMenuBar::lineWidth() const \internal*//*! \fn void QMenuBar::setMargin(int margin) Sets the width of the margin around the contents of the widget to \a margin. Use QWidget::setContentsMargins() instead. \sa margin(), QWidget::setContentsMargins()*//*! \fn int QMenuBar::margin() const Returns the with of the the margin around the contents of the widget. Use QWidget::getContentsMargins() instead. \sa setMargin(), QWidget::getContentsMargins()*//*! \fn void QMenuBar::setMidLineWidth(int) \internal*//*! \fn int QMenuBar::midLineWidth() const \internal*/// for private slots#include <moc_qmenubar.cpp>#endif // QT_NO_MENUBAR
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -