QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
qpushbuttonshowpassword.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
8#ifndef SRC_QPUSHBUTTONSHOWPASSWORD_H_
9#define SRC_QPUSHBUTTONSHOWPASSWORD_H_
10
11#include <QLineEdit>
12#include <QPushButton>
13
14class QWidget;
28class QPushButtonShowPassword : public QPushButton {
29 Q_OBJECT
30
31public:
37 explicit QPushButtonShowPassword(QLineEdit *line, QWidget *parent = nullptr);
38
39private slots:
45 void buttonClicked(bool checked);
46
47private:
49 QIcon iconEdit;
54 QLineEdit *line;
55};
56
57#endif // SRC_QPUSHBUTTONSHOWPASSWORD_H_
QPushButtonShowPassword(QLineEdit *line, QWidget *parent=nullptr)
Construct a show-password button linked to the given QLineEdit.
QIcon iconEditPushed
view-hidden icon shown while the password is revealed.
QIcon iconEdit
view-visible icon shown while the password is hidden.
void buttonClicked(bool checked)
Connected to QPushButton::clicked(bool); flips the echo mode of line and updates icon,...
QLineEdit * line
The line edit being toggled; owned by the caller, must outlive this button.