OpenWalnut
1.5.0dev
|
Implementation of WUIGridWidget. More...
#include <WUIQtGridWidget.h>
Public Types | |
typedef std::shared_ptr< WUIQtGridWidget > | SPtr |
Convenience typedef for a std::shared_ptr< WUIQtGridWidget >. More... | |
typedef std::shared_ptr< const WUIQtGridWidget > | ConstSPtr |
Convenience typedef for a std::shared_ptr< const WUIQtGridWidget >. More... | |
Public Types inherited from WUIGridWidget | |
typedef std::shared_ptr< WUIGridWidget > | SPtr |
Convenience typedef for a std::shared_ptr< WUIGridWidget >. More... | |
typedef std::shared_ptr< const WUIGridWidget > | ConstSPtr |
Convenience typedef for a std::shared_ptr< const WUIGridWidget >. More... | |
Public Types inherited from WUIWidgetBase | |
typedef std::shared_ptr< WUIWidgetBase > | SPtr |
Convenience typedef for a std::shared_ptr< WUIWidgetBase >. More... | |
typedef std::shared_ptr< const WUIWidgetBase > | ConstSPtr |
Convenience typedef for a std::shared_ptr< const WUIWidgetBase >. More... | |
Public Types inherited from WUIQtWidgetBase | |
typedef std::shared_ptr< WUIQtWidgetBase > | SPtr |
Convenience typedef for a std::shared_ptr< WUIQtWidgetBase >. More... | |
typedef std::shared_ptr< const WUIQtWidgetBase > | ConstSPtr |
Convenience typedef for a std::shared_ptr< const WUIQtWidgetBase >. More... | |
Public Member Functions | |
WUIQtGridWidget (std::string title, WMainWindow *mainWindow, WUIQtWidgetBase::SPtr parent=WUIQtWidgetBase::SPtr()) | |
Default constructor. More... | |
virtual | ~WUIQtGridWidget () |
Destructor. More... | |
virtual QString | getTitleQString () const |
Title as QString. More... | |
virtual void | show () |
Show this widget if not yet visible. More... | |
virtual void | setVisible (bool visible=true) |
Hide/show this widget. More... | |
virtual bool | isVisible () const |
Check if the widget is hidden or not. More... | |
virtual void | close () |
Handle shutdown. More... | |
virtual void | setRowStretch (int row, int stretch) |
Sets the stretch factor of a row to stretch. More... | |
virtual void | setColumnStretch (int column, int stretch) |
Sets the stretch factor of a column to stretch. More... | |
virtual void | addAction (WPropGroup group, WGEImage::SPtr icon=WGEImage::SPtr()) |
Implement WUIWidgetBase::addAction. More... | |
virtual void | addAction (WPropTrigger trigger, WGEImage::SPtr icon=WGEImage::SPtr()) |
Implement WUIWidgetBase::addAction. More... | |
virtual void | addAction (WPropBool toggle, WGEImage::SPtr icon=WGEImage::SPtr()) |
Implement WUIWidgetBase::addAction. More... | |
Public Member Functions inherited from WUIGridWidget | |
virtual | ~WUIGridWidget () |
Destructor. More... | |
virtual bool | allowNesting () const |
Tell the user whether this kind of widget can be used as parent. More... | |
virtual void | placeWidget (WUIWidgetBase::SPtr widget, int x, int y) |
Place the given widget in this grid at the given coordinates. More... | |
Public Member Functions inherited from WUIWidgetBase | |
virtual | ~WUIWidgetBase () |
Destructor. More... | |
virtual std::string | getTitle () const |
Get the title of the widget. More... | |
void | close () |
Close the widget. More... | |
bool | isClosed () const |
Checks whether the widget was closed already. More... | |
WCondition::SPtr | getCloseCondition () const |
Return the condition that fires when the widgets closes. More... | |
virtual WUIWidgetBase::SPtr | getParent () const |
Get the parent widget of this widget if any. More... | |
Public Member Functions inherited from WUIQtWidgetBase | |
WUIQtWidgetBase (WMainWindow *mainWindow, WUIQtWidgetBase::SPtr parent) | |
Default constructor. More... | |
virtual | ~WUIQtWidgetBase () |
Destructor. More... | |
virtual bool | isReal () |
The widget was created and can be used. More... | |
virtual void | realize (WCondition::SPtr abortCondition=WCondition::SPtr()) |
Realize the widget. More... | |
QWidget * | getWidget () const |
Get the widget representation. More... | |
QWidget * | getParentAsQtWidget () const |
Get the parent as Qt widget. More... | |
WUIQtWidgetBase::SPtr | getQtParent () const |
Parent widget. More... | |
Protected Member Functions | |
virtual void | realizeImpl () |
Realize the widget. More... | |
virtual void | closeImpl () |
Close the widget. More... | |
virtual void | cleanUpGT () |
Cleanup the GUI. More... | |
virtual void | placeWidgetImpl (WUIWidgetBase::SPtr widget, int x, int y) |
Place the given widget in this grid at the given coordinates. More... | |
virtual void | placeWidgetImplGT (QWidget *widget, int x, int y) |
Place the given widget in this grid at the given coordinates. More... | |
Protected Member Functions inherited from WUIGridWidget | |
WUIGridWidget (std::string title) | |
Default constructor. More... | |
Protected Member Functions inherited from WUIWidgetBase | |
WUIWidgetBase (std::string title) | |
Default constructor. More... | |
virtual void | setParent (WUIWidgetBase::SPtr parent) |
Set the parent of this WUI widget. More... | |
virtual void | registerChild (WUIWidgetBase::SPtr child) |
Register widget as child. More... | |
ChildContainer & | getChildren () |
Return the list of children. More... | |
const ChildContainer & | getChildren () const |
Return the list of children. More... | |
void | closeChildren () |
Comfortable function to recurse a close call. More... | |
Protected Member Functions inherited from WUIQtWidgetBase | |
virtual void | showGT () |
Show this widget if not yet visible. More... | |
virtual void | setVisibleGT (bool visible=true) |
Hide/show this widget. More... | |
virtual bool | isVisibleGT () const |
Check if the widget is hidden or not. More... | |
virtual void | closeGT () |
Close the widget. More... | |
QWidget * | getCompellingQParent () const |
Returns the parent to use for your implementation in realizeImpl. More... | |
bool | hasUIParent () const |
Check if the widget is embedded into another WUI widget. More... | |
QWidget * | embedContent (QWidget *content) |
This method can be used if you just create some QWidget and do not want to take care about embedding the content in a dock if there is no parent, setting size constraints and similar. More... | |
virtual void | addActionGroupGT (WPropGroup group, WGEImage::SPtr icon=WGEImage::SPtr()) |
Implement WUIWidgetBase::addAction. More... | |
virtual void | addActionTriggerGT (WPropTrigger trigger, WGEImage::SPtr icon=WGEImage::SPtr()) |
Implement WUIWidgetBase::addAction. More... | |
virtual void | addActionBoolGT (WPropBool toggle, WGEImage::SPtr icon=WGEImage::SPtr()) |
Implement WUIWidgetBase::addAction. More... | |
Private Attributes | |
QGridLayout * | m_gridLayout |
The grid used for managing child widgets. More... | |
Additional Inherited Members | |
Protected Types inherited from WUIWidgetBase | |
typedef WSharedSequenceContainer< std::vector< WUIWidgetBase::SPtr > > | ChildContainer |
Keep track of our child widgets. More... | |
Protected Attributes inherited from WUIQtWidgetBase | |
WMainWindow * | m_mainWindow |
The main window instance. More... | |
QWidget * | m_widget |
The widget representing this abstract UI element. More... | |
WUIQtWidgetBase::SPtr | m_parent |
Parent widget. More... | |
Implementation of WUIGridWidget.
Definition at line 40 of file WUIQtGridWidget.h.
typedef std::shared_ptr< const WUIQtGridWidget > WUIQtGridWidget::ConstSPtr |
Convenience typedef for a std::shared_ptr< const WUIQtGridWidget >.
Definition at line 52 of file WUIQtGridWidget.h.
typedef std::shared_ptr< WUIQtGridWidget > WUIQtGridWidget::SPtr |
Convenience typedef for a std::shared_ptr< WUIQtGridWidget >.
Definition at line 47 of file WUIQtGridWidget.h.
WUIQtGridWidget::WUIQtGridWidget | ( | std::string | title, |
WMainWindow * | mainWindow, | ||
WUIQtWidgetBase::SPtr | parent = WUIQtWidgetBase::SPtr() |
||
) |
Default constructor.
mainWindow | the main window instance |
parent | the Qt parent. Can be NULL. |
title | the title of the widget |
Definition at line 34 of file WUIQtGridWidget.cpp.
|
virtual |
Destructor.
Definition at line 45 of file WUIQtGridWidget.cpp.
|
inlinevirtual |
Implement WUIWidgetBase::addAction.
toggle | the property to use. |
icon | the icon to use. Consider a minimum size of 32x32. |
Reimplemented from WUIQtWidgetBase.
Definition at line 151 of file WUIQtGridWidget.h.
References WUIQtWidgetBase::addAction().
|
inlinevirtual |
Implement WUIWidgetBase::addAction.
group | the property to use. |
icon | the icon to use. Consider a minimum size of 32x32. |
Reimplemented from WUIQtWidgetBase.
Definition at line 129 of file WUIQtGridWidget.h.
References WUIQtWidgetBase::addAction().
|
inlinevirtual |
Implement WUIWidgetBase::addAction.
trigger | the property to use. |
icon | the icon to use. Consider a minimum size of 32x32. |
Reimplemented from WUIQtWidgetBase.
Definition at line 140 of file WUIQtGridWidget.h.
References WUIQtWidgetBase::addAction().
|
protectedvirtual |
Cleanup the GUI.
Do not delete m_widget, or your content widget. This is done by WUIQtWidgetBase. This method allows you to free resources that are not automatically freed by the Qt delete mechanism.
Implements WUIQtWidgetBase.
Definition at line 70 of file WUIQtGridWidget.cpp.
|
virtual |
Handle shutdown.
This includes notification of the creating module and closing the widget. Can be called from any thread. Implement in your implementation.
Implements WUIQtWidgetBase.
Definition at line 75 of file WUIQtGridWidget.cpp.
References WUIWidgetBase::close().
|
protectedvirtual |
Close the widget.
When done, the widget can be safely deleted.
Reimplemented from WUIQtWidgetBase.
Definition at line 81 of file WUIQtGridWidget.cpp.
References WUIQtWidgetBase::closeImpl().
|
virtual |
Title as QString.
Implements WUIQtWidgetBase.
Definition at line 50 of file WUIQtGridWidget.cpp.
References WUIWidgetBase::getTitle().
|
virtual |
Check if the widget is hidden or not.
Reimplemented from WUIQtWidgetBase.
Definition at line 65 of file WUIQtGridWidget.cpp.
References WUIQtWidgetBase::isVisible().
|
protectedvirtual |
Place the given widget in this grid at the given coordinates.
The widget to be placed must be created with this grid as parent.
widget | the widget |
x | x coord ( 0 is left ) |
y | y coord ( 0 is top ) |
Implements WUIGridWidget.
Definition at line 105 of file WUIQtGridWidget.cpp.
References WQtGui::execInGUIThread(), WUIQtWidgetBase::getWidget(), and placeWidgetImplGT().
|
protectedvirtual |
Place the given widget in this grid at the given coordinates.
The widget to be placed must be created with this grid as parent. GUI thread version.
widget | the widget |
x | x coord ( 0 is left ) |
y | y coord ( 0 is top ) |
Definition at line 122 of file WUIQtGridWidget.cpp.
References m_gridLayout.
Referenced by placeWidgetImpl().
|
protectedvirtual |
Realize the widget.
This method blocks until the GUI thread created the widget. Called from within the GUI thread! So you can safely do Qt stuff.
Implements WUIQtWidgetBase.
Definition at line 87 of file WUIQtGridWidget.cpp.
References WUIQtWidgetBase::embedContent(), WUIQtWidgetBase::getCompellingQParent(), m_gridLayout, and WUIQtWidgetBase::m_widget.
|
virtual |
Sets the stretch factor of a column to stretch.
The first column is number 0. The stretch factor is relative to the other columns in this grid. Columns with a higher stretch factor take more of the available space. The default stretch factor is 0. If the stretch factor is 0 and no other column in this table can grow at all, the column may still grow.
column | the column to set this value for |
stretch | the stretch |
Implements WUIGridWidget.
Definition at line 138 of file WUIQtGridWidget.cpp.
References WQtGui::execInGUIThread(), and m_gridLayout.
|
virtual |
Sets the stretch factor of a row to stretch.
The first row is number 0. The stretch factor is relative to the other rows in this grid. Rows with a higher stretch factor take more of the available space. The default stretch factor is 0. If the stretch factor is 0 and no other row in this table can grow at all, the row may still grow.
row | the row to set this value for |
stretch | the stretch |
Implements WUIGridWidget.
Definition at line 130 of file WUIQtGridWidget.cpp.
References WQtGui::execInGUIThread(), and m_gridLayout.
|
virtual |
Hide/show this widget.
Unlike close(), you can show the widget again using show().
visible | false to hide widget |
Reimplemented from WUIQtWidgetBase.
Definition at line 60 of file WUIQtGridWidget.cpp.
References WUIQtWidgetBase::setVisible().
|
virtual |
Show this widget if not yet visible.
Reimplemented from WUIQtWidgetBase.
Definition at line 55 of file WUIQtGridWidget.cpp.
References WUIQtWidgetBase::show().
|
private |
The grid used for managing child widgets.
Definition at line 195 of file WUIQtGridWidget.h.
Referenced by placeWidgetImplGT(), realizeImpl(), setColumnStretch(), and setRowStretch().