diff options
author | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-09-15 10:32:42 (GMT) |
---|---|---|
committer | Kim Motoyoshi Kalland <kim.kalland@nokia.com> | 2009-09-15 10:47:26 (GMT) |
commit | 6a90f032d160f35058373fce16efd1b5d2190bf1 (patch) | |
tree | 9e95bf12c44eb2ab2a7d08b88d55aa4d4ca2c4e6 | |
parent | af1cfbc945c7c01adea09d3d369699f4dd0daab9 (diff) | |
download | Qt-6a90f032d160f35058373fce16efd1b5d2190bf1.zip Qt-6a90f032d160f35058373fce16efd1b5d2190bf1.tar.gz Qt-6a90f032d160f35058373fce16efd1b5d2190bf1.tar.bz2 |
Fixed QLineEdit to pass the tst_QLineEdit::displayText() autotest.
Fetch the correct password character from the style.
Reviewed-by: Olivier
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit_p.cpp | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index a55ca8e..37e57cf 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -2047,7 +2047,11 @@ void QLineEdit::changeEvent(QEvent *ev) d->control->setFont(font()); break; case QEvent::StyleChange: - d->control->setPasswordCharacter(style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter)); + { + QStyleOptionFrameV2 opt; + initStyleOption(&opt); + d->control->setPasswordCharacter(style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, this)); + } update(); break; case QEvent::LayoutDirectionChange: diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 4fe02a2..148da1b 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -159,7 +159,10 @@ void QLineEditPrivate::init(const QString& txt) QObject::connect(control, SIGNAL(updateNeeded(const QRect &)), q, SLOT(update())); - control->setPasswordCharacter(q->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter)); + + QStyleOptionFrameV2 opt; + q->initStyleOption(&opt); + control->setPasswordCharacter(q->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, q)); #ifndef QT_NO_CURSOR q->setCursor(Qt::IBeamCursor); #endif |