Commit 28a80aba authored by David Redondo's avatar David Redondo 🏎
Browse files

Rewrite KKeySequenceWidget to use KeySequenceRecorder

Use the new KeySequenceRecorder which was created for this purpose. This
has the benefit of simplifying the logic. While at it I sorted functions
and unified method naming which additionally helps in following what this
class does.
CCBUG:407395
parent 70f5dfdf
......@@ -50,6 +50,7 @@ find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5ItemViews ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5ConfigWidgets ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5GuiAddons ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5I18n ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5IconThemes ${KF5_DEP_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_DEP_VERSION} REQUIRED)
......
......@@ -105,6 +105,7 @@ PRIVATE
Qt5::PrintSupport #QPrinter in kshortcutseditor
Qt5::CorePrivate #QSystemLocale in initializeLanguages
KF5::CoreAddons #KAboutData
KF5::GuiAddons
KF5::WidgetsAddons
KF5::ItemViews #KWidgetItemDelegate in KAboutApplicationPersonListDelegate
KF5::I18n #i18n and i18nc in many places
......
This diff is collapsed.
/*
This file is part of the KDE libraries
SPDX-FileCopyrightText: 2001, 2002 Ellis Whitehead <ellis@kde.org>
SPDX-FileCopyrightText: 2007 Andreas Hartmetz <ahartmetz@gmail.com>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#ifndef KKEYSEQUENCEWIDGET_P_H
#define KKEYSEQUENCEWIDGET_P_H
#include <QPushButton>
class KKeySequenceWidgetPrivate;
class KKeySequenceButton: public QPushButton
{
Q_OBJECT
public:
explicit KKeySequenceButton(KKeySequenceWidgetPrivate *d, QWidget *parent)
: QPushButton(parent),
d(d) {}
virtual ~KKeySequenceButton();
protected:
/**
* Reimplemented for internal reasons.
*/
bool event(QEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
private:
KKeySequenceWidgetPrivate *const d;
};
#endif //KKEYSEQUENCEWIDGET_P_H
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