From 763c920c2db86c5f6d2af4a541ff2ab986624e61 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 14 Dec 2018 09:11:00 +0100 Subject: [PATCH] minor changes --- src/layouts/QskLayoutItem.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/layouts/QskLayoutItem.cpp b/src/layouts/QskLayoutItem.cpp index 54fffd73..b09c4fbe 100644 --- a/src/layouts/QskLayoutItem.cpp +++ b/src/layouts/QskLayoutItem.cpp @@ -140,6 +140,8 @@ QLayoutPolicy::Policy QskLayoutItem::sizePolicy( Qt::Orientation orientation ) c { auto policy = QskLayoutConstraint::sizePolicy( m_item ).policy( orientation ); #if 1 + // we need to get rid of this extra check as we are calling sizeHint trillion times TODO ... + if ( ( policy == QskSizePolicy::Preferred ) && m_item ) { // QskSizePolicy::Preferred without having a preferred size is the default @@ -196,12 +198,10 @@ Qt::Orientation QskLayoutItem::dynamicConstraintOrientation() const if ( auto control = qobject_cast< const QskControl* >( m_item ) ) { - const QskSizePolicy& policy = control->sizePolicy(); + const auto policy = control->sizePolicy().horizontalPolicy(); - if ( policy.horizontalPolicy() == QskSizePolicy::Constrained ) - return Qt::Horizontal; - else - return Qt::Vertical; + return ( policy == QskSizePolicy::Constrained ) + ? Qt::Horizontal : Qt::Vertical; } return orientation;