forked from qt-creator/qt-creator
JSON Wizards: Add "isPassword" property to LineEdits
Change-Id: I5539c66c162345bda052546fa02cc69d4bd55f9a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
@@ -824,6 +824,9 @@
|
||||
For example, to turn the first character in the line edit to upper
|
||||
case.
|
||||
|
||||
\li \c isPassword is a boolean value that specifies that the line edit
|
||||
contains a password, which will be masked.
|
||||
|
||||
\endlist
|
||||
|
||||
\section2 Path Chooser
|
||||
|
@@ -404,6 +404,7 @@ bool LineEditField::parseData(const QVariant &data, QString *errorMessage)
|
||||
|
||||
QVariantMap tmp = data.toMap();
|
||||
|
||||
m_isPassword = tmp.value("isPassword", false).toBool();
|
||||
m_defaultText = JsonWizardFactory::localizedString(tmp.value(QLatin1String("trText")).toString());
|
||||
m_disabledText = JsonWizardFactory::localizedString(tmp.value(QLatin1String("trDisabledText")).toString());
|
||||
m_placeholderText = JsonWizardFactory::localizedString(tmp.value(QLatin1String("trPlaceholder")).toString());
|
||||
@@ -439,6 +440,8 @@ QWidget *LineEditField::createWidget(const QString &displayName, JsonFieldPage *
|
||||
if (!m_historyId.isEmpty())
|
||||
w->setHistoryCompleter(m_historyId, m_restoreLastHistoryItem);
|
||||
|
||||
w->setEchoMode(m_isPassword ? QLineEdit::Password : QLineEdit::Normal);
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
|
@@ -105,6 +105,7 @@ private:
|
||||
bool m_isModified;
|
||||
bool m_isValidating;
|
||||
bool m_restoreLastHistoryItem;
|
||||
bool m_isPassword;
|
||||
QString m_placeholderText;
|
||||
QString m_defaultText;
|
||||
QString m_disabledText;
|
||||
|
Reference in New Issue
Block a user