OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::Positioning Class Reference

#include "Positioning.h"

Static Public Member Functions

static QRect calculateChildRect (const QRect &_parentRect, const QSize &_childSize, ot::Alignment _childAlignment)
 Calculates the child rect.
 
static QRectF calculateChildRect (const QRectF &_parentRect, const QSizeF &_childSize, ot::Alignment _childAlignment)
 Calculates the child rect.
 
static QRect fitOnScreen (const QRect &_sourceRect, bool _primaryScreenOnly=false)
 Fits the provided rect on the screen. If the source rect is bigger than the screen size the source rect will be returned.
 
static bool centerWidgetOnParent (const QWidgetInterface *_parentWidget, QWidgetInterface *_childWidget)
 Gets the widgets from the provided interfaces and calls centerWidgetOnParent(const QWidget*, QWidget*). centerWidgetOnParent(const QWidget*, QWidget*)
 
static bool centerWidgetOnParent (const QWidget *_parentWidget, QWidget *_childWidget)
 Centers this widget on the parent. If no parent is provided the widget will center on the primay screen. The size of the child won't be affected.
 
static QRect getCenterWidgetOnParentRect (const QWidgetInterface *_parentWidget, QWidgetInterface *_childWidget)
 Gets the widgets from the provided interfaces and calls getCenterWidgetOnParentRect(const QWidget*, QWidget*). getCenterWidgetOnParentRect(const QWidget*, QWidget*)
 
static QRect getCenterWidgetOnParentRect (const QWidget *_parentWidget, QWidget *_childWidget)
 Calculates the top left corner of this widget centered on the parent widget. If no parent is provided the widget will center on the screen.
 

Member Function Documentation

◆ calculateChildRect() [1/2]

QRect ot::Positioning::calculateChildRect ( const QRect & _parentRect,
const QSize & _childSize,
ot::Alignment _childAlignment )
static

Calculates the child rect.

Parameters
_parentRectParent rectangle.
_childSizeChild size.
_childAlignmentChild alignment.

◆ calculateChildRect() [2/2]

QRectF ot::Positioning::calculateChildRect ( const QRectF & _parentRect,
const QSizeF & _childSize,
ot::Alignment _childAlignment )
static

Calculates the child rect.

Parameters
_parentRectParent rectangle.
_childSizeChild size.
_childAlignmentChild alignment.

◆ centerWidgetOnParent() [1/2]

bool ot::Positioning::centerWidgetOnParent ( const QWidget * _parentWidget,
QWidget * _childWidget )
static

Centers this widget on the parent. If no parent is provided the widget will center on the primay screen. The size of the child won't be affected.

◆ centerWidgetOnParent() [2/2]

bool ot::Positioning::centerWidgetOnParent ( const QWidgetInterface * _parentWidget,
QWidgetInterface * _childWidget )
static

◆ fitOnScreen()

QRect ot::Positioning::fitOnScreen ( const QRect & _sourceRect,
bool _primaryScreenOnly = false )
static

Fits the provided rect on the screen. If the source rect is bigger than the screen size the source rect will be returned.

Parameters
_sourceRectInitial rect.
_primaryScreenOnlyIf true the source rect will be fitted onto the primary screen only, otherwise on any screen.

◆ getCenterWidgetOnParentRect() [1/2]

QRect ot::Positioning::getCenterWidgetOnParentRect ( const QWidget * _parentWidget,
QWidget * _childWidget )
static

Calculates the top left corner of this widget centered on the parent widget. If no parent is provided the widget will center on the screen.

◆ getCenterWidgetOnParentRect() [2/2]

QRect ot::Positioning::getCenterWidgetOnParentRect ( const QWidgetInterface * _parentWidget,
QWidgetInterface * _childWidget )
static

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