unity.scopes.qt.QColumnLayout
Represents a column layout. More...
#include <unity/scopes/qt/QColumnLayout.h>
Public Member Functions | |
QColumnLayout (int num_of_columns) | |
Creates a layout definition that expects num_of_columns columns to be added with ColumnLayout::add_column. More... | |
void | add_column (QVector< QString > widget_ids) |
Adds a new column and assigns widgets to it. More... | |
int | size () const noexcept |
Get the current number of columns in this layout. More... | |
int | number_of_columns () const noexcept |
Get the number of columns expected by this layout as specified in the constructor. More... | |
QVector< QString > | column (int index) const |
Retrieve the list of widgets for given column. More... | |
Copy and assignment | |
Copy and assignment operators (move and non-move versions) have the usual value semantics. | |
QColumnLayout (QColumnLayout const &other) | |
QColumnLayout (QColumnLayout &&) | |
QColumnLayout & | operator= (QColumnLayout const &other) |
QColumnLayout & | operator= (QColumnLayout &&) |
Detailed Description
Represents a column layout.
Column layouts are used to represent the view in different ways depending on the device we are running our application.
If, for example, you run the application in a tablet that has more screen the application could use more columns than running in a phone.
Constructor & Destructor Documentation
|
explicit |
Creates a layout definition that expects num_of_columns columns to be added with ColumnLayout::add_column.
- Parameters
-
num_of_columns The number of columns for the layout.
- Exceptions
-
unity::InvalidArgumentException for an invalid number of columns.
Member Function Documentation
void unity::scopes::qt::QColumnLayout::add_column | ( | QVector< QString > | widget_ids | ) |
Adds a new column and assigns widgets to it.
ColumnLayout expects exactly the number of columns passed to the constructor to be created with the add_column method.
- Exceptions
-
unity::LogicException if an attempt is made to add more columns than specified in the constructor. unity::LogicException from unity::scopes::qt::QPreviewReply::register_layout if a layout has fewer columns than specified in the constructor.
QVector<QString> unity::scopes::qt::QColumnLayout::column | ( | int | index | ) | const |
Retrieve the list of widgets for given column.
- Parameters
-
index The index of a column.
- Returns
- The widget identifiers for the given column index.
- Exceptions
-
unity::InvalidArgumentException if the index is invalid.
|
noexcept |
Get the number of columns expected by this layout as specified in the constructor.
- Returns
- The number of columns expected by this layout.
|
noexcept |
Get the current number of columns in this layout.
- Returns
- The number of columns added with add_column().