Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_input_button.h
Go to the documentation of this file.
1/*
2 * This file is part of the KDE project
3 * SPDX-FileCopyrightText: 2013 Arjen Hiemstra <ahiemstra@heimr.nl>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef KISINPUTBUTTON_H
9#define KISINPUTBUTTON_H
10
11#include <QPushButton>
12
14
23class KisInputButton : public QPushButton
24{
25 Q_OBJECT
26public:
35
39 explicit KisInputButton(QWidget *parent = nullptr);
43 ~KisInputButton() override;
44
48 ButtonType type() const;
54 void setType(ButtonType newType);
55
59 QList<Qt::Key> keys() const;
70 void setKeys(const QList<Qt::Key> &newKeys);
71
75 Qt::MouseButtons buttons() const;
86 void setButtons(Qt::MouseButtons newButtons);
87
103
104public Q_SLOTS:
108 void clear();
109
110Q_SIGNALS:
115
116protected:
117 void mousePressEvent(QMouseEvent *event) override;
118 void mouseReleaseEvent(QMouseEvent *) override;
119 void wheelEvent(QWheelEvent *event) override;
120 void keyPressEvent(QKeyEvent *event) override;
121 void keyReleaseEvent(QKeyEvent *event) override;
122
123private Q_SLOTS:
124 void reset();
125
126private:
127 class Private;
128 Private *const d {nullptr};
129};
130
131#endif // KISINPUTBUTTON_H
A button that can detect input and will store its value.
Qt::MouseButtons buttons() const
void setButtons(Qt::MouseButtons newButtons)
~KisInputButton() override
void setType(ButtonType newType)
void keyPressEvent(QKeyEvent *event) override
Private *const d
void mousePressEvent(QMouseEvent *event) override
KisInputButton(QWidget *parent=nullptr)
void setKeys(const QList< Qt::Key > &newKeys)
@ WheelType
Detect and store mouse wheel movement.
@ MouseType
Detect and store any combination of pressed mouse buttons.
@ KeyType
Detect and store any combination of key presses.
void mouseReleaseEvent(QMouseEvent *) override
KisShortcutConfiguration::MouseWheelMovement wheel() const
ButtonType type() const
void wheelEvent(QWheelEvent *event) override
void dataChanged()
void setWheel(KisShortcutConfiguration::MouseWheelMovement wheel)
void keyReleaseEvent(QKeyEvent *event) override
QList< Qt::Key > keys() const