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

Use QOverload

parent 0af8b640
......@@ -103,7 +103,7 @@ NoteAlarmDialog::NoteAlarmDialog(const QString &caption, QWidget *parent)
layout->addWidget(at);
d->m_buttons->addButton(label_at, 1);
connect(d->m_buttons, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &NoteAlarmDialog::slotButtonChanged);
connect(d->m_buttons, QOverload<int>::of(&QButtonGroup::buttonClicked), this, &NoteAlarmDialog::slotButtonChanged);
connect(okButton, &QPushButton::clicked, this, &NoteAlarmDialog::accept);
d->m_buttons->button(0)->setChecked(true);
slotButtonChanged(d->m_buttons->checkedId());
......
......@@ -93,7 +93,7 @@ NotesNetworkReceiver::NotesNetworkReceiver(QTcpSocket *s)
// Setup the communications
connect(d->m_sock, &QTcpSocket::readyRead, this, &NotesNetworkReceiver::slotDataAvailable);
connect(d->m_sock, &QTcpSocket::disconnected, this, &NotesNetworkReceiver::slotConnectionClosed);
connect(d->m_sock, static_cast<void (QTcpSocket::*)(QAbstractSocket::SocketError)>(&QTcpSocket::error), this, &NotesNetworkReceiver::slotError);
connect(d->m_sock, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &NotesNetworkReceiver::slotError);
// Setup the timer
d->m_timer = new QTimer(this);
......
......@@ -48,7 +48,7 @@ NotesNetworkSender::NotesNetworkSender(QTcpSocket *socket)
// QObject:: prefix needed, otherwise the KStreamSocket::connect()
// method is called!!!
QObject::connect(m_socket, &QTcpSocket::connected, this, &NotesNetworkSender::slotConnected);
QObject::connect(m_socket, static_cast<void (QTcpSocket::*)(QAbstractSocket::SocketError)>(&QTcpSocket::error), this, &NotesNetworkSender::slotError);
QObject::connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &NotesNetworkSender::slotError);
QObject::connect(m_socket, &QTcpSocket::disconnected, this, &NotesNetworkSender::slotClosed);
QObject::connect(m_socket, &QTcpSocket::bytesWritten, this, &NotesNetworkSender::slotWritten);
}
......
......@@ -154,7 +154,7 @@ KNoteEdit::KNoteEdit(KActionCollection *actions, QWidget *parent)
m_textFont = new KFontAction(i18n("Text Font"), this);
actions->addAction(QStringLiteral("format_font"), m_textFont);
connect(m_textFont, static_cast<void (KFontAction::*)(const QString &)>(&KFontAction::triggered), this, &KNoteEdit::setFontFamily);
connect(m_textFont, QOverload<const QString &>::of(&KFontAction::triggered), this, &KNoteEdit::setFontFamily);
m_textSize = new KFontSizeAction(i18n("Text Size"), this);
actions->addAction(QStringLiteral("format_size"), m_textSize);
......
......@@ -191,8 +191,8 @@ void KNotesSummaryWidget::createNote(const Akonadi::Item &item, int counter)
urlLabel->installEventFilter(this);
urlLabel->setAlignment(Qt::AlignLeft);
urlLabel->setWordWrap(true);
connect(urlLabel, static_cast<void (KUrlLabel::*)(const QString &)>(&KUrlLabel::leftClickedUrl), this, &KNotesSummaryWidget::slotSelectNote);
connect(urlLabel, static_cast<void (KUrlLabel::*)(const QString &)>(&KUrlLabel::rightClickedUrl), this, &KNotesSummaryWidget::slotPopupMenu);
connect(urlLabel, QOverload<const QString &>::of(&KUrlLabel::leftClickedUrl), this, &KNotesSummaryWidget::slotSelectNote);
connect(urlLabel, QOverload<const QString &>::of(&KUrlLabel::rightClickedUrl), this, &KNotesSummaryWidget::slotPopupMenu);
mLayout->addWidget(urlLabel, counter, 1);
......
......@@ -744,7 +744,7 @@ void KNote::createActions()
#if KDEPIM_HAVE_X11
m_toDesktop = new KSelectAction(i18n("To Desktop"), this);
actionCollection()->addAction(QStringLiteral("to_desktop"), m_toDesktop);
connect(m_toDesktop, static_cast<void (KSelectAction::*)(QAction *)>(&KSelectAction::triggered), this, &KNote::slotPopupActionToDesktop);
connect(m_toDesktop, QOverload<QAction *>::of(&KSelectAction::triggered), this, &KNote::slotPopupActionToDesktop);
connect(m_toDesktop->menu(), &QMenu::aboutToShow, this, &KNote::slotUpdateDesktopActions);
// initially populate it, otherwise stays disabled
slotUpdateDesktopActions();
......
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