Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt: Replace deprecated Qt functions #2316

Merged
merged 4 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/qt/addresstablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ QVariant AddressTableModel::headerData(int section, Qt::Orientation orientation,
Qt::ItemFlags AddressTableModel::flags(const QModelIndex &index) const
{
if(!index.isValid())
return nullptr;
return Qt::NoItemFlags;
AddressTableEntry *rec = static_cast<AddressTableEntry*>(index.internalPointer());

Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
Expand Down
7 changes: 6 additions & 1 deletion src/qt/bitcoinamountfield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ BitcoinAmountField::BitcoinAmountField(QWidget* parent) : QWidget(parent), amoun
setFocusProxy(amount);

// If one of the widgets changes, the combined content changes as well
connect(amount, static_cast<void (QDoubleSpinBox::*)(const QString&)>(&QDoubleSpinBox::valueChanged),
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
connect(amount, static_cast<void (QDoubleSpinBox::*)(const QString&)>(&QDoubleSpinBox::textChanged),
this, &BitcoinAmountField::textChanged);
#else
connect(amount, static_cast<void (QDoubleSpinBox::*)(const QString&)>(&QDoubleSpinBox::valueChanged),
this, &BitcoinAmountField::textChanged);
#endif
connect(unit, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &BitcoinAmountField::unitChanged);


Expand Down
7 changes: 6 additions & 1 deletion src/qt/researcher/researcherwizardmodedetailpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ void ResearcherWizardModeDetailPage::initializePage()
ui->modeButtonGroup->setId(ui->poolRadioButton, ResearcherWizard::ModePool);
ui->modeButtonGroup->setId(ui->investorRadioButton, ResearcherWizard::ModeInvestor);

connect(ui->modeButtonGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
connect(ui->modeButtonGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::idClicked),
this, &ResearcherWizardModeDetailPage::onModeChange);
#else
connect(ui->modeButtonGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),
this, &ResearcherWizardModeDetailPage::onModeChange);
#endif

if (m_researcher_model->configuredForInvestorMode()) {
ui->investorRadioButton->setChecked(true);
Expand Down
11 changes: 8 additions & 3 deletions src/qt/voting/pollwizardtypepage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ PollWizardTypePage::PollWizardTypePage(QWidget* parent)
registerField("pollType*", type_proxy);
setField("pollType", PollTypes::PollTypeUnknown);

connect(
m_type_buttons, QOverload<QAbstractButton*>::of(&QButtonGroup::buttonClicked),
[=](QAbstractButton*) { type_proxy->setValue(m_type_buttons->checkedId()); });
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
connect(
m_type_buttons, QOverload<QAbstractButton*>::of(&QButtonGroup::buttonClicked),
[=](QAbstractButton*) { type_proxy->setValue(m_type_buttons->checkedId()); });
#else
connect(m_type_buttons, &QButtonGroup::idClicked,
this, [=] { type_proxy->setValue(m_type_buttons->checkedId()); });
#endif
}

PollWizardTypePage::~PollWizardTypePage()
Expand Down
10 changes: 7 additions & 3 deletions src/qt/voting/votewizardballotpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ VoteWizardBallotPage::VoteWizardBallotPage(QWidget *parent)
registerField("txid", new DummyField(this), "", "");
registerField("responseLabels", new DummyField(this));

connect(
m_choice_buttons.get(), QOverload<QAbstractButton*>::of(&QButtonGroup::buttonClicked),
[this](QAbstractButton*) { emit completeChanged(); });
#if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0))
connect(
m_choice_buttons.get(), QOverload<QAbstractButton*>::of(&QButtonGroup::buttonClicked),
[this](QAbstractButton*) { emit completeChanged(); });
#else
connect(m_choice_buttons.get(), &QButtonGroup::idClicked, this, [=] { emit completeChanged(); });
#endif
}

VoteWizardBallotPage::~VoteWizardBallotPage()
Expand Down