Commit 25cb7aeb authored by Victor Poughon's avatar Victor Poughon

REFAC: continue upgrade to qt5 signal/slot syntax

parent 905e260c
......@@ -56,17 +56,9 @@ void QtStringSelectionWidget::DoCreateWidget()
m_HLayout->addWidget(m_Input);
QObject::connect(
m_Checkbox, SIGNAL( toggled( bool ) ),
m_Input, SLOT( setEnabled( bool ) )
);
connect( m_Checkbox, &QCheckBox::toggled, m_Input, &QLineEdit::setEnabled );
QObject::connect(
m_Input,
SIGNAL( editingFinished( ) ),
this,
SLOT( OnEditionFinished() )
);
connect( m_Input, &QLineEdit::editingFinished, this, &QtStringSelectionWidget::OnEditionFinished );
this->setLayout(m_HLayout);
}
......
......@@ -63,8 +63,8 @@ void QtWidgetComplexInputImageParameter::DoCreateWidget()
m_Input->setToolTip(
QString::fromStdString( m_ComplexInputImageParam->GetDescription() )
);
connect( m_Input, SIGNAL(textChanged(const QString&)), this, SLOT(SetFileName(const QString&)) );
connect( m_Input, SIGNAL(textChanged(const QString&)), GetModel(), SLOT(NotifyUpdate()) );
connect( m_Input, &QLineEdit::textChanged, this, &QtWidgetComplexInputImageParameter::SetFileName );
connect( m_Input, &QLineEdit::textChanged, GetModel(), &QtWidgetModel::NotifyUpdate );
m_HLayout->addWidget(m_Input);
......@@ -73,7 +73,7 @@ void QtWidgetComplexInputImageParameter::DoCreateWidget()
m_Button->setText("...");
m_Button->setToolTip("Select file...");
m_Button->setMaximumWidth(m_Button->width());
connect( m_Button, SIGNAL(clicked()), this, SLOT(SelectFile()) );
connect( m_Button, &QPushButton::clicked, this, &QtWidgetComplexInputImageParameter::SelectFile );
m_HLayout->addWidget(m_Button);
this->setLayout(m_HLayout);
......
......@@ -73,8 +73,8 @@ void QtWidgetInputImageParameter::DoCreateWidget()
QString::fromStdString( m_InputImageParam->GetDescription() )
);
connect( m_Input, SIGNAL(editingFinished()), this, SLOT(OnEditingFinished()) );
connect( this, SIGNAL(FileNameIsSet()), GetModel(), SLOT(NotifyUpdate()) );
connect( m_Input, &QLineEdit::editingFinished, this, &QtWidgetInputImageParameter::OnEditingFinished );
connect( this, &QtWidgetInputImageParameter::FileNameIsSet, GetModel(), &QtWidgetModel::NotifyUpdate );
m_HLayout->addWidget(m_Input);
......@@ -83,7 +83,7 @@ void QtWidgetInputImageParameter::DoCreateWidget()
m_Button->setText("...");
m_Button->setToolTip("Select file...");
m_Button->setMaximumWidth(m_Button->width());
connect( m_Button, SIGNAL(clicked()), this, SLOT(SelectFile()) );
connect( m_Button, &QPushButton::clicked, this, &QtWidgetInputImageParameter::SelectFile );
m_HLayout->addWidget(m_Button);
this->setLayout(m_HLayout);
......
......@@ -64,8 +64,8 @@ void QtWidgetInputVectorDataParameter::DoCreateWidget()
m_Input->setToolTip(
QString::fromStdString( m_InputVectorDataParam->GetDescription() )
);
connect( m_Input, SIGNAL(textChanged(const QString&)), this, SLOT(SetFileName(const QString&)) );
connect( m_Input, SIGNAL(textChanged(const QString&)), GetModel(), SLOT(NotifyUpdate()) );
connect( m_Input, &QLineEdit::textChanged, this, &QtWidgetInputVectorDataParameter::SetFileName );
connect( m_Input, &QLineEdit::textChanged, GetModel(), &QtWidgetModel::NotifyUpdate );
m_HLayout->addWidget(m_Input);
......@@ -74,7 +74,7 @@ void QtWidgetInputVectorDataParameter::DoCreateWidget()
m_Button->setText("...");
m_Button->setToolTip("Select file...");
m_Button->setMaximumWidth(m_Button->width());
connect( m_Button, SIGNAL(clicked()), this, SLOT(SelectFile()) );
connect( m_Button, &QPushButton::clicked, this, &QtWidgetInputVectorDataParameter::SelectFile );
m_HLayout->addWidget(m_Button);
this->setLayout(m_HLayout);
......
......@@ -87,23 +87,23 @@ ListEditWidget
m_UI->treeView->setModel( model );
QObject::connect(
model, SIGNAL( dataChanged( const QModelIndex &, const QModelIndex & ) ),
this, SLOT( OnDataChanged( const QModelIndex &, const QModelIndex & ) )
model, &ListEditItemModel::dataChanged,
this, &ListEditWidget::OnDataChanged
);
QObject::connect(
model, SIGNAL( modelReset() ),
this, SLOT( OnModelReset() )
model, &ListEditItemModel::modelReset,
this, &ListEditWidget::OnModelReset
);
QObject::connect(
model, SIGNAL( rowsInserted( const QModelIndex &, int, int ) ),
this, SLOT( OnRowsInserted( const QModelIndex &, int, int ) )
model, &ListEditItemModel::rowsInserted,
this, &ListEditWidget::OnRowsInserted
);
QObject::connect(
model, SIGNAL( rowsRemoved( const QModelIndex &, int, int ) ),
this, SLOT( OnRowsRemoved( const QModelIndex &, int, int ) )
model, &ListEditItemModel::rowsRemoved,
this, &ListEditWidget::OnRowsRemoved
);
//
......@@ -111,15 +111,8 @@ ListEditWidget
assert( m_UI->treeView->selectionModel()!=nullptr );
QObject::connect(
m_UI->treeView->selectionModel(),
SIGNAL(
selectionChanged( const QItemSelection & , const QItemSelection & )
),
// to:
this,
SLOT(
OnSelectionChanged( const QItemSelection & , const QItemSelection & )
)
m_UI->treeView->selectionModel(), &QItemSelectionModel::selectionChanged,
this, &ListEditWidget::OnSelectionChanged
);
//
......
......@@ -115,7 +115,7 @@ void QtWidgetListViewParameter::DoCreateWidget()
m_ListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
}
connect( m_ListView, SIGNAL(itemSelectionChanged()), this, SLOT(SelectedItems()) );
connect( m_ListView, &QListWidget::itemSelectionChanged, this, &QtWidgetListViewParameter::SelectedItems );
m_VLayout = new QHBoxLayout(this);
m_VLayout->setContentsMargins(0, 0, 0, 0);
......
......@@ -56,15 +56,15 @@ void QtWidgetOutputVectorDataParameter::DoCreateWidget()
m_Input->setToolTip(
QString::fromStdString( m_OutputVectorDataParam->GetDescription() )
);
connect( m_Input, SIGNAL(textChanged(const QString&)), this, SLOT(SetFileName(const QString&)) );
connect( m_Input, SIGNAL(textChanged(const QString&)), GetModel(), SLOT(NotifyUpdate()) );
connect( m_Input, &QLineEdit::textChanged, this, &QtWidgetOutputVectorDataParameter::SetFileName );
connect( m_Input, &QLineEdit::textChanged, GetModel(), &QtWidgetModel::NotifyUpdate );
m_HLayout->addWidget(m_Input);
m_Button = new QPushButton(this);
m_Button->setText("...");
m_Button->setToolTip("Select output filename...");
m_Button->setMaximumWidth(m_Button->width());
connect( m_Button, SIGNAL(clicked()), this, SLOT(SelectFile()) );
connect( m_Button, &QPushButton::clicked, this, &QtWidgetOutputVectorDataParameter::SelectFile );
m_HLayout->addWidget(m_Button);
this->setLayout(m_HLayout);
......
......@@ -82,10 +82,10 @@ void QtWidgetParameterGroup::DoCreateWidget()
// CheckBox (col 0)
QCheckBox * checkBox = new QCheckBox(this);
connect( checkBox, SIGNAL(clicked(bool)), specificWidget, SLOT(SetActivationState(bool)));
connect( checkBox, SIGNAL(clicked(bool)), GetModel(), SLOT(NotifyUpdate()) );
connect( specificWidget, SIGNAL(ParameterActiveStatus(bool)), checkBox, SLOT(setChecked(bool)));
connect( specificWidget, SIGNAL(ParameterActiveStatus(bool)), specificWidget, SLOT(SetActivationState(bool)));
connect( checkBox, &QCheckBox::clicked, specificWidget, &QtWidgetParameterBase::SetActivationState );
connect( checkBox, &QCheckBox::clicked, GetModel(), &QtWidgetModel::NotifyUpdate );
connect( specificWidget, &QtWidgetParameterBase::ParameterActiveStatus, checkBox, &QCheckBox::setChecked );
connect( specificWidget, &QtWidgetParameterBase::ParameterActiveStatus, specificWidget, &QtWidgetParameterBase::SetActivationState );
// if Mandatory make the checkbox checked and deactivated
if (param->GetMandatory())
......@@ -130,7 +130,7 @@ void QtWidgetParameterGroup::DoCreateWidget()
{
param->SetActive(true);
}
connect(group, SIGNAL(clicked(bool)), specificWidget, SLOT(SetActivationState(bool)));
connect(group, &QGroupBox::clicked, specificWidget, &QtWidgetParameterBase::SetActivationState );
group->setTitle(rawParam->GetName());
gridLayout->addWidget(group, i, 0, 1, -1);
......
......@@ -39,8 +39,8 @@ QtWidgetParameterList
assert( m!=nullptr );
QObject::connect(
this, SIGNAL( NotifyUpdate() ),
m, SLOT( NotifyUpdate() )
this, &QtWidgetParameterList::NotifyUpdate ,
m, &QtWidgetModel::NotifyUpdate
);
}
......@@ -91,8 +91,8 @@ QtWidgetParameterList
// Connections (Update app parameters).
QObject::connect(
widget, SIGNAL( Updated() ),
this, SIGNAL( NotifyUpdate() )
widget, &ListEditWidget::Updated,
this, &QtWidgetParameterList::NotifyUpdate
);
}
......
......@@ -62,8 +62,8 @@ void QtWidgetStringParameter::DoCreateWidget()
);
m_HLayout->addWidget(m_Input);
connect( m_Input, SIGNAL(textChanged(const QString&)), this, SLOT(SetValue(const QString&)) );
connect( m_Input, SIGNAL(textChanged(const QString&)), GetModel(), SLOT(NotifyUpdate()) );
connect( m_Input, &QLineEdit::textChanged, this, &QtWidgetStringParameter::SetValue );
connect( m_Input, &QLineEdit::textChanged, GetModel(), &QtWidgetModel::NotifyUpdate );
this->setLayout(m_HLayout);
......
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