Omnidome
Fulldome Mapping Software Toolkit
|
Tuning Layout Similar to VBoxLayout, except that widgets with a PREVIEW Role have a size with aspect ratio of associated tuning. More...
#include <TuningLayout.h>
Data Structures | |
struct | ItemWrapper |
Public Types | |
enum | Role { Role::TITLE, Role::PARAMETER, Role::PREVIEW } |
Role of a widget defines resize behaviour. More... | |
typedef std::vector< std::pair < QWidget *, Role > > | widgetgroup_type |
Public Member Functions | |
TuningLayout (Tuning *parent) | |
~TuningLayout () | |
void | addItem (QLayoutItem *item) |
Add item, with PARAMETER Role. More... | |
void | addWidget (QWidget *widget) |
Add widget with PARAMETER Role. More... | |
void | addWidget (QWidget *widget, Role) |
Add widget with Role. More... | |
int | count () const |
Return number of widgets. More... | |
int | indexOf (QWidget *widget) const |
Get index of given widget. More... | |
QLayoutItem * | itemAt (int index) const |
Return item at index. More... | |
QLayoutItem * | takeAt (int index) |
Remove widget at index. More... | |
void | setGeometry (const QRect &rect) |
Set geometry of all widgets. More... | |
QRect | geometry () const |
void | setWidgets (widgetgroup_type const &_widgets) |
Clears layout and inserts the given widgets. More... | |
void | clear () |
Clear layout. More... | |
QSize | minimumSize () const |
Return minimum size. More... | |
QSize | sizeHint () const |
Return size hint, is equal to minimum size. More... | |
Private Types | |
enum | SizeType { MINIMUMSIZE, SIZEHINT } |
Private Member Functions | |
omni::proj::Tuning * | tuning () |
omni::proj::Tuning const * | tuning () const |
void | add (QLayoutItem *_item, Role _role) |
Add a layout item with Role. More... | |
QSize | calculateSize (SizeType sizeType) const |
Private Attributes | |
std::vector< ItemWrapper > | items_ |
Tuning Layout Similar to VBoxLayout, except that widgets with a PREVIEW Role have a size with aspect ratio of associated tuning.
typedef std::vector<std::pair<QWidget *, Role> > omni::ui::proj::TuningLayout::widgetgroup_type |
|
strong |
|
private |
omni::ui::proj::TuningLayout::TuningLayout | ( | Tuning * | parent | ) |
omni::ui::proj::TuningLayout::~TuningLayout | ( | ) |
|
private |
Add a layout item with Role.
void omni::ui::proj::TuningLayout::addItem | ( | QLayoutItem * | item | ) |
Add item, with PARAMETER Role.
void omni::ui::proj::TuningLayout::addWidget | ( | QWidget * | widget | ) |
Add widget with PARAMETER Role.
void omni::ui::proj::TuningLayout::addWidget | ( | QWidget * | widget, |
Role | _role | ||
) |
Add widget with Role.
|
private |
Increase height by aspect ratio
void omni::ui::proj::TuningLayout::clear | ( | ) |
Clear layout.
int omni::ui::proj::TuningLayout::count | ( | ) | const |
Return number of widgets.
QRect omni::ui::proj::TuningLayout::geometry | ( | ) | const |
int omni::ui::proj::TuningLayout::indexOf | ( | QWidget * | widget | ) | const |
Get index of given widget.
QLayoutItem * omni::ui::proj::TuningLayout::itemAt | ( | int | index | ) | const |
Return item at index.
QSize omni::ui::proj::TuningLayout::minimumSize | ( | ) | const |
Return minimum size.
void omni::ui::proj::TuningLayout::setGeometry | ( | const QRect & | rect | ) |
Set geometry of all widgets.
Adjust geometry for each widget
Widget height is constant except for preview
Increase height
void omni::ui::proj::TuningLayout::setWidgets | ( | widgetgroup_type const & | _widgets | ) |
Clears layout and inserts the given widgets.
QSize omni::ui::proj::TuningLayout::sizeHint | ( | ) | const |
Return size hint, is equal to minimum size.
QLayoutItem * omni::ui::proj::TuningLayout::takeAt | ( | int | index | ) |
Remove widget at index.
|
private |
|
private |
|
private |