From 4840947a5ade0690419f89e0ed46d80fb61ea993 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 13 Sep 2019 06:57:48 +0200 Subject: [PATCH] setting of explicit width/height fixed --- src/controls/QskControl.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/controls/QskControl.cpp b/src/controls/QskControl.cpp index 7f3c5ada..efa3ffa1 100644 --- a/src/controls/QskControl.cpp +++ b/src/controls/QskControl.cpp @@ -412,17 +412,19 @@ void QskControl::setPreferredSize( const QSizeF& size ) void QskControl::setPreferredSize( qreal width, qreal height ) { - setPreferredSize( QSizeF( width, height ) ); + setExplicitSizeHint( Qt::PreferredSize, QSizeF( width, height ) ); } void QskControl::setPreferredWidth( qreal width ) { - setPreferredSize( QSizeF( width, preferredSize().height() ) ); + const qreal height = explicitSizeHint( Qt::PreferredSize ).height(); + setExplicitSizeHint( Qt::PreferredSize, QSizeF( width, height ) ); } void QskControl::setPreferredHeight( qreal height ) { - setPreferredSize( QSizeF( preferredSize().width(), height ) ); + const qreal width = explicitSizeHint( Qt::PreferredSize ).width(); + setExplicitSizeHint( Qt::PreferredSize, QSizeF( width, height ) ); } void QskControl::setMinimumSize( const QSizeF& size ) @@ -432,17 +434,19 @@ void QskControl::setMinimumSize( const QSizeF& size ) void QskControl::setMinimumSize( qreal width, qreal height ) { - setMinimumSize( QSizeF( width, height ) ); + setExplicitSizeHint( Qt::MinimumSize, QSizeF( width, height ) ); } void QskControl::setMinimumWidth( qreal width ) { - setMinimumSize( QSizeF( width, minimumSize().height() ) ); + const qreal height = explicitSizeHint( Qt::MinimumSize ).height(); + setExplicitSizeHint( Qt::MinimumSize, QSizeF( width, height ) ); } void QskControl::setMinimumHeight( qreal height ) { - setMinimumSize( QSizeF( minimumSize().width(), height ) ); + const qreal width = explicitSizeHint( Qt::MinimumSize ).width(); + setExplicitSizeHint( Qt::MinimumSize, QSizeF( width, height ) ); } void QskControl::setMaximumSize( const QSizeF& size ) @@ -452,17 +456,19 @@ void QskControl::setMaximumSize( const QSizeF& size ) void QskControl::setMaximumSize( qreal width, qreal height ) { - setMaximumSize( QSizeF( width, height ) ); + setExplicitSizeHint( Qt::MaximumSize, QSizeF( width, height ) ); } void QskControl::setMaximumWidth( qreal width ) { - setMaximumSize( QSizeF( width, maximumSize().height() ) ); + const qreal height = explicitSizeHint( Qt::MaximumSize ).height(); + setExplicitSizeHint( Qt::MaximumSize, QSizeF( width, height ) ); } void QskControl::setMaximumHeight( qreal height ) { - setMaximumSize( QSizeF( maximumSize().width(), height ) ); + const qreal width = explicitSizeHint( Qt::MaximumSize ).width(); + setExplicitSizeHint( Qt::MaximumSize, QSizeF( width, height ) ); } void QskControl::setFixedSize( const QSizeF& size )