From a8fd90f5b14cccf6104cacbff2375dfe64d4fde0 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 17 Jun 2022 08:46:00 +0200 Subject: [PATCH] segmented bar: Use QskAspect for the orientation ... to be able to style properly. --- src/controls/QskSegmentedBar.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/controls/QskSegmentedBar.cpp b/src/controls/QskSegmentedBar.cpp index 6f5dd5e1..83234377 100644 --- a/src/controls/QskSegmentedBar.cpp +++ b/src/controls/QskSegmentedBar.cpp @@ -95,6 +95,10 @@ QskSegmentedBar::QskSegmentedBar( Qt::Orientation orientation, QQuickItem* paren : Inherited( parent ) , m_data( new PrivateData( orientation ) ) { + auto direction = ( orientation == Qt::Horizontal ) + ? Qsk::LeftToRight : Qsk::TopToBottom; + setFlagHint( Panel | QskAspect::Direction, direction ); + if( orientation == Qt::Horizontal ) initSizePolicy( QskSizePolicy::MinimumExpanding, QskSizePolicy::Fixed ); else @@ -119,6 +123,10 @@ void QskSegmentedBar::setOrientation( Qt::Orientation orientation ) setSizePolicy( sizePolicy( Qt::Vertical ), sizePolicy( Qt::Horizontal ) ); m_data->orientation = orientation; + auto direction = ( orientation == Qt::Horizontal ) + ? Qsk::LeftToRight : Qsk::TopToBottom; + setFlagHint( Panel | QskAspect::Direction, direction ); + resetImplicitSize(); update(); }