Commit 3efc26d3 authored by Laurent Montel's avatar Laurent Montel 😁

Port to new connect api

parent db26dd77
...@@ -58,7 +58,7 @@ Calculator::Calculator( QWidget * parent ) ...@@ -58,7 +58,7 @@ Calculator::Calculator( QWidget * parent )
m_display->setReadOnly( true ); m_display->setReadOnly( true );
connect( m_input->edit, SIGNAL(returnPressed()), this, SLOT(calculate()) ); connect(m_input->edit, &EquationEdit::returnPressed, this, &Calculator::calculate);
resize( layout->minimumSize() ); resize( layout->minimumSize() );
m_input->edit->setFocus(); m_input->edit->setFocus();
......
...@@ -54,9 +54,9 @@ EquationEdit::EquationEdit( QWidget * parent ) ...@@ -54,9 +54,9 @@ EquationEdit::EquationEdit( QWidget * parent )
m_editButton = new QPushButton( QIcon::fromTheme("document-properties"), 0, this ); m_editButton = new QPushButton( QIcon::fromTheme("document-properties"), 0, this );
setFocusProxy( m_equationEditWidget ); setFocusProxy( m_equationEditWidget );
connect( m_equationEditWidget, SIGNAL( textChanged() ), this, SLOT( slotTextChanged() ) ); connect(m_equationEditWidget, &EquationEditWidget::textChanged, this, &EquationEdit::slotTextChanged);
connect( m_editButton, SIGNAL(clicked()), this, SLOT(invokeEquationEditor()) ); connect(m_editButton, &QPushButton::clicked, this, &EquationEdit::invokeEquationEditor);
connect( m_equationEditWidget, SIGNAL(cursorPositionChanged()), this, SLOT(reHighlight()) ); connect(m_equationEditWidget, &EquationEditWidget::cursorPositionChanged, this, &EquationEdit::reHighlight);
QHBoxLayout * layout = new QHBoxLayout( this ); QHBoxLayout * layout = new QHBoxLayout( this );
layout->setMargin( 0 ); layout->setMargin( 0 );
......
...@@ -41,7 +41,7 @@ EquationEditor::EquationEditor(QWidget* parent) ...@@ -41,7 +41,7 @@ EquationEditor::EquationEditor(QWidget* parent)
setButtons(Close); setButtons(Close);
showButtonSeparator(true); showButtonSeparator(true);
connect(m_widget->edit, SIGNAL(returnPressed()), this, SLOT(accept())); connect(m_widget->edit, &EquationEdit::returnPressed, this, &EquationEditor::accept);
} }
......
...@@ -80,7 +80,7 @@ FunctionEditor::FunctionEditor( QMenu * createNewPlotsMenu, QWidget * parent ) ...@@ -80,7 +80,7 @@ FunctionEditor::FunctionEditor( QMenu * createNewPlotsMenu, QWidget * parent )
connect( m_saveTimer[Function::Parametric], SIGNAL(timeout()), this, SLOT( saveParametric() ) ); connect( m_saveTimer[Function::Parametric], SIGNAL(timeout()), this, SLOT( saveParametric() ) );
connect( m_saveTimer[Function::Implicit], SIGNAL(timeout()), this, SLOT( saveImplicit() ) ); connect( m_saveTimer[Function::Implicit], SIGNAL(timeout()), this, SLOT( saveImplicit() ) );
connect( m_saveTimer[Function::Differential], SIGNAL(timeout()), this, SLOT( saveDifferential() ) ); connect( m_saveTimer[Function::Differential], SIGNAL(timeout()), this, SLOT( saveDifferential() ) );
connect( m_syncFunctionListTimer, SIGNAL(timeout()), this, SLOT( syncFunctionList() ) ); connect(m_syncFunctionListTimer, &QTimer::timeout, this, &FunctionEditor::syncFunctionList);
m_editor = new FunctionEditorWidget; m_editor = new FunctionEditorWidget;
m_functionList = m_editor->functionList; m_functionList = m_editor->functionList;
...@@ -116,9 +116,9 @@ FunctionEditor::FunctionEditor( QMenu * createNewPlotsMenu, QWidget * parent ) ...@@ -116,9 +116,9 @@ FunctionEditor::FunctionEditor( QMenu * createNewPlotsMenu, QWidget * parent )
for ( unsigned i = 0; i < 5; ++i ) for ( unsigned i = 0; i < 5; ++i )
m_editor->stackedWidget->widget(i)->layout()->setMargin( 0 ); m_editor->stackedWidget->widget(i)->layout()->setMargin( 0 );
connect( m_editor->deleteButton, SIGNAL(clicked()), this, SLOT(deleteCurrent()) ); connect(m_editor->deleteButton, &QPushButton::clicked, this, &FunctionEditor::deleteCurrent);
connect( m_functionList, SIGNAL(currentItemChanged( QListWidgetItem *, QListWidgetItem * )), this, SLOT(functionSelected( QListWidgetItem* )) ); connect(m_functionList, &FunctionListWidget::currentItemChanged, this, &FunctionEditor::functionSelected);
connect( m_functionList, SIGNAL(itemClicked( QListWidgetItem * )), this, SLOT(save()) ); // user might have checked or unchecked the item connect(m_functionList, &FunctionListWidget::itemClicked, this, &FunctionEditor::save);
//BEGIN connect up all editing widgets //BEGIN connect up all editing widgets
#define CONNECT_WIDGETS( name, signal ) \ #define CONNECT_WIDGETS( name, signal ) \
...@@ -137,11 +137,11 @@ FunctionEditor::FunctionEditor( QMenu * createNewPlotsMenu, QWidget * parent ) ...@@ -137,11 +137,11 @@ FunctionEditor::FunctionEditor( QMenu * createNewPlotsMenu, QWidget * parent )
CONNECT_WIDGETS( ParametersWidget, parameterListChanged() ); CONNECT_WIDGETS( ParametersWidget, parameterListChanged() );
CONNECT_WIDGETS( KGradientButton, gradientChanged(const QGradient &) ); CONNECT_WIDGETS( KGradientButton, gradientChanged(const QGradient &) );
connect( m_editor->initialConditions, SIGNAL(dataChanged()), this, SLOT(save()) ); connect(m_editor->initialConditions, &InitialConditionsEditor::dataChanged, this, &FunctionEditor::save);
//END connect up all editing widgets //END connect up all editing widgets
connect( XParser::self(), SIGNAL(functionAdded(int)), this, SLOT(functionsChanged()) ); connect(XParser::self(), &XParser::functionAdded, this, &FunctionEditor::functionsChanged);
connect( XParser::self(), SIGNAL(functionRemoved(int)), this, SLOT(functionsChanged()) ); connect(XParser::self(), &XParser::functionRemoved, this, &FunctionEditor::functionsChanged);
m_editor->createNewPlot->setMenu( createNewPlotsMenu ); m_editor->createNewPlot->setMenu( createNewPlotsMenu );
......
...@@ -49,9 +49,9 @@ FunctionTools::FunctionTools(QWidget *parent ) ...@@ -49,9 +49,9 @@ FunctionTools::FunctionTools(QWidget *parent )
init( CalculateArea ); init( CalculateArea );
connect( m_widget->min, SIGNAL(editingFinished()), this, SLOT(rangeEdited()) ); connect(m_widget->min, &EquationEdit::editingFinished, this, &FunctionTools::rangeEdited);
connect( m_widget->max, SIGNAL(editingFinished()), this, SLOT(rangeEdited()) ); connect(m_widget->max, &EquationEdit::editingFinished, this, &FunctionTools::rangeEdited);
connect( m_widget->list, SIGNAL(currentRowChanged(int)), this, SLOT(equationSelected(int)) ); connect(m_widget->list, &QListWidget::currentRowChanged, this, &FunctionTools::equationSelected);
} }
......
...@@ -231,7 +231,7 @@ QWidget * InitialConditionsDelegate::createEditor( QWidget * parent, const QStyl ...@@ -231,7 +231,7 @@ QWidget * InitialConditionsDelegate::createEditor( QWidget * parent, const QStyl
return 0; return 0;
m_lastEditor = new EquationEdit( parent ); m_lastEditor = new EquationEdit( parent );
connect( m_lastEditor, SIGNAL(returnPressed()), this, SLOT(equationEditDone()) ); connect(m_lastEditor, &EquationEdit::returnPressed, this, &InitialConditionsDelegate::equationEditDone);
m_lastEditor->setFocus(); m_lastEditor->setFocus();
return m_lastEditor; return m_lastEditor;
} }
...@@ -274,14 +274,14 @@ InitialConditionsEditor::InitialConditionsEditor( QWidget * parent ) ...@@ -274,14 +274,14 @@ InitialConditionsEditor::InitialConditionsEditor( QWidget * parent )
setupUi( this ); setupUi( this );
layout()->setMargin( 0 ); layout()->setMargin( 0 );
connect( addButton, SIGNAL(clicked()), this, SLOT(add()) ); connect(addButton, &QPushButton::clicked, this, &InitialConditionsEditor::add);
connect( removeButton, SIGNAL(clicked()), this, SLOT(remove()) ); connect(removeButton, &QPushButton::clicked, this, &InitialConditionsEditor::remove);
m_model = new InitialConditionsModel( this ); m_model = new InitialConditionsModel( this );
view->setModel( m_model ); view->setModel( m_model );
view->setItemDelegate( new InitialConditionsDelegate( this ) ); view->setItemDelegate( new InitialConditionsDelegate( this ) );
connect( m_model, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), this, SIGNAL(dataChanged()) ); connect(m_model, &InitialConditionsModel::dataChanged, this, &InitialConditionsEditor::dataChanged);
} }
......
...@@ -164,7 +164,7 @@ void KmPlot::setupActions() ...@@ -164,7 +164,7 @@ void KmPlot::setupActions()
m_fullScreen = KStandardAction::fullScreen( NULL, NULL, this, actionCollection()); m_fullScreen = KStandardAction::fullScreen( NULL, NULL, this, actionCollection());
actionCollection()->addAction("fullscreen", m_fullScreen); actionCollection()->addAction("fullscreen", m_fullScreen);
connect( m_fullScreen, SIGNAL( toggled( bool )), this, SLOT( slotUpdateFullScreen( bool ))); connect(m_fullScreen, &KToggleFullScreenAction::toggled, this, &KmPlot::slotUpdateFullScreen);
} }
void KmPlot::fileNew() void KmPlot::fileNew()
...@@ -258,7 +258,7 @@ void KmPlot::setupStatusBar() ...@@ -258,7 +258,7 @@ void KmPlot::setupStatusBar()
m_progressBar = new KmPlotProgress( statusBar ); m_progressBar = new KmPlotProgress( statusBar );
m_progressBar->setMaximumHeight( statusBar->height()-10 ); m_progressBar->setMaximumHeight( statusBar->height()-10 );
connect( m_progressBar, SIGNAL (cancelDraw() ), this, SLOT( cancelDraw() ) ); connect(m_progressBar, &KmPlotProgress::cancelDraw, this, &KmPlot::cancelDraw);
statusBar->addWidget(m_progressBar); statusBar->addWidget(m_progressBar);
} }
......
...@@ -40,7 +40,7 @@ KmPlotProgress::KmPlotProgress( QWidget* parent ) : QWidget( parent ) ...@@ -40,7 +40,7 @@ KmPlotProgress::KmPlotProgress( QWidget* parent ) : QWidget( parent )
m_button->setIcon( QIcon::fromTheme( "process-stop" ) ); m_button->setIcon( QIcon::fromTheme( "process-stop" ) );
m_button->setGeometry( QRect( 0, 0, 30, 23 ) ); m_button->setGeometry( QRect( 0, 0, 30, 23 ) );
m_button->setMaximumHeight(height()-10); m_button->setMaximumHeight(height()-10);
connect( m_button, SIGNAL(clicked()), this, SIGNAL(cancelDraw()) ); connect(m_button, &QPushButton::clicked, this, &KmPlotProgress::cancelDraw);
m_progress = new QProgressBar(this); m_progress = new QProgressBar(this);
m_progress->setGeometry( QRect( 30, 0, 124, 23 ) ); m_progress->setGeometry( QRect( 30, 0, 124, 23 ) );
...@@ -48,7 +48,7 @@ KmPlotProgress::KmPlotProgress( QWidget* parent ) : QWidget( parent ) ...@@ -48,7 +48,7 @@ KmPlotProgress::KmPlotProgress( QWidget* parent ) : QWidget( parent )
m_showTimer = new QTimer( this ); m_showTimer = new QTimer( this );
m_showTimer->setSingleShot( true ); m_showTimer->setSingleShot( true );
connect( m_showTimer, SIGNAL(timeout()), this, SLOT(showProgressBar()) ); connect(m_showTimer, &QTimer::timeout, this, &KmPlotProgress::showProgressBar);
hide(); hide();
setMinimumWidth(154); setMinimumWidth(154);
......
...@@ -63,22 +63,22 @@ KParameterEditor::KParameterEditor( QList<Value> *l, QWidget *parent ) ...@@ -63,22 +63,22 @@ KParameterEditor::KParameterEditor( QList<Value> *l, QWidget *parent )
m_mainWidget->list->setFocusPolicy( Qt::NoFocus ); m_mainWidget->list->setFocusPolicy( Qt::NoFocus );
connect( m_mainWidget->value, SIGNAL(upPressed()), this, SLOT(prev()) ); connect(m_mainWidget->value, &EquationEdit::upPressed, this, &KParameterEditor::prev);
connect( m_mainWidget->value, SIGNAL(downPressed()), this, SLOT(next()) ); connect(m_mainWidget->value, &EquationEdit::downPressed, this, &KParameterEditor::next);
foreach ( const Value &v, *m_parameter ) foreach ( const Value &v, *m_parameter )
m_mainWidget->list->addItem( v.expression() ); m_mainWidget->list->addItem( v.expression() );
connect( m_mainWidget->cmdNew, SIGNAL( clicked() ), this, SLOT( cmdNew_clicked() )); connect(m_mainWidget->cmdNew, &QPushButton::clicked, this, &KParameterEditor::cmdNew_clicked);
connect( m_mainWidget->cmdDelete, SIGNAL( clicked() ), this, SLOT( cmdDelete_clicked() )); connect(m_mainWidget->cmdDelete, &QPushButton::clicked, this, &KParameterEditor::cmdDelete_clicked);
connect( m_mainWidget->moveUp, SIGNAL(clicked()), this, SLOT(moveUp()) ); connect(m_mainWidget->moveUp, &QPushButton::clicked, this, &KParameterEditor::moveUp);
connect( m_mainWidget->moveDown, SIGNAL(clicked()), this, SLOT(moveDown()) ); connect(m_mainWidget->moveDown, &QPushButton::clicked, this, &KParameterEditor::moveDown);
connect( m_mainWidget->cmdImport, SIGNAL( clicked() ), this, SLOT( cmdImport_clicked() )); connect(m_mainWidget->cmdImport, &QPushButton::clicked, this, &KParameterEditor::cmdImport_clicked);
connect( m_mainWidget->cmdExport, SIGNAL( clicked() ), this, SLOT( cmdExport_clicked() )); connect(m_mainWidget->cmdExport, &QPushButton::clicked, this, &KParameterEditor::cmdExport_clicked);
connect( m_mainWidget->list, SIGNAL(currentItemChanged( QListWidgetItem *, QListWidgetItem * )), this, SLOT(selectedConstantChanged( QListWidgetItem * )) ); connect(m_mainWidget->list, &QListWidget::currentItemChanged, this, &KParameterEditor::selectedConstantChanged);
connect( m_mainWidget->value, SIGNAL( textEdited( const QString & ) ), this, SLOT( saveCurrentValue() ) ); connect(m_mainWidget->value, &EquationEdit::textEdited, this, &KParameterEditor::saveCurrentValue);
connect( m_mainWidget->value, SIGNAL( textChanged( const QString & ) ), this, SLOT( checkValueValid() ) ); connect(m_mainWidget->value, &EquationEdit::textChanged, this, &KParameterEditor::checkValueValid);
connect( m_mainWidget->value, SIGNAL( returnPressed() ), m_mainWidget->cmdNew, SLOT( animateClick() ) ); connect( m_mainWidget->value, SIGNAL( returnPressed() ), m_mainWidget->cmdNew, SLOT( animateClick() ) );
checkValueValid(); checkValueValid();
......
...@@ -49,9 +49,9 @@ SliderWidget::SliderWidget( QWidget *parent, int number ) ...@@ -49,9 +49,9 @@ SliderWidget::SliderWidget( QWidget *parent, int number )
max->setText( group.readEntry( "max", "10" ) ); max->setText( group.readEntry( "max", "10" ) );
slider->setValue( group.readEntry( "value", 500 ) ); slider->setValue( group.readEntry( "value", 500 ) );
connect( slider, SIGNAL(valueChanged(int)), this, SLOT(updateValue()) ); connect(slider, &QSlider::valueChanged, this, &SliderWidget::updateValue);
connect( min, SIGNAL(editingFinished()), this, SLOT(updateValue()) ); connect(min, &EquationEdit::editingFinished, this, &SliderWidget::updateValue);
connect( max, SIGNAL(editingFinished()), this, SLOT(updateValue()) ); connect(max, &EquationEdit::editingFinished, this, &SliderWidget::updateValue);
updateValue(); updateValue();
} }
......
...@@ -76,7 +76,7 @@ int main( int argc, char **argv ) ...@@ -76,7 +76,7 @@ int main( int argc, char **argv )
QApplication qapp(KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv()); QApplication qapp(KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv());
KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); KCmdLineArgs* args = KCmdLineArgs::parsedArgs();
new KmPlot( args ); new KmPlot( args );
QObject::connect(&qapp, SIGNAL(lastWindowClosed()), &qapp, SLOT(quit())); QObject::connect(&qapp, &QApplication::lastWindowClosed, &qapp, &QApplication::quit);
return qapp.exec(); return qapp.exec();
} }
...@@ -71,7 +71,7 @@ ParameterAnimator::ParameterAnimator( QWidget * parent, Function * function ) ...@@ -71,7 +71,7 @@ ParameterAnimator::ParameterAnimator( QWidget * parent, Function * function )
m_widget->warningLabel->hide(); m_widget->warningLabel->hide();
m_timer = new QTimer( this ); m_timer = new QTimer( this );
connect( m_timer, SIGNAL(timeout()), this, SLOT(step()) ); connect(m_timer, &QTimer::timeout, this, &ParameterAnimator::step);
m_widget->gotoInitial->setIcon( QIcon::fromTheme( "go-first" ) ); m_widget->gotoInitial->setIcon( QIcon::fromTheme( "go-first" ) );
m_widget->gotoFinal->setIcon( QIcon::fromTheme( "go-last" ) ); m_widget->gotoFinal->setIcon( QIcon::fromTheme( "go-last" ) );
...@@ -79,17 +79,17 @@ ParameterAnimator::ParameterAnimator( QWidget * parent, Function * function ) ...@@ -79,17 +79,17 @@ ParameterAnimator::ParameterAnimator( QWidget * parent, Function * function )
m_widget->stepForwards->setIcon( QIcon::fromTheme( "go-next" ) ); m_widget->stepForwards->setIcon( QIcon::fromTheme( "go-next" ) );
m_widget->pause->setIcon( QIcon::fromTheme( "media-playback-pause" ) ); m_widget->pause->setIcon( QIcon::fromTheme( "media-playback-pause" ) );
connect( m_widget->gotoInitial, SIGNAL(clicked()), this, SLOT(gotoInitial()) ); connect(m_widget->gotoInitial, &QToolButton::clicked, this, &ParameterAnimator::gotoInitial);
connect( m_widget->gotoFinal, SIGNAL(clicked()), this, SLOT(gotoFinal()) ); connect(m_widget->gotoFinal, &QToolButton::clicked, this, &ParameterAnimator::gotoFinal);
connect( m_widget->stepBackwards, SIGNAL(toggled(bool)), this, SLOT(stepBackwards(bool)) ); connect(m_widget->stepBackwards, &QToolButton::toggled, this, &ParameterAnimator::stepBackwards);
connect( m_widget->stepForwards, SIGNAL(toggled(bool)), this, SLOT(stepForwards(bool)) ); connect(m_widget->stepForwards, &QToolButton::toggled, this, &ParameterAnimator::stepForwards);
connect( m_widget->pause, SIGNAL(clicked()), this, SLOT(pause()) ); connect(m_widget->pause, &QToolButton::clicked, this, &ParameterAnimator::pause);
connect( m_widget->speed, SIGNAL(valueChanged(int)), this, SLOT(updateSpeed()) ); connect(m_widget->speed, &QSlider::valueChanged, this, &ParameterAnimator::updateSpeed);
updateUI(); updateUI();
updateFunctionParameter(); updateFunctionParameter();
connect( this, SIGNAL(finished()), this, SLOT(deleteLater()) ); connect(this, &ParameterAnimator::finished, this, &ParameterAnimator::deleteLater);
} }
......
...@@ -38,9 +38,9 @@ ParametersWidget::ParametersWidget( QWidget * parent ) ...@@ -38,9 +38,9 @@ ParametersWidget::ParametersWidget( QWidget * parent )
for( int number = 0; number < SLIDER_COUNT; number++ ) for( int number = 0; number < SLIDER_COUNT; number++ )
listOfSliders->addItem( i18n( "Slider No. %1", number +1) ); listOfSliders->addItem( i18n( "Slider No. %1", number +1) );
connect( editParameterListButton, SIGNAL(clicked()), this, SLOT(editParameterList()) ); connect(editParameterListButton, &QPushButton::clicked, this, &ParametersWidget::editParameterList);
connect( useSlider, SIGNAL(toggled(bool)), this, SLOT(updateEquationEdits()) ); connect(useSlider, &QCheckBox::toggled, this, &ParametersWidget::updateEquationEdits);
connect( useList, SIGNAL(toggled(bool)), this, SLOT(updateEquationEdits()) ); connect(useList, &QCheckBox::toggled, this, &ParametersWidget::updateEquationEdits);
} }
......
...@@ -58,7 +58,7 @@ PlotStyleWidget::PlotStyleWidget( QWidget * parent ) ...@@ -58,7 +58,7 @@ PlotStyleWidget::PlotStyleWidget( QWidget * parent )
m_color = new KColorButton( this ); m_color = new KColorButton( this );
QPushButton *advancedButton = new QPushButton( this ); QPushButton *advancedButton = new QPushButton( this );
advancedButton->setText( i18n("Advanced...") ); advancedButton->setText( i18n("Advanced...") );
connect( advancedButton, SIGNAL(clicked()), this, SLOT(advancedOptions()) ); connect(advancedButton, &QPushButton::clicked, this, &PlotStyleWidget::advancedOptions);
QHBoxLayout *layout = new QHBoxLayout; QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget( new QLabel( i18n("Color:"), this ) ); layout->addWidget( new QLabel( i18n("Color:"), this ) );
...@@ -80,8 +80,8 @@ PlotStyleWidget::PlotStyleWidget( QWidget * parent ) ...@@ -80,8 +80,8 @@ PlotStyleWidget::PlotStyleWidget( QWidget * parent )
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true); okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return); okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, SIGNAL(accepted()), m_dialog, SLOT(accept())); connect(buttonBox, &QDialogButtonBox::accepted, m_dialog, &QDialog::accept);
connect(buttonBox, SIGNAL(rejected()), m_dialog, SLOT(reject())); connect(buttonBox, &QDialogButtonBox::rejected, m_dialog, &QDialog::reject);
mainLayout->addWidget(buttonBox); mainLayout->addWidget(buttonBox);
} }
......
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