Skip to content

Commit

Permalink
And the final set of what is easily converted to qt5 style connect calls
Browse files Browse the repository at this point in the history
  • Loading branch information
brianrower committed Jan 27, 2017
1 parent cb19447 commit c2c2d55
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/RefractoDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RefractoDialog::RefractoDialog(QWidget* parent) : QDialog(parent)
{
setupUi(this);

connect( pushButton_calculate, SIGNAL( clicked() ), this, SLOT( calculate() ) );
connect( pushButton_calculate, &QAbstractButton::clicked, this, &RefractoDialog::calculate );
}

RefractoDialog::~RefractoDialog()
Expand Down
2 changes: 1 addition & 1 deletion src/StrikeWaterDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const double StrikeWaterDialog::specificHeatBarley = 0.41;
StrikeWaterDialog::StrikeWaterDialog(QWidget* parent) : QDialog(parent)
{
setupUi(this);
connect(pushButton_calculate, SIGNAL(clicked()), this, SLOT(calculate()));
connect(pushButton_calculate, &QAbstractButton::clicked, this, &StrikeWaterDialog::calculate);
}

StrikeWaterDialog::~StrikeWaterDialog() {}
Expand Down
4 changes: 2 additions & 2 deletions src/StyleButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void StyleButton::setRecipe(Recipe* rec)
_rec = rec;
if( _rec )
{
connect( _rec, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(recChanged(QMetaProperty,QVariant)) );
connect( _rec, &BeerXMLElement::changed, this, &StyleButton::recChanged );
setStyle( _rec->style() );
}
else
Expand All @@ -55,7 +55,7 @@ void StyleButton::setStyle(Style* style)
_style = style;
if( _style )
{
connect( _style, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(styleChanged(QMetaProperty,QVariant)) );
connect( _style, &BeerXMLElement::changed, this, &StyleButton::styleChanged );
setText( _style->name() );
}
else
Expand Down
8 changes: 4 additions & 4 deletions src/StyleEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ StyleEditor::StyleEditor(QWidget* parent, bool singleStyleEditor)
styleProxyModel->setSourceModel(styleListModel);
styleComboBox->setModel(styleProxyModel);

connect( pushButton_save, SIGNAL( clicked() ), this, SLOT( save() ) );
connect( pushButton_save, &QAbstractButton::clicked, this, &StyleEditor::save );
connect( pushButton_new, SIGNAL( clicked() ), this, SLOT( newStyle() ) );
connect( pushButton_cancel, SIGNAL( clicked() ), this, SLOT( clearAndClose() ) );
connect( pushButton_remove, SIGNAL( clicked() ), this, SLOT(removeStyle()) );
connect( pushButton_cancel, &QAbstractButton::clicked, this, &StyleEditor::clearAndClose );
connect( pushButton_remove, &QAbstractButton::clicked, this, &StyleEditor::removeStyle );
connect( styleComboBox, SIGNAL(activated( const QString& )), this, SLOT( styleSelected(const QString&) ) );

setStyle( styleListModel->at(styleComboBox->currentIndex()));
Expand All @@ -66,7 +66,7 @@ void StyleEditor::setStyle( Style* s )
obsStyle = s;
if( obsStyle )
{
connect( obsStyle, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(changed(QMetaProperty,QVariant)) );
connect( obsStyle, &BeerXMLElement::changed, this, &StyleEditor::changed );
showChanges();
}

Expand Down
6 changes: 3 additions & 3 deletions src/StyleListModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
StyleListModel::StyleListModel(QWidget* parent)
: QAbstractListModel(parent), recipe(0)
{
connect( &(Database::instance()), SIGNAL(newStyleSignal(Style*)), this, SLOT(addStyle(Style*)) );
connect( &(Database::instance()), &Database::newStyleSignal, this, &StyleListModel::addStyle );
connect( &(Database::instance()), SIGNAL(deletedSignal(Style*)), this, SLOT(removeStyle(Style*)) );
repopulateList();
}
Expand All @@ -41,7 +41,7 @@ void StyleListModel::addStyle(Style* s)
int size = styles.size();
beginInsertRows( QModelIndex(), size, size );
styles.append(s);
connect( s, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(styleChanged(QMetaProperty,QVariant)) );
connect( s, &BeerXMLElement::changed, this, &StyleListModel::styleChanged );
endInsertRows();
}
}
Expand All @@ -64,7 +64,7 @@ void StyleListModel::addStyles(QList<Style*> s)
styles.append(tmp);

for( i = tmp.begin(); i != tmp.end(); i++ )
connect( *i, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(styleChanged(QMetaProperty,QVariant)) );
connect( *i, &BeerXMLElement::changed, this, &StyleListModel::styleChanged );

endInsertRows();
}
Expand Down
4 changes: 2 additions & 2 deletions src/TimerMainDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ TimerMainDialog::TimerMainDialog(MainWindow* parent) : QDialog(parent),
updateTime();

//Connections
connect(boilTime, SIGNAL(BoilTimeChanged()), this, SLOT(decrementTimer()));
connect(boilTime, SIGNAL(timesUp()), this, SLOT(timesUp()));
connect(boilTime, &BoilTime::BoilTimeChanged, this, &TimerMainDialog::decrementTimer);
connect(boilTime, &BoilTime::timesUp, this, &TimerMainDialog::timesUp);

retranslateUi(this);
}
Expand Down
4 changes: 2 additions & 2 deletions src/TimerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ TimerWidget::TimerWidget(TimerMainDialog *parent, BoilTime* bt) :
retranslateUi(this);

//Connections
connect(boilTime, SIGNAL(BoilTimeChanged()), this, SLOT(decrementTime()));
connect(boilTime, SIGNAL(timesUp()), this, SLOT(decrementTime()));
connect(boilTime, &BoilTime::BoilTimeChanged, this, &TimerWidget::decrementTime);
connect(boilTime, &BoilTime::timesUp, this, &TimerWidget::decrementTime);
}

TimerWidget::~TimerWidget()
Expand Down
2 changes: 1 addition & 1 deletion src/WaterEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void WaterEditor::setWater(Water *water)
obs = water;
if( obs )
{
connect( obs, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(changed(QMetaProperty,QVariant)) );
connect( obs, &BeerXMLElement::changed, this, &WaterEditor::changed );
showChanges();
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/WaterTableModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void WaterTableModel::observeRecipe(Recipe* rec)
recObs = rec;
if( recObs )
{
connect( recObs, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(changed(QMetaProperty,QVariant)) );
connect( recObs, &BeerXMLElement::changed, this, &WaterTableModel::changed );
addWaters( recObs->waters() );
}
}
Expand All @@ -65,7 +65,7 @@ void WaterTableModel::observeDatabase(bool val)
{
observeRecipe(0);
removeAll();
connect( &(Database::instance()), SIGNAL(newWaterSignal(Water*)), this, SLOT(addWater(Water*)) );
connect( &(Database::instance()), &Database::newWaterSignal, this, &WaterTableModel::addWater );
connect( &(Database::instance()), SIGNAL(deletedSignal(Water*)), this, SLOT(removeWater(Water*)) );
addWaters( Database::instance().waters() );
}
Expand Down Expand Up @@ -93,7 +93,7 @@ void WaterTableModel::addWater(Water* water)

beginInsertRows( QModelIndex(), waterObs.size(), waterObs.size() );
waterObs.append(water);
connect( water, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(changed(QMetaProperty,QVariant)) );
connect( water, &BeerXMLElement::changed, this, &WaterTableModel::changed );
endInsertRows();

if(parentTableWidget)
Expand Down Expand Up @@ -121,7 +121,7 @@ void WaterTableModel::addWaters(QList<Water*> waters)
waterObs.append(tmp);

for( i = tmp.begin(); i != tmp.end(); i++ )
connect( *i, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(changed(QMetaProperty,QVariant)) );
connect( *i, &BeerXMLElement::changed, this, &WaterTableModel::changed );

endInsertRows();
}
Expand Down
8 changes: 4 additions & 4 deletions src/YeastDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ YeastDialog::YeastDialog(MainWindow* parent)
yeastTableProxy->setFilterKeyColumn(1);

connect( pushButton_addToRecipe, SIGNAL( clicked() ), this, SLOT( addYeast() ) );
connect( pushButton_edit, SIGNAL( clicked() ), this, SLOT( editSelected() ) );
connect( pushButton_edit, &QAbstractButton::clicked, this, &YeastDialog::editSelected );
connect( pushButton_new, SIGNAL( clicked() ), this, SLOT( newYeast() ) );
connect( pushButton_remove, SIGNAL(clicked()), this, SLOT( removeYeast() ) );
connect( tableWidget, SIGNAL(doubleClicked(const QModelIndex&)), this, SLOT( addYeast(const QModelIndex&) ) );
connect( qLineEdit_searchBox, SIGNAL(textEdited(QString)), this, SLOT(filterYeasts(QString)));
connect( pushButton_remove, &QAbstractButton::clicked, this, &YeastDialog::removeYeast );
connect( tableWidget, &QAbstractItemView::doubleClicked, this, &YeastDialog::addYeast );
connect( qLineEdit_searchBox, &QLineEdit::textEdited, this, &YeastDialog::filterYeasts);

yeastTableModel->observeDatabase(true);

Expand Down
4 changes: 2 additions & 2 deletions src/YeastEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ YeastEditor::YeastEditor( QWidget* parent )
{
setupUi(this);

connect( buttonBox, SIGNAL( accepted() ), this, SLOT( save() ));
connect( buttonBox, SIGNAL( rejected() ), this, SLOT( clearAndClose() ));
connect( buttonBox, &QDialogButtonBox::accepted, this, &YeastEditor::save);
connect( buttonBox, &QDialogButtonBox::rejected, this, &YeastEditor::clearAndClose);
}

void YeastEditor::setYeast( Yeast* y )
Expand Down
10 changes: 5 additions & 5 deletions src/YeastTableModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ YeastTableModel::YeastTableModel(QTableView* parent, bool editable)
parentTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
parentTableWidget->setWordWrap(false);

connect(headerView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(contextMenu(const QPoint&)));
connect(headerView, &QWidget::customContextMenuRequested, this, &YeastTableModel::contextMenu);
}

void YeastTableModel::addYeast(Yeast* yeast)
Expand All @@ -76,7 +76,7 @@ void YeastTableModel::addYeast(Yeast* yeast)
int size = yeastObs.size();
beginInsertRows( QModelIndex(), size, size );
yeastObs.append(yeast);
connect( yeast, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(changed(QMetaProperty,QVariant)) );
connect( yeast, &BeerXMLElement::changed, this, &YeastTableModel::changed );
//reset(); // Tell everybody that the table has changed.
endInsertRows();
}
Expand All @@ -92,7 +92,7 @@ void YeastTableModel::observeRecipe(Recipe* rec)
recObs = rec;
if( recObs )
{
connect( recObs, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(changed(QMetaProperty,QVariant)) );
connect( recObs, &BeerXMLElement::changed, this, &YeastTableModel::changed );
addYeasts( recObs->yeasts() );
}
}
Expand All @@ -104,7 +104,7 @@ void YeastTableModel::observeDatabase(bool val)
observeRecipe(0);

removeAll();
connect( &(Database::instance()), SIGNAL(newYeastSignal(Yeast*)), this, SLOT(addYeast(Yeast*)) );
connect( &(Database::instance()), &Database::newYeastSignal, this, &YeastTableModel::addYeast );
connect( &(Database::instance()), SIGNAL(deletedSignal(Yeast*)), this, SLOT(removeYeast(Yeast*)) );
addYeasts( Database::instance().yeasts() );
}
Expand Down Expand Up @@ -133,7 +133,7 @@ void YeastTableModel::addYeasts(QList<Yeast*> yeasts)
yeastObs.append(tmp);

for( i = tmp.begin(); i != tmp.end(); i++ )
connect( *i, SIGNAL(changed(QMetaProperty,QVariant)), this, SLOT(changed(QMetaProperty,QVariant)) );
connect( *i, &BeerXMLElement::changed, this, &YeastTableModel::changed );

endInsertRows();
}
Expand Down
2 changes: 1 addition & 1 deletion src/boiltime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BoilTime::BoilTime(QObject* parent): QObject(parent),
{
timer = new QTimer(this);
timer->setInterval(1000);
connect(timer, SIGNAL(timeout()), this, SLOT(decrementTime()));
connect(timer, &QTimer::timeout, this, &BoilTime::decrementTime);
}

void BoilTime::setBoilTime(int boilTime)
Expand Down

0 comments on commit c2c2d55

Please sign in to comment.