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 &&)
 
QColumnLayoutoperator= (QColumnLayout const &other)
 
QColumnLayoutoperator= (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

unity::scopes::qt::QColumnLayout::QColumnLayout ( int  num_of_columns)
explicit

Creates a layout definition that expects num_of_columns columns to be added with ColumnLayout::add_column.

Parameters
num_of_columnsThe number of columns for the layout.
Exceptions
unity::InvalidArgumentExceptionfor 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::LogicExceptionif an attempt is made to add more columns than specified in the constructor.
unity::LogicExceptionfrom 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
indexThe index of a column.
Returns
The widget identifiers for the given column index.
Exceptions
unity::InvalidArgumentExceptionif the index is invalid.
int unity::scopes::qt::QColumnLayout::number_of_columns ( ) const
noexcept

Get the number of columns expected by this layout as specified in the constructor.

Returns
The number of columns expected by this layout.
int unity::scopes::qt::QColumnLayout::size ( ) const
noexcept

Get the current number of columns in this layout.

Returns
The number of columns added with add_column().