![]() ![]() void QToolBar:: changeEvent( QEvent * event) Using QWidget::setVisible(), QWidget::show() and QWidget::hide() does not work. ![]() ![]() Note: You should use QAction::setVisible() to change the visibility of the widget. If you add a QToolButton with this method, the toolbar's Qt::ToolButtonStyle will not be respected. QAction *QToolBar:: addWidget( QWidget * widget)Īdds the given widget to the toolbar as the toolbar's last item. QAction *QToolBar:: addSeparator()Īdds a separator to the end of the toolbar. Reimplements: QWidget::actionEvent(QActionEvent *event). void QToolBar:: actionEvent( QActionEvent * event) This function returns zero if no action was found. QAction *QToolBar:: actionAt( int x, int y) const QAction *QToolBar:: actionAt(const QPoint & p) const QToolBar:: ~QToolBar()ĭestroys the toolbar. This happens when the widget is hidden or shown. This signal is emitted when the toolbar becomes visible (or invisible). void QToolBar:: visibilit圜hanged( bool visible) The topLevel parameter is true if the toolbar is now floating otherwise it is false. This signal is emitted when the floating property changes. void QToolBar:: topLevelChanged( bool topLevel) See also toolButtonStyle and QMainWindow::toolButtonStyle. Note: Notifier signal for property toolButtonStyle. The toolButtonStyle parameter holds the toolbar's new tool button style. This signal is emitted when the tool button style is changed. void QToolBar:: toolButtonStyleChanged( Qt::ToolButtonStyle toolButtonStyle) Note: Notifier signal for property orientation. The orientation parameter holds the toolbar's new orientation. This signal is emitted when the orientation of the toolbar changes. void QToolBar:: orientationChanged( Qt::Orientation orientation) Note: Notifier signal for property movable. If the toolbar can be moved, movable is true otherwise it is false. This signal is emitted when the toolbar becomes movable or fixed. void QToolBar:: movableChanged( bool movable) See also iconSize and QMainWindow::iconSize. Note: Notifier signal for property iconSize. The iconSize parameter holds the toolbar's new icon size. This signal is emitted when the icon size is changed. void QToolBar:: iconSizeChanged(const QSize & iconSize) Note: Notifier signal for property allowedAreas. The new areas in which the toolbar can be positioned are specified by allowedAreas. This signal is emitted when the collection of allowed areas for the toolbar is changed. void QToolBar:: allowedAreasChanged( Qt::ToolBarAreas allowedAreas) The parameter holds the triggered action. This happens when the action's tool button is pressed, or when the action is triggered in some other way outside the toolbar. This signal is emitted when an action in this toolbar is triggered. void QToolBar:: actionTriggered( QAction * action) The given window title identifies the toolbar and is shown in the context menu provided by QMainWindow. QToolBar:: QToolBar(const QString & title, QWidget * parent = nullptr)Ĭonstructs a QToolBar with the given parent. Member Function Documentation QToolBar:: QToolBar( QWidget * parent = nullptr)Ĭonstructs a QToolBar with the given parent. See also QToolButton, QMenu, QAction, and Qt Widgets - Application Example. Please use widget actions created by inheriting QWidgetAction and implementing QWidgetAction::createWidget() instead. When a QToolBar is not a child of a QMainWindow, it loses the ability to populate the extension pop up with widgets added to the toolbar using addWidget(). Pressing the extension button will pop up a menu containing the items that do not currently fit in the toolbar. When a toolbar is resized in such a way that it is too small to show all the items it contains, an extension button will appear as the last item in the toolbar. When a toolbar button is pressed, it emits the actionTriggered() signal.Ī toolbar can be fixed in place in a particular area (e.g., at the top of the window), or it can be movable between toolbar areas see setMovable(), isMovable(), allowedAreas() and isAreaAllowed(). Examples of suitable widgets are QSpinBox, QDoubleSpinBox, and QComboBox. If a toolbar button is not appropriate, a widget can be inserted instead using addWidget() or insertWidget(). Groups of buttons can be separated using addSeparator() or insertSeparator(). Toolbar buttons are added by adding actions, using addAction() or insertAction(). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |