Commit e1118465 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

GetValue()/GetData()/GetWidget() functions of UIParams renamed to Value()/Data()/Widget().

parent 25bbbe26
......@@ -71,7 +71,7 @@ void AlgorithmSelector::populateTools( ToolInterface *plugin )
tool.param->setMaximumWidth(360);
foreach( UIParamAction* act, tool.param->GetActions() )
connect( act->GetWidget(), SIGNAL(clicked(bool)), this, SLOT(emitActionSignal()) );
connect( act->Widget(), SIGNAL(clicked(bool)), this, SLOT(emitActionSignal()) );
m_ToolsByCategory[categoryId].push_back( tool );
m_ui->widgetToolGroupBoxes->layout()->addWidget( tool.param );
......@@ -228,8 +228,8 @@ void AlgorithmSelector::emitActionSignal()
{
m_ActionId = QString();
foreach( UIParamAction* act, m_SelectedTool->param->GetActions() )
if( act->GetWidget() == (QPushButton*)sender() )
m_ActionId = act->GetId();
if( act->Widget() == (QPushButton*)sender() )
m_ActionId = act->Id();
if( !m_ActionId.isNull() )
emit askItemsToApplyToolOn();
......
......@@ -1006,7 +1006,7 @@ void UIMainWindow::launchExport( ExportInterface *exportPlugIn,
l->addWidget( m_CurrentExportParams, 1,4 );
foreach( UIParamAction* act, m_CurrentExportParams->GetActions() )
connect( act->GetWidget(), SIGNAL(clicked(bool)), this, SLOT(execExportAction()) );
connect( act->Widget(), SIGNAL(clicked(bool)), this, SLOT(execExportAction()) );
// Sorts all selected data wrt. their types.
......@@ -1159,8 +1159,8 @@ void UIMainWindow::execExportAction()
QString actionId;
foreach( UIParamAction* act, m_CurrentExportParams->GetActions() )
if( act->GetWidget() == (QPushButton*)sender() )
actionId = act->GetId();
if( act->Widget() == (QPushButton*)sender() )
actionId = act->Id();
Context ctx;
......
......@@ -31,13 +31,13 @@ public:
virtual ~UIParam() {}
inline const QString& GetId() const { return m_Id; }
inline const QString& GetName() const { return m_Name; }
inline const QString& GetDescription() const { return m_Description; }
inline const QString& Id() const { return m_Id; }
inline const QString& Name() const { return m_Name; }
inline const QString& Description() const { return m_Description; }
inline virtual void ArrangeInLayout( QGridLayout *l, int line )
{
m_Label = new QLabel( GetName()+':', l->parentWidget() );
m_Label = new QLabel( Name()+':', l->parentWidget() );
m_Widget->setParent( l->parentWidget() );
if( !m_Description.isNull() && !m_Description.isEmpty() )
......
......@@ -27,10 +27,10 @@ public:
m_Widget->setToolTip( m_Description );
l->addWidget( m_Widget, line,0, 1,2 );
}
inline QPushButton* GetWidget() { return (QPushButton*) m_Widget; }
inline QPushButton* Widget() { return (QPushButton*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(clicked(bool)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(clicked(bool)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -21,7 +21,7 @@ class UIParamAnimation : public UIParam
public:
UIParamAnimation();
inline QComboBox* GetWidget() { return (QComboBox*) m_Widget; }
inline QComboBox* Widget() { return (QComboBox*) m_Widget; }
inline void ArrangeInLayout( QGridLayout *l, int line )
{
......
......@@ -23,12 +23,12 @@ public:
m_Widget = new QCheckBox( " " );
((QCheckBox*)m_Widget)->setChecked( value );
}
inline bool GetValue() const { return ((QCheckBox*)m_Widget)->isChecked(); }
inline bool Value() const { return ((QCheckBox*)m_Widget)->isChecked(); }
inline void SetValue( bool value ) { ((QCheckBox*)m_Widget)->setChecked( value ); }
inline QCheckBox* GetWidget() { return (QCheckBox*) m_Widget; }
inline QCheckBox* Widget() { return (QCheckBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(stateChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(stateChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -26,12 +26,12 @@ public:
unsigned int minSize = 1,
unsigned int maxSize = 65536 );
inline unsigned int GetValue() const { return (unsigned int) ((QSpinBox*) m_Widget)->value(); }
inline unsigned int Value() const { return (unsigned int) ((QSpinBox*) m_Widget)->value(); }
inline void SetValue( const unsigned int value ) { ((QSpinBox*) m_Widget)->setValue( (int) value ); }
inline QSpinBox* GetWidget() { return (QSpinBox*) m_Widget; }
inline QSpinBox* Widget() { return (QSpinBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
public slots:
......
......@@ -29,9 +29,9 @@ public:
unsigned int minSize = 1,
unsigned int maxSize = 65536 );
inline QSize GetValue() const { return QSize( m_SpinSizeX->value(), m_SpinSizeY->value() ); }
inline QSize Value() const { return QSize( m_SpinSizeX->value(), m_SpinSizeY->value() ); }
inline void SetValue( const QSize &value ) { m_SpinSizeX->setValue( value.width() ); m_SpinSizeY->setValue( value.height() ); }
inline QWidget* GetWidget() { return m_Widget; }
inline QWidget* Widget() { return m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( m_SpinSizeX, SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
......
......@@ -20,16 +20,16 @@ UIParamChildren::UIParamChildren( const QString& id,
{
m_TypeFilters = typeFilter;
m_Widget = new QComboBox();
GetWidget()->addItem( QString(), QVariant((qulonglong) 0) );
Widget()->addItem( QString(), QVariant((qulonglong) 0) );
}
void UIParamChildren::SetValue( const QString& value )
{
for( int i=0; i<GetWidget()->count(); ++i )
if( GetWidget()->itemText(i) == value )
for( int i=0; i<Widget()->count(); ++i )
if( Widget()->itemText(i) == value )
{
GetWidget()->setCurrentIndex( i );
Widget()->setCurrentIndex( i );
break;
}
}
......@@ -42,8 +42,8 @@ void UIParamChildren::Update( const QList<GenericUIData*>& dataList, GenericUIDa
if( m_TypeFilters.empty() || m_TypeFilters.contains(d->GetTypeString()) )
{
if( d == current )
currentNewIndex = GetWidget()->count();
GetWidget()->addItem( d->GetFileName(), QVariant((qulonglong) d) );
currentNewIndex = Widget()->count();
Widget()->addItem( d->GetFileName(), QVariant((qulonglong) d) );
}
if( recursive )
......@@ -56,11 +56,11 @@ void UIParamChildren::SetTypeFilters( const QStringList& typeFilters )
{
m_TypeFilters = typeFilters;
for( int n=0; n<GetWidget()->count(); )
for( int n=0; n<Widget()->count(); )
{
GenericUIData *d = (GenericUIData*) GetWidget()->itemData(n).toULongLong();
GenericUIData *d = (GenericUIData*) Widget()->itemData(n).toULongLong();
if( d && m_TypeFilters.contains( d->GetTypeString() ) )
GetWidget()->removeItem( n );
Widget()->removeItem( n );
else
++ n;
}
......@@ -69,14 +69,14 @@ void UIParamChildren::SetTypeFilters( const QStringList& typeFilters )
void UIParamChildren::Update( GenericUIData *d )
{
GenericUIData *current = GetValue();
GenericUIData *current = Value();
int currentNewIndex = 0;
GetWidget()->clear();
GetWidget()->addItem( QString(), QVariant((qulonglong) 0) );
Widget()->clear();
Widget()->addItem( QString(), QVariant((qulonglong) 0) );
Update( d->GetChildren(), current, currentNewIndex, true );
GetWidget()->setCurrentIndex( currentNewIndex );
Widget()->setCurrentIndex( currentNewIndex );
}
......
......@@ -25,15 +25,15 @@ public:
const QString& description,
const QStringList& typeFilter = QStringList() );
inline GenericUIData* GetValue() const { return (GenericUIData*) ((QComboBox*)m_Widget)->currentData().toULongLong(); }
inline GenericUIData* Value() const { return (GenericUIData*) ((QComboBox*)m_Widget)->currentData().toULongLong(); }
void SetValue( const QString& value );
inline int GetData() const { return ((QComboBox*)m_Widget)->itemData( ((QComboBox*)m_Widget)->currentIndex() ).value<int>(); }
inline QComboBox* GetWidget() { return (QComboBox*) m_Widget; }
inline int Data() const { return ((QComboBox*)m_Widget)->itemData( ((QComboBox*)m_Widget)->currentIndex() ).value<int>(); }
inline QComboBox* Widget() { return (QComboBox*) m_Widget; }
void SetTypeFilters( const QStringList& typeFilters );
void Update( GenericUIData *d );
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -29,10 +29,10 @@ public:
const QList<int>& data = QList<int>() );
void ArrangeInLayout( QGridLayout *l, int line );
inline QString GetValue() const { return m_CurrentChoice->text(); }
inline QString Value() const { return m_CurrentChoice->text(); }
void SetValue( const QString& value );
inline int GetData() const { return m_ButtonDataMapping[m_CurrentChoice]; }
inline QWidget* GetWidget() { return m_Widget; }
inline int Data() const { return m_ButtonDataMapping[m_CurrentChoice]; }
inline QWidget* Widget() { return m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( this, SIGNAL(currentChoiceChanged()), this, SLOT(triggerParameterUpdate()) );
......
......@@ -27,9 +27,9 @@ public:
unsigned char green,
unsigned char blue );
inline QColor GetValue() const { QColor c; c.setRgb( m_SpinChannels[0]->value(), m_SpinChannels[1]->value(), m_SpinChannels[2]->value() ); return c; }
inline QColor Value() const { QColor c; c.setRgb( m_SpinChannels[0]->value(), m_SpinChannels[1]->value(), m_SpinChannels[2]->value() ); return c; }
inline void SetValue( const QColor &c ) { m_SpinChannels[0]->setValue(c.red()); m_SpinChannels[1]->setValue(c.green()); m_SpinChannels[2]->setValue(c.blue()); }
inline QVector<QSpinBox*> GetWidget() { return m_SpinChannels; }
inline QVector<QSpinBox*> Widget() { return m_SpinChannels; }
void ConnectModificationSignal()
{
QObject::connect( m_SpinChannels[0], SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
......
......@@ -30,12 +30,12 @@ public:
sb->setValue( value );
m_Widget = sb;
}
inline double GetValue() const { return ((QDoubleSpinBox*)m_Widget)->value(); }
inline double Value() const { return ((QDoubleSpinBox*)m_Widget)->value(); }
inline void SetValue( double value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QDoubleSpinBox* GetWidget() { return (QDoubleSpinBox*) m_Widget; }
inline QDoubleSpinBox* Widget() { return (QDoubleSpinBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(valueChanged(double)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(valueChanged(double)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -30,12 +30,12 @@ public:
sb->setValue( value );
m_Widget = sb;
}
inline float GetValue() const { return (float) ((QDoubleSpinBox*)m_Widget)->value(); }
inline float Value() const { return (float) ((QDoubleSpinBox*)m_Widget)->value(); }
inline void SetValue( float value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QDoubleSpinBox* GetWidget() { return (QDoubleSpinBox*) m_Widget; }
inline QDoubleSpinBox* Widget() { return (QDoubleSpinBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(valueChanged(double)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(valueChanged(double)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -54,9 +54,9 @@ public:
QObject::connect( buttons[4], SIGNAL(clicked()), m_FuncWidget, SLOT(setPower ()) );
QObject::connect( buttons[5], SIGNAL(clicked()), m_FuncWidget, SLOT(setGemanMcLure()) );
}
inline void GetValue( QVector<float> &funcSamples ) const { m_FuncWidget->getFunction(funcSamples); }
inline void Value( QVector<float> &funcSamples ) const { m_FuncWidget->getFunction(funcSamples); }
//inline void SetValue( float value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QWidget* GetWidget() { return m_Widget; }
inline QWidget* Widget() { return m_Widget; }
inline void ArrangeInLayout( QGridLayout *l, int line )
{
l->addWidget( m_Widget, line,0, 1,2 );
......
......@@ -29,12 +29,12 @@ public:
sb->setValue( value );
m_Widget = sb;
}
inline int GetValue() const { return ((QSpinBox*)m_Widget)->value(); }
inline int Value() const { return ((QSpinBox*)m_Widget)->value(); }
inline void SetValue( int value ) { ((QSpinBox*)m_Widget)->setValue( value ); }
inline QSpinBox* GetWidget() { return (QSpinBox*) m_Widget; }
inline QSpinBox* Widget() { return (QSpinBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -33,10 +33,10 @@ UIParamList::UIParamList( const QString& id,
void UIParamList::SetValue( const QString& value )
{
for( int i=0; i<GetWidget()->count(); ++i )
if( GetWidget()->itemText(i) == value )
for( int i=0; i<Widget()->count(); ++i )
if( Widget()->itemText(i) == value )
{
GetWidget()->setCurrentIndex( i );
Widget()->setCurrentIndex( i );
break;
}
}
......@@ -21,13 +21,13 @@ public:
const QStringList& value = QStringList(),
const QList<int>& data = QList<int>() );
inline QString GetValue() const { return ((QComboBox*)m_Widget)->currentText(); }
inline QString Value() const { return ((QComboBox*)m_Widget)->currentText(); }
void SetValue( const QString& value );
inline int GetData() const { return ((QComboBox*)m_Widget)->itemData( ((QComboBox*)m_Widget)->currentIndex() ).value<int>(); }
inline QComboBox* GetWidget() { return (QComboBox*) m_Widget; }
inline int Data() const { return ((QComboBox*)m_Widget)->itemData( ((QComboBox*)m_Widget)->currentIndex() ).value<int>(); }
inline QComboBox* Widget() { return (QComboBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -74,7 +74,7 @@ public:
param->ConnectModificationSignal();
connect( param, SIGNAL(parameterUpdated(UIParam*)), this, SLOT(triggerParameterUpdate(UIParam*)) );
m_ParamById[ param->GetId() ] = param;
m_ParamById[ param->Id() ] = param;
}
param->ArrangeInLayout( /*(QGridLayout*)layout()*/m_Layout, m_RowCount );
......
......@@ -22,12 +22,12 @@ public:
{
m_Widget = new QLineEdit( value );
}
inline QString GetValue() const { return ((QLineEdit*)m_Widget)->text(); }
inline void SetValue( const QString& value ) { ((QLineEdit*)m_Widget)->setText( value ); }
inline QLineEdit* GetWidget() { return (QLineEdit*) m_Widget; }
inline QString Value() const { return ((QLineEdit*)m_Widget)->text(); }
inline void SetValue( const QString& value ) { ((QLineEdit*)m_Widget)->setText( value ); }
inline QLineEdit* Widget() { return (QLineEdit*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( GetWidget(), SIGNAL(textChanged(QString)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( Widget(), SIGNAL(textChanged(QString)), this, SLOT(triggerParameterUpdate()) );
}
};
......
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