Commit c81e703f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile with qt5.15

parent 49c2d061
......@@ -99,10 +99,10 @@ NoteAlarmDialog::NoteAlarmDialog(const QString &caption, QWidget *parent)
layout->addWidget(at);
d->m_buttons->addButton(label_at, 1);
connect(d->m_buttons, qOverload<int>(&QButtonGroup::buttonClicked), this, &NoteAlarmDialog::slotButtonChanged);
connect(d->m_buttons, qOverload<QAbstractButton *>(&QButtonGroup::buttonClicked), this, &NoteAlarmDialog::slotButtonChanged);
connect(okButton, &QPushButton::clicked, this, &NoteAlarmDialog::accept);
d->m_buttons->button(0)->setChecked(true);
slotButtonChanged(d->m_buttons->checkedId());
slotButtonChanged(d->m_buttons->checkedButton());
mainLayout->addWidget(page);
mainLayout->addWidget(buttonBox);
}
......@@ -121,20 +121,23 @@ void NoteAlarmDialog::setAlarm(const QDateTime &dateTime)
} else {
d->m_buttons->button(0)->setChecked(true);
}
slotButtonChanged(d->m_buttons->checkedId());
slotButtonChanged(d->m_buttons->checkedButton());
}
void NoteAlarmDialog::slotButtonChanged(int id)
void NoteAlarmDialog::slotButtonChanged(QAbstractButton *button)
{
switch (id) {
case 0:
d->m_atDate->setEnabled(false);
d->m_atTime->setEnabled(false);
break;
case 1:
d->m_atDate->setEnabled(true);
d->m_atTime->setEnabled(true);
break;
if (button) {
const int id = d->m_buttons->id(button);
switch (id) {
case 0:
d->m_atDate->setEnabled(false);
d->m_atTime->setEnabled(false);
break;
case 1:
d->m_atDate->setEnabled(true);
d->m_atTime->setEnabled(true);
break;
}
}
}
......
......@@ -35,6 +35,7 @@
#include <QDialog>
#include "noteshared_export.h"
class QDateTime;
class QAbstractButton;
namespace NoteShared {
class NoteAlarmDialogPrivate;
class NOTESHARED_EXPORT NoteAlarmDialog : public QDialog
......@@ -47,7 +48,7 @@ public:
Q_REQUIRED_RESULT QDateTime alarm() const;
private:
void slotButtonChanged(int);
void slotButtonChanged(QAbstractButton *button);
NoteAlarmDialogPrivate *const d;
};
}
......
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