diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-01-17 19:56:08 -0800 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2018-02-05 19:43:49 +0000 |
commit | 3d29a0dd7487cdb1de40f8d16de988cb4ac6a09f (patch) | |
tree | db53f2c1817021c0765043cd6d2e7a634015ced0 /src/widgets | |
parent | 3d02e75c07fd5a460b72fc0cbffb199a3cb8a14a (diff) |
QMacStyle: CC_SpinBox is now HITheme-free
Bonus changes in this edition:
* The focus frame shows only around the spin-box's
line-edit, as it should. This requires getting
access to the spin-box's line-edit, which we do
by setting a property on the former. Notice that
the stepper doesn't get focus. On this point,
macOS is inconsistent (partly because there's no
such thing as an NSSpinBox, and partly because
spin-box buttons are a separate control), so we
copy the same focus behavior as NSDatePicker.
* We clean some QFocusFrame related dead code in
QMacStyle::event().
Change-Id: I204ca2093d9db343c78f0420811dda35c463bbcd
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qabstractspinbox.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index 61526916f1..fe2801fcbf 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -678,8 +678,13 @@ void QAbstractSpinBox::setLineEdit(QLineEdit *lineEdit) Q_ASSERT(lineEdit); return; } + + if (lineEdit == d->edit) + return; + delete d->edit; d->edit = lineEdit; + setProperty("_q_spinbox_lineedit", QVariant::fromValue<QWidget *>(d->edit)); if (!d->edit->validator()) d->edit->setValidator(d->validator); |