Utils::StyledBarItemGroup Class
class Utils::StyledBarItemGroupThe StyledBarItemGroup class holds items for a StyledBar that does not own them. More...
| Header: | #include <widgets.h> |
| Inherits: | QObject |
Public Functions
| void | addItem(const Utils::Key &id, const QString &displayName, QWidget *widget) |
| void | addStretch(const Utils::Key &id) |
| void | insertItem(const Utils::Key &before, const Utils::Key &id, const QString &displayName, QWidget *widget) |
| Utils::KeyList | itemIds() const |
| void | removeItem(const Utils::Key &id) |
| void | setItemVisible(const Utils::Key &id, bool visible) |
| void | setPermanentItems(const Utils::KeyList &ids) |
| QWidget * | widget(const Utils::Key &id) const |
Signals
| void | changed() |
Detailed Description
Something that is shown in a bar it does not own, such as an editor in the editor tool bar, provides its items in a group. The bar shows them with StyledBar::setItemGroup() while it is current. The group owns the widgets and keeps them while no bar shows it.
The identifiers of the items must be unique among all items that can be shown in the same bar.
Member Function Documentation
void StyledBarItemGroup::addItem(const Utils::Key &id, const QString &displayName, QWidget *widget)
Adds widget with the identifier id to the end of the group. The user sees it as displayName when configuring the bar.
void StyledBarItemGroup::addStretch(const Utils::Key &id)
Adds a stretchable space with the identifier id to the end of the group. The user can move it, but not hide it.
[signal] void StyledBarItemGroup::changed()
void StyledBarItemGroup::insertItem(const Utils::Key &before, const Utils::Key &id, const QString &displayName, QWidget *widget)
Adds widget with the identifier id in front of the item before, or to the end if before is empty. The user sees it as displayName when configuring the bar.
Utils::KeyList StyledBarItemGroup::itemIds() const
Returns the identifiers of the items in their default order.
void StyledBarItemGroup::removeItem(const Utils::Key &id)
Removes the item id from the group and deletes its widget.
void StyledBarItemGroup::setItemVisible(const Utils::Key &id, bool visible)
Shows or hides the item id depending on visible. An item the user has hidden stays hidden.
void StyledBarItemGroup::setPermanentItems(const Utils::KeyList &ids)
Prevents the user from hiding the items with the identifiers ids.
QWidget *StyledBarItemGroup::widget(const Utils::Key &id) const
Returns the widget of the item id, or nullptr if there is none.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.