|
Krita Source Code Documentation
|
Class providing a list of widgets with some addons such as separators, orientation or individual widget visibility. More...
#include <KisOptionCollectionWidget.h>
Inheritance diagram for KisOptionCollectionWidget:Classes | |
| struct | Private |
Public Member Functions | |
| void | appendWidget (const QString &id, QWidget *widget) |
| Insert the given widget with the given id at the end of the list. The list widget takes ownership of the inserted widget. | |
| bool | containsWidget (const QString &id) const |
| Get if the list contains a widget with the given id. | |
| QWidget * | findWidget (const QString &path) const |
| Get the widget that is at the given path. The path must be a forward slash separated list of ids. If the list contains some other KisOptionCollectionWidget or KisOptionCollectionWidgetWithHeader, and they do as well, then they form a hierarchy tree, so the path is searched recursively through all those child widgets. | |
| template<typename T > | |
| T | findWidgetAs (const QString &path) const |
| Get the widget that is at the given path casted to some other class. | |
| void | insertWidget (int index, const QString &id, QWidget *widget) |
| Insert the given widget with the given id at the given position. The list widget takes ownership of the inserted widget. | |
| KisOptionCollectionWidget (QWidget *parent=nullptr) | |
| int | numberOfVisibleWidgets () const |
| Get the number of visible widgets in the list. | |
| void | removeWidget (const QString &id) |
| Remove the widget that has the given id from the list. This also destroys the widget. | |
| void | removeWidget (int index) |
| Remove the widget that is at the given position from the list. This also destroys the widget. | |
| void | setOrientation (Qt::Orientation orientation, bool recursive=false) |
| Set the orientation of the list of widgets. | |
| void | setSeparatorsVisible (bool visible) |
| Set the visibility of the separators. | |
| void | setWidgetsMargin (int margin) |
| Set the margins of the widgets. This allows to indent the widgets with respect to the separators. The separators themselves are not changed. | |
| void | setWidgetVisible (const QString &id, bool visible) |
| Set the visibility of the widget that has the given id. Use this function instead of the widget's one directly to get better visual results. | |
| void | setWidgetVisible (int index, bool visible) |
| Set the visibility of the widget that is at the given position. Use this function instead of the widget's one directly to get better visual results. | |
| int | size () const |
| Get the number of widgets in the list. | |
| QWidget * | takeWidget (const QString &id) |
| Remove the widget that has the given id from the list. The widget is returned instead of being destroyed. | |
| QWidget * | takeWidget (int index) |
| Remove the widget that is at the given position from the list. The widget is returned instead of being destroyed. | |
| QWidget * | widget (const QString &id) const |
| Get the widget with the given id. | |
| QWidget * | widget (int index) const |
| Get the widget that is at the given position. | |
| template<typename T > | |
| T | widgetAs (const QString &id) const |
| Get the widget with the given id casted to some other class. | |
| template<typename T > | |
| T | widgetAs (int index) const |
| Get the widget that is at the given position casted to some other class. | |
| int | widgetIndexFromId (const QString &id) const |
| Get the index of the widget that has the given id. | |
| ~KisOptionCollectionWidget () override | |
Private Attributes | |
| QScopedPointer< Private > | m_d |
Class providing a list of widgets with some addons such as separators, orientation or individual widget visibility.
Definition at line 19 of file KisOptionCollectionWidget.h.
| KisOptionCollectionWidget::KisOptionCollectionWidget | ( | QWidget * | parent = nullptr | ) |
Definition at line 304 of file KisOptionCollectionWidget.cpp.
|
override |
Definition at line 314 of file KisOptionCollectionWidget.cpp.
| void KisOptionCollectionWidget::appendWidget | ( | const QString & | id, |
| QWidget * | widget ) |
Insert the given widget with the given id at the end of the list. The list widget takes ownership of the inserted widget.
Definition at line 350 of file KisOptionCollectionWidget.cpp.
References insertWidget(), m_d, and widget().
| bool KisOptionCollectionWidget::containsWidget | ( | const QString & | id | ) | const |
Get if the list contains a widget with the given id.
Definition at line 322 of file KisOptionCollectionWidget.cpp.
References m_d.
| QWidget * KisOptionCollectionWidget::findWidget | ( | const QString & | path | ) | const |
Get the widget that is at the given path. The path must be a forward slash separated list of ids. If the list contains some other KisOptionCollectionWidget or KisOptionCollectionWidgetWithHeader, and they do as well, then they form a hierarchy tree, so the path is searched recursively through all those child widgets.
Definition at line 337 of file KisOptionCollectionWidget.cpp.
References m_d.
|
inline |
Get the widget that is at the given path casted to some other class.
Definition at line 76 of file KisOptionCollectionWidget.h.
| void KisOptionCollectionWidget::insertWidget | ( | int | index, |
| const QString & | id, | ||
| QWidget * | widget ) |
Insert the given widget with the given id at the given position. The list widget takes ownership of the inserted widget.
Definition at line 342 of file KisOptionCollectionWidget.cpp.
References containsWidget(), m_d, and widget().
| int KisOptionCollectionWidget::numberOfVisibleWidgets | ( | ) | const |
Get the number of visible widgets in the list.
Definition at line 469 of file KisOptionCollectionWidget.cpp.
| void KisOptionCollectionWidget::removeWidget | ( | const QString & | id | ) |
Remove the widget that has the given id from the list. This also destroys the widget.
Definition at line 360 of file KisOptionCollectionWidget.cpp.
References removeWidget(), and widgetIndexFromId().
| void KisOptionCollectionWidget::removeWidget | ( | int | index | ) |
Remove the widget that is at the given position from the list. This also destroys the widget.
Definition at line 355 of file KisOptionCollectionWidget.cpp.
References takeWidget().
| void KisOptionCollectionWidget::setOrientation | ( | Qt::Orientation | orientation, |
| bool | recursive = false ) |
Set the orientation of the list of widgets.
| recursive | If set to true and the list contains some KisOptionCollectionWidget or KisOptionCollectionWidgetWithHeader, then the orientation of those child widgets is also set, with the same recursive value |
Definition at line 438 of file KisOptionCollectionWidget.cpp.
References m_d, setOrientation(), and KisOptionCollectionWidgetWithHeader::setOrientation().
| void KisOptionCollectionWidget::setSeparatorsVisible | ( | bool | visible | ) |
Set the visibility of the separators.
Definition at line 427 of file KisOptionCollectionWidget.cpp.
References m_d.
| void KisOptionCollectionWidget::setWidgetsMargin | ( | int | margin | ) |
Set the margins of the widgets. This allows to indent the widgets with respect to the separators. The separators themselves are not changed.
Definition at line 416 of file KisOptionCollectionWidget.cpp.
References m_d.
| void KisOptionCollectionWidget::setWidgetVisible | ( | const QString & | id, |
| bool | visible ) |
Set the visibility of the widget that has the given id. Use this function instead of the widget's one directly to get better visual results.
Definition at line 411 of file KisOptionCollectionWidget.cpp.
References setWidgetVisible(), and widgetIndexFromId().
| void KisOptionCollectionWidget::setWidgetVisible | ( | int | index, |
| bool | visible ) |
Set the visibility of the widget that is at the given position. Use this function instead of the widget's one directly to get better visual results.
Definition at line 379 of file KisOptionCollectionWidget.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN, m_d, and widgetIndexFromId().
| int KisOptionCollectionWidget::size | ( | ) | const |
Get the number of widgets in the list.
Definition at line 464 of file KisOptionCollectionWidget.cpp.
References m_d.
| QWidget * KisOptionCollectionWidget::takeWidget | ( | const QString & | id | ) |
Remove the widget that has the given id from the list. The widget is returned instead of being destroyed.
Definition at line 374 of file KisOptionCollectionWidget.cpp.
References takeWidget(), and widgetIndexFromId().
| QWidget * KisOptionCollectionWidget::takeWidget | ( | int | index | ) |
Remove the widget that is at the given position from the list. The widget is returned instead of being destroyed.
Definition at line 365 of file KisOptionCollectionWidget.cpp.
| QWidget * KisOptionCollectionWidget::widget | ( | const QString & | id | ) | const |
Get the widget with the given id.
Definition at line 332 of file KisOptionCollectionWidget.cpp.
References m_d.
| QWidget * KisOptionCollectionWidget::widget | ( | int | index | ) | const |
Get the widget that is at the given position.
Definition at line 327 of file KisOptionCollectionWidget.cpp.
References m_d.
|
inline |
Get the widget with the given id casted to some other class.
Definition at line 57 of file KisOptionCollectionWidget.h.
|
inline |
Get the widget that is at the given position casted to some other class.
Definition at line 44 of file KisOptionCollectionWidget.h.
| int KisOptionCollectionWidget::widgetIndexFromId | ( | const QString & | id | ) | const |
Get the index of the widget that has the given id.
Definition at line 317 of file KisOptionCollectionWidget.cpp.
References m_d.
|
private |
Definition at line 157 of file KisOptionCollectionWidget.h.