Commit 2110b95b authored by ledig's avatar ledig

[ADD] global defines for marging and spacing of layouts in WPropertyWidgets

parent dcc4d090
......@@ -24,6 +24,7 @@
#include "WPropertyBoolWidget.h"
#include "../WGuiConsts.h"
#include "../../../common/WPropertyVariable.h"
WPropertyBoolWidget::WPropertyBoolWidget( WPropBool property, QGridLayout* propertyGrid, QWidget* parent ):
......@@ -39,10 +40,14 @@ WPropertyBoolWidget::WPropertyBoolWidget( WPropBool property, QGridLayout* prope
// layout both against each other
m_layout.addWidget( static_cast< QWidget* >( &m_checkbox ) );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
m_parameterWidgets.setLayout( &m_layout );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
// connect the modification signal of m_checkbox with our callback
......
......@@ -31,6 +31,7 @@
#include "../../../common/WLogger.h"
#include "../../../common/WPropertyVariable.h"
#include "../WGuiConsts.h"
#include "WPropertyColorWidget.h"
......@@ -47,9 +48,13 @@ WPropertyColorWidget::WPropertyColorWidget( WPropColor property, QGridLayout* pr
// layout both against each other
m_layout.addWidget( &m_button );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
// set the initial values
......
......@@ -30,6 +30,7 @@
#include "../../../common/WLogger.h"
#include "../../../common/WPropertyVariable.h"
#include "../WGuiConsts.h"
#include "WPropertyDoubleWidget.h"
WPropertyDoubleWidget::WPropertyDoubleWidget( WPropDouble property, QGridLayout* propertyGrid, QWidget* parent ):
......@@ -44,13 +45,19 @@ WPropertyDoubleWidget::WPropertyDoubleWidget( WPropDouble property, QGridLayout*
// layout both against each other
m_layout.addWidget( &m_slider );
m_layout.addWidget( &m_edit );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
m_parameterWidgets.setLayout( &m_layout );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
m_slider.setMinimumWidth( WMIN_SLIDER_WIDTH );
update();
// connect the modification signal of the edit and slider with our callback
......
......@@ -32,6 +32,7 @@
#include "../../../common/WLogger.h"
#include "../../../common/WPropertyVariable.h"
#include "../../../common/constraints/WPropertyConstraintTypes.h"
#include "../WGuiConsts.h"
#include "WPropertyFilenameWidget.h"
......@@ -48,9 +49,13 @@ WPropertyFilenameWidget::WPropertyFilenameWidget( WPropFilename property, QGridL
// layout both against each other
m_layout.addWidget( &m_button );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
// set the initial values
......
......@@ -29,6 +29,7 @@
#include <boost/lexical_cast.hpp>
#include "../WGuiConsts.h"
#include "../../../common/WLogger.h"
#include "../../../common/WPropertyVariable.h"
......@@ -46,12 +47,18 @@ WPropertyIntWidget::WPropertyIntWidget( WPropInt property, QGridLayout* property
// layout both against each other
m_layout.addWidget( &m_slider );
m_layout.addWidget( &m_edit );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
m_parameterWidgets.setLayout( &m_layout );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
m_slider.setMinimumWidth( WMIN_SLIDER_WIDTH );
update();
// connect the modification signal of the edit and slider with our callback
......
......@@ -30,6 +30,7 @@
#include "../../../common/WLogger.h"
#include "../../../common/WPropertyVariable.h"
#include "../WGuiConsts.h"
#include "WPropertyMatrix4X4Widget.h"
......@@ -61,9 +62,13 @@ WPropertyMatrix4X4Widget::WPropertyMatrix4X4Widget( WPropMatrix4X4 property, QGr
}
m_parameterWidgets.setLayout( &m_layout );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
update();
......
......@@ -30,6 +30,7 @@
#include "../../../common/WLogger.h"
#include "../../../common/WPropertyVariable.h"
#include "../WGuiConsts.h"
#include "WPropertyPositionWidget.h"
......@@ -55,11 +56,15 @@ WPropertyPositionWidget::WPropertyPositionWidget( WPropPosition property, QGridL
m_layout.addWidget( &m_editX );
m_layout.addWidget( &m_editY );
m_layout.addWidget( &m_editZ );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
m_parameterWidgets.setLayout( &m_layout );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
update();
......
......@@ -36,6 +36,8 @@
#include "../../../common/WItemSelector.h"
#include "../../../common/WItemSelection.h"
#include "../WGuiConsts.h"
#include "WPropertySelectionWidget.h"
/**
......@@ -69,6 +71,8 @@ WPropertySelectionWidget::WPropertySelectionWidget( WPropSelection property, QGr
// initialize members
m_combo = NULL;
m_list = NULL;
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
// initialize the proper widget
// Lists are used if the selection of multiple elements is allowed
......
......@@ -29,6 +29,7 @@
#include "../../../common/WLogger.h"
#include "../../../common/WPropertyVariable.h"
#include "../WGuiConsts.h"
#include "WPropertyStringWidget.h"
......@@ -45,9 +46,13 @@ WPropertyStringWidget::WPropertyStringWidget( WPropString property, QGridLayout*
// layout
m_layout.addWidget( &m_edit );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
m_asText.setWordWrap( true );
// To have word warp work correctly -> set size policy
......
......@@ -24,6 +24,7 @@
#include "WPropertyTriggerWidget.h"
#include "../WGuiConsts.h"
#include "../../../common/WPropertyVariable.h"
WPropertyTriggerWidget::WPropertyTriggerWidget( WPropTrigger property, QGridLayout* propertyGrid, QWidget* parent ):
......@@ -40,12 +41,16 @@ WPropertyTriggerWidget::WPropertyTriggerWidget( WPropTrigger property, QGridLayo
// layout both against each other
m_layout.addWidget( &m_button );
m_layout.setMargin( WGLOBAL_MARGIN );
m_layout.setSpacing( WGLOBAL_SPACING );
m_button.setText( QString::fromStdString( property->getDescription() ) );
m_parameterWidgets.setLayout( &m_layout );
// Information Output ( Property Purpose = PV_PURPOSE_INFORMATION )
m_infoLayout.addWidget( &m_asText );
m_infoLayout.setMargin( WGLOBAL_MARGIN );
m_infoLayout.setSpacing( WGLOBAL_SPACING );
m_informationWidgets.setLayout( &m_infoLayout );
// connect the modification signal of m_checkbox with our callback
......
......@@ -34,6 +34,8 @@
#include "../../../common/WProperties.h"
#include "../WGuiConsts.h"
#include "WQtPropertyGroupWidget.h"
WQtPropertyGroupWidget::WQtPropertyGroupWidget( WPropGroup group, QWidget* parent )
......@@ -45,7 +47,13 @@ WQtPropertyGroupWidget::WQtPropertyGroupWidget( WPropGroup group, QWidget* paren
// note: never do layouts as none pointers
// on destruction of a widget it will try to delete them which will cause crashes
m_pageLayout = new QVBoxLayout();
m_pageLayout->setMargin( WGLOBAL_MARGIN );
m_pageLayout->setSpacing( WGLOBAL_SPACING );
m_controlLayout = new QGridLayout();
m_controlLayout->setMargin( WGLOBAL_MARGIN );
m_controlLayout->setSpacing( WGLOBAL_SPACING );
m_pageLayout->addLayout( m_controlLayout );
// NOTE: a simple setHidden( group->isHidden() ) causes the QWidgets to popup if hidden is false. This is why we set hidden only if it really
......@@ -67,7 +75,12 @@ WQtPropertyGroupWidget::WQtPropertyGroupWidget( std::string name, QWidget* paren
// note: never do layouts as none pointers
// on destruction of a widget it will try to delete them which will cause crashes
m_pageLayout = new QVBoxLayout();
m_pageLayout->setMargin( WGLOBAL_MARGIN );
m_pageLayout->setSpacing( WGLOBAL_SPACING );
m_controlLayout = new QGridLayout();
m_controlLayout->setMargin( WGLOBAL_MARGIN );
m_controlLayout->setSpacing( WGLOBAL_SPACING );
m_pageLayout->addLayout( m_controlLayout );
}
......@@ -175,6 +188,8 @@ void WQtPropertyGroupWidget::addGroup( WQtPropertyGroupWidget* widget, bool asSc
QScrollArea* scrollArea = 0;
QGridLayout* grid = new QGridLayout();
grid->addWidget( widget, 0, 0 );
grid->setMargin( WGLOBAL_MARGIN );
grid->setSpacing( WGLOBAL_SPACING );
group->setLayout( grid );
if ( asScrollArea )
......@@ -189,6 +204,8 @@ void WQtPropertyGroupWidget::addGroup( WQtPropertyGroupWidget* widget, bool asSc
box->setFrameShape( QFrame::StyledPanel );
box->setFrameShadow( QFrame::Raised );
QGridLayout* boxLayout = new QGridLayout( box );
boxLayout->setMargin( WGLOBAL_MARGIN );
boxLayout->setSpacing( WGLOBAL_SPACING );
// create a button as title
QPushButton* boxTitle = new QPushButton( this );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment