QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
qpushbuttonasqrcode.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2016 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
7#ifndef SRC_QPUSHBUTTONASQRCODE_H_
8#define SRC_QPUSHBUTTONASQRCODE_H_
9
10#include <QPushButton>
11
23class QWidget;
24class QPushButtonAsQRCode : public QPushButton {
25 Q_OBJECT
26
27public:
33 explicit QPushButtonAsQRCode(QString textToCopy = "",
34 QWidget *parent = nullptr);
35
40 [[nodiscard]] auto getTextToCopy() const -> QString;
45 void setTextToCopy(const QString &value);
46
47signals:
52 void clicked(const QString &text);
53
54private:
60 void buttonClicked(bool checked);
61
62private:
64 QString textToCopy;
66 QIcon iconEdit;
67};
68
69#endif // SRC_QPUSHBUTTONASQRCODE_H_
void buttonClicked(bool checked)
Connected to QPushButton::clicked(bool); re-emits the overload carrying the stored text so receivers ...
void clicked(const QString &text)
Emitted when the button is activated with the current text payload.
QPushButtonAsQRCode(QString textToCopy="", QWidget *parent=nullptr)
Construct a QPushButtonAsQRCode with an optional initial text.
QIcon iconEdit
The qrcode icon shown on the button.
QString textToCopy
Text to be rendered as a QR code; set by the owning panel.
void setTextToCopy(const QString &value)
Update the stored text used for QR-code actions.
auto getTextToCopy() const -> QString
Return the stored text used for QR-code actions.