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 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 triggered(bool checked)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
QIcon fromTheme(const QString &name)
void setContentsMargins(const QMargins &margins)
TrailingPosition
Normal
void textChanged(const QString &text)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
void setObjectName(QAnyStringView name)
QString tr(const char *sourceText, const char *disambiguation, int n)
void clear()
bool isEmpty() const const
CustomContextMenu
QWidget(QWidget *parent, Qt::WindowFlags f)
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-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:56:58 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:56:58 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.