-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathpasswordlineedit.hpp
More file actions
41 lines (31 loc) · 1.01 KB
/
passwordlineedit.hpp
File metadata and controls
41 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <QLineEdit>
class PasswordLineEdit : public QLineEdit
{
Q_OBJECT
Q_PROPERTY(
bool capsLockWarningEnabled READ capsLockWarningEnabled WRITE setCapsLockWarningEnabled)
public:
explicit PasswordLineEdit(QWidget *parent = nullptr);
~PasswordLineEdit() override;
bool capsLockWarningEnabled() const;
void setCapsLockWarningEnabled(bool enabled);
void setToggleIcons(const QIcon &visibleIcon, const QIcon &hiddenIcon);
void setToolTipDuration(int milliseconds);
public slots:
void togglePasswordVisibility();
protected:
bool eventFilter(QObject *watched, QEvent *event) override;
void focusInEvent(QFocusEvent *event) override;
void focusOutEvent(QFocusEvent *event) override;
private slots:
void onShowPassword(bool visible);
void hideToolTip();
private:
void setupUI();
void setupIcons();
void setupConnections();
void showCapsLockWarning();
class PasswordLineEditPrivate;
QScopedPointer<PasswordLineEditPrivate> d_ptr;
};