libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
TuiGridLayout Class Reference

Grid layout with rows and columns. More...

#include <layout.h>

Inheritance diagram for TuiGridLayout:
Collaboration diagram for TuiGridLayout:

Public Member Functions

 TuiGridLayout (ObjectBase *parent=nullptr)
 
void addWidget (TuiWidget *widget, int row, int col, int rowSpan=1, int colSpan=1)
 Adds a widget at the given row/column with optional span.
 
void setRowStretch (int row, int factor)
 Sets the stretch factor for a row.
 
void setColumnStretch (int col, int factor)
 Sets the stretch factor for a column.
 
void setRowMinimumHeight (int row, int height)
 Sets the minimum height for a row.
 
void setColumnMinimumWidth (int col, int width)
 Sets the minimum width for a column.
 
void calculateLayout (const Rect2Di32 &available) override
 Calculates and applies the layout.
 
- Public Member Functions inherited from TuiLayout
 TuiLayout (ObjectBase *parent=nullptr)
 
virtual void addWidget (TuiWidget *widget)
 Adds a widget to this layout.
 
void removeWidget (TuiWidget *widget)
 Removes a widget from this layout.
 
virtual void addLayout (TuiLayout *layout)
 Adds a nested layout.
 
void setMargins (int top, int right, int bottom, int left)
 Sets the margins (top, right, bottom, left).
 
void setMargins (int margin)
 Sets uniform margins.
 
void setSpacing (int spacing)
 Sets the spacing between items.
 
int spacing () const
 Returns the spacing.
 
void margins (int &top, int &right, int &bottom, int &left) const
 Returns the margins.
 
virtual Size2Di32 sizeHint () const
 Returns the preferred size for this layout based on its children.
 
const List< TuiWidget * > & widgets () const
 Returns the list of managed widgets.
 
const List< TuiLayout * > & layouts () const
 Returns the list of sub-layouts.
 
- Public Member Functions inherited from ObjectBase
 ObjectBase (ObjectBase *p=nullptr)
 Default ObjectBase constructor.
 
virtual ~ObjectBase ()
 Destructor. Emits aboutToDestroy, detaches from parent, and destroys children.
 
ObjectBaseparent () const
 Returns the parent object, if one. nullptr if none.
 
void setParent (ObjectBase *p)
 Sets the parent of this object. If the object already has a parent, it will be removed as a child from the old parent and added as a child to the new one.
 
const ObjectBaseListchildList () const
 Returns a list of children of this object.
 
template<typename... Args>
int registerSlot (Slot< Args... > *slot)
 Registers a slot with this object and assigns it an ID.
 
EventLoopeventLoop () const
 Returns the EventLoop this object is affiliated with.
 
void moveToThread (EventLoop *loop)
 Changes the EventLoop affinity of this object.
 
int startTimer (unsigned int intervalMs, bool singleShot=false)
 Starts a timer on this object's EventLoop.
 
void stopTimer (int timerId)
 Stops a timer previously started with startTimer().
 
template<typename... Args>
PROMEKI_NAMESPACE_BEGIN void connect (Signal< Args... > *signal, Slot< Args... > *slot)
 

Additional Inherited Members

- Public Types inherited from ObjectBase
using SlotVariantFunc = std::function< void(const VariantList &)>
 Function type for invoking a slot with a list of Variants.
 
- Static Public Member Functions inherited from ObjectBase
static const MetaInfometaInfo ()
 Returns the MetaInfo for the ObjectBase class.
 
template<typename... Args>
static void connect (Signal< Args... > *signal, Slot< Args... > *slot)
 connects a signal and slot together. This function assumes both the signal and slot exist in a ObjectBase or derived object
 
- Public Attributes inherited from ObjectBase
Signal< ObjectBase * > aboutToDestroySignal = Signal< ObjectBase * >(this, aboutToDestroySignalName)
 
- Static Public Attributes inherited from ObjectBase
static constexpr const charaboutToDestroySignalName = PROMEKI_STRINGIFY( aboutToDestroy ) "(" PROMEKI_STRINGIFY_ARGS( ObjectBase * ) ")"
 
static SignalMeta aboutToDestroySignalMeta = SignalMeta(metaInfo(), aboutToDestroySignalName)
 
- Protected Member Functions inherited from TuiLayout
Rect2Di32 contentRect (const Rect2Di32 &available) const
 Returns the content rect after subtracting margins.
 
- Protected Member Functions inherited from ObjectBase
ObjectBasesignalSender ()
 Returns the ObjectBase that emitted the signal currently being handled.
 
virtual void event (Event *e)
 Called by EventLoop to deliver events to this object.
 
virtual void timerEvent (TimerEvent *e)
 Called when a timer fires for this object.
 
- Protected Attributes inherited from TuiLayout
List< TuiWidget * > _widgets
 
List< TuiLayout * > _layouts
 

Detailed Description

Grid layout with rows and columns.

Member Function Documentation

◆ calculateLayout()

void TuiGridLayout::calculateLayout ( const Rect2Di32 available)
overridevirtual

Calculates and applies the layout.

Implements TuiLayout.


The documentation for this class was generated from the following file: