diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-06-17 15:34:47 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2020-06-17 14:44:55 +0000 |
commit | 68e2e0f757487c0a5b54cb3a1c6d355bd5ef3d36 (patch) | |
tree | e087dffec60a40f3a38ebacf8d6b3b9a668e47c7 | |
parent | fdb7a7b8d6518ec971ed058c63b71318d648a86e (diff) |
Native style: move window tests inside window() scope
Change-Id: I0c9860eca383b45926fc2134a54807a845d6bc35
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
-rw-r--r-- | src/imports/nativestyle/items/qquickstyleitem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/imports/nativestyle/items/qquickstyleitem.cpp b/src/imports/nativestyle/items/qquickstyleitem.cpp index 4c7f404f..1fd933ea 100644 --- a/src/imports/nativestyle/items/qquickstyleitem.cpp +++ b/src/imports/nativestyle/items/qquickstyleitem.cpp @@ -178,14 +178,14 @@ void QQuickStyleItem::initStyleOptionBase(QStyleOption &styleOption) styleOption.state = QStyle::State_None; styleOption.state |= controlSize(styleOption.control); - if (styleOption.window->isActive()) - styleOption.state |= QStyle::State_Active; // Note: not all controls inherit from QQuickControl (e.g QQuickTextField) if (const auto quickControl = dynamic_cast<QQuickControl *>(m_control.data())) styleOption.direction = quickControl->isMirrored() ? Qt::RightToLeft : Qt::LeftToRight; if (window()) { + if (styleOption.window->isActive()) + styleOption.state |= QStyle::State_Active; if (m_control->isEnabled()) styleOption.state |= QStyle::State_Enabled; if (m_control->hasActiveFocus()) |