Skip to content

Commit a461081

Browse files
committed
Qt5 syntax
1 parent 9c93264 commit a461081

33 files changed

+242
-242
lines changed

src/qt/addressbookpage.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
4040
switch(mode)
4141
{
4242
case ForSending:
43-
connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept()));
43+
connect(ui->tableView, &QTableView::doubleClicked, this, &QDialog::accept);
4444
ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);
4545
ui->tableView->setFocus();
4646
break;
@@ -85,18 +85,18 @@ AddressBookPage::AddressBookPage(Mode mode, Tabs tab, QWidget *parent) :
8585
contextMenu->addAction(verifyMessageAction);
8686

8787
// Connect signals for context menu actions
88-
connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyToClipboardButton_clicked()));
89-
connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction()));
90-
connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction()));
91-
connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteButton_clicked()));
92-
connect(showQRCodeAction, SIGNAL(triggered()), this, SLOT(on_showQRCodeButton_clicked()));
93-
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(on_signMessageButton_clicked()));
94-
connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(on_verifyMessageButton_clicked()));
88+
connect(copyAddressAction, &QAction::triggered, this, &AddressBookPage::on_copyToClipboardButton_clicked);
89+
connect(copyLabelAction, &QAction::triggered, this, &AddressBookPage::onCopyLabelAction);
90+
connect(editAction, &QAction::triggered, this, &AddressBookPage::onEditAction);
91+
connect(deleteAction, &QAction::triggered, this, &AddressBookPage::on_deleteButton_clicked);
92+
connect(showQRCodeAction, &QAction::triggered, this, &AddressBookPage::on_showQRCodeButton_clicked);
93+
connect(signMessageAction, &QAction::triggered, this, &AddressBookPage::on_signMessageButton_clicked);
94+
connect(verifyMessageAction, &QAction::triggered, this, &AddressBookPage::on_verifyMessageButton_clicked);
9595

96-
connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
96+
connect(ui->tableView, &QWidget::customContextMenuRequested, this, &AddressBookPage::contextualMenu);
9797

9898
// Pass through accept action from button box
99-
connect(ui->okayButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
99+
connect(ui->okayButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
100100
}
101101

102102
AddressBookPage::~AddressBookPage()
@@ -136,12 +136,12 @@ void AddressBookPage::setModel(AddressTableModel *model)
136136
ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents);
137137
ui->tableView->horizontalHeader()->resizeSection(AddressTableModel::Address, 320);
138138

139-
connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
140-
this, SLOT(selectionChanged()));
139+
connect(ui->tableView->selectionModel(), &QItemSelectionModel::selectionChanged,
140+
this, &AddressBookPage::selectionChanged);
141141

142142
// Select row for newly created address
143-
connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
144-
this, SLOT(selectNewAddress(QModelIndex,int,int)));
143+
connect(model, &AddressTableModel::rowsInserted,
144+
this, &AddressBookPage::selectNewAddress);
145145

146146
selectionChanged();
147147
}

src/qt/askpassphrasedialog.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :
6464
}
6565

6666
textChanged();
67-
connect(ui->oldPassphraseEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
68-
connect(ui->newPassphraseEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
69-
connect(ui->repeatNewPassphraseEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
67+
connect(ui->oldPassphraseEdit, &QLineEdit::textChanged, this, &AskPassphraseDialog::textChanged);
68+
connect(ui->newPassphraseEdit, &QLineEdit::textChanged, this, &AskPassphraseDialog::textChanged);
69+
connect(ui->repeatNewPassphraseEdit, &QLineEdit::textChanged, this, &AskPassphraseDialog::textChanged);
7070
}
7171

7272
AskPassphraseDialog::~AskPassphraseDialog()

src/qt/bitcoin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ int StartGridcoinQt(int argc, char *argv[])
445445
QTimer *timer = new QTimer(guiref);
446446
LogPrintf("Starting Gridcoin");
447447

448-
QObject::connect(timer, SIGNAL(timeout()), guiref, SLOT(timerfire()));
448+
QObject::connect(timer, &QTimer::timeout, guiref, &timerfire);
449449

450450
if (!threads->createThread(ThreadAppInit2,threads,"AppInit2 Thread"))
451451
{

src/qt/bitcoinamountfield.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ BitcoinAmountField::BitcoinAmountField(QWidget *parent):
3838
setFocusProxy(amount);
3939

4040
// If one if the widgets changes, the combined content changes as well
41-
connect(amount, SIGNAL(valueChanged(QString)), this, SIGNAL(textChanged()));
42-
connect(unit, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)));
41+
connect(amount, static_cast<void (QDoubleSpinBox::*)(const QString&)>(&QDoubleSpinBox::textChanged), this, &BitcoinAmountField::textChanged);
42+
connect(unit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &BitcoinAmountField::unitChanged);
4343

4444
// Set default based on configuration
4545
unitChanged(unit->currentIndex());

0 commit comments

Comments
 (0)