QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
qpushbuttonwithclipboard.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2016 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
3#ifndef SRC_QPUSHBUTTONWITHCLIPBOARD_H_
4#define SRC_QPUSHBUTTONWITHCLIPBOARD_H_
5
6#include <QPushButton>
7
12class QWidget;
20
27
32
37
42
46
52class QPushButtonWithClipboard : public QPushButton {
53 Q_OBJECT
54
55public:
56 explicit QPushButtonWithClipboard(QString textToCopy = "",
57 QWidget *parent = nullptr);
58
59 [[nodiscard]] auto getTextToCopy() const -> QString;
60 void setTextToCopy(const QString &value);
61
62signals:
63 void clicked(const QString &);
64
65private slots:
66 void changeIconDefault();
67 void buttonClicked(bool);
68
69private:
70 QString textToCopy;
71 QIcon iconEdit;
72 QIcon iconEditPushed;
73};
74
75#endif // SRC_QPUSHBUTTONWITHCLIPBOARD_H_
void setTextToCopy(const QString &value)
QPushButtonWithClipboard::setTextToCopy sets text from associated text field.
void clicked(const QString &)
QPushButtonWithClipboard(QString textToCopy="", QWidget *parent=nullptr)
QPushButtonWithClipboard::QPushButtonWithClipboard basic constructor.
auto getTextToCopy() const -> QString
QPushButtonWithClipboard::getTextToCopy returns the text of associated text field.