KWidgetsAddons
kpasswordlineedit.cpp
40 QIcon visibilityIcon = QIcon::fromTheme(QStringLiteral("visibility"), QIcon(QStringLiteral(":/icons/visibility.svg")));
44 toggleEchoModeAction->setToolTip(QObject::tr("Change the visibility of the password", "@info:tooltip"));
56 toggleEchoModeAction->setVisible(isToggleEchoModeAvailable && (passwordLineEdit->echoMode() == QLineEdit::Normal || !text.isEmpty()));
67 passwordIcon = QIcon::fromTheme(QStringLiteral("hint"), QIcon(QStringLiteral(":/icons/hint.svg")));
72 visibleIcon = QIcon::fromTheme(QStringLiteral("visibility"), QIcon(QStringLiteral(":/icons/visibility.svg")));
87 toggleEchoModeAction->setText(passwordLineEdit->echoMode() == QLineEdit::Password ? QObject::tr("Show Password", "@action:inmenu")
106 connect(d->passwordLineEdit, &QWidget::customContextMenuRequested, this, [this](const QPoint &pos) {
109 connect(d->passwordLineEdit, &QLineEdit::textChanged, this, &KPasswordLineEdit::passwordChanged);
bool isRevealPasswordAvailable() const
Whether the visibility trailing action in the line edit is visible.
Definition kpasswordlineedit.cpp:180
KPassword::RevealMode revealPasswordMode() const
Return when the reveal password button is visible.
Definition kpasswordlineedit.cpp:192
bool isReadOnly() const
Return whether the line edit is read only.
Definition kpasswordlineedit.cpp:163
void setRevealPasswordMode(KPassword::RevealMode revealPasswordMode)
Set when the reveal password button will be visible.
Definition kpasswordlineedit.cpp:186
void setReadOnly(bool readOnly)
Set whether the line edit is read only.
Definition kpasswordlineedit.cpp:158
void setEchoMode(QLineEdit::EchoMode mode)
Change echo mode (QLineEdit::Password by default)
Definition kpasswordlineedit.cpp:148
bool isClearButtonEnabled() const
Inform if we show or not clear button.
Definition kpasswordlineedit.cpp:143
QAction * toggleEchoModeAction() const
Definition kpasswordlineedit.cpp:197
void echoModeChanged(QLineEdit::EchoMode echoMode)
When we click on visibility icon echo mode is switched between Normal echo mode and Password echo mod...
void setRevealPasswordAvailable(bool reveal)
Whether to show the visibility trailing action in the line edit.
Definition kpasswordlineedit.cpp:174
~KPasswordLineEdit() override
Destructs the lineedit password widget.
void setClearButtonEnabled(bool clear)
Show/hide clear button (false by default)
Definition kpasswordlineedit.cpp:138
KPasswordLineEdit(QWidget *parent=nullptr)
Constructs a lineedit password widget.
Definition kpasswordlineedit.cpp:95
void setIcon(const QIcon &icon)
void setText(const QString &text)
void setToolTip(const QString &tip)
void triggered(bool checked)
void setVisible(bool)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
QIcon fromTheme(const QString &name)
bool isNull() const const
void setContentsMargins(const QMargins &margins)
TrailingPosition
Normal
QAction * addAction(const QIcon &icon, ActionPosition position)
QMenu * createStandardContextMenu()
echoMode
void textChanged(const QString &text)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void setObjectName(QAnyStringView name)
QString tr(const char *sourceText, const char *disambiguation, int n)
bool isEmpty() const const
CustomContextMenu
void customContextMenuRequested(const QPoint &pos)
void setFocusPolicy(Qt::FocusPolicy policy)
pos
void setFocusProxy(QWidget *w)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:59:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.