using sizeConstraint instead of sizeHint
This commit is contained in:
parent
425fb3978f
commit
da7f40ca07
@ -84,7 +84,7 @@ QRectF QskTabViewSkinlet::tabBarRect(
|
||||
{
|
||||
Q_UNUSED( rect )
|
||||
|
||||
const QSizeF hint = tabView->tabBar()->sizeHint();
|
||||
const QSizeF barSize = tabView->tabBar()->sizeConstraint();
|
||||
|
||||
#if 1
|
||||
QRectF r = tabView->layoutRect();
|
||||
@ -93,19 +93,19 @@ QRectF QskTabViewSkinlet::tabBarRect(
|
||||
switch( tabView->tabPosition() )
|
||||
{
|
||||
case Qsk::Top:
|
||||
r.setHeight( hint.height() );
|
||||
r.setHeight( barSize.height() );
|
||||
break;
|
||||
|
||||
case Qsk::Bottom:
|
||||
r.setTop( r.bottom() - hint.height() );
|
||||
r.setTop( r.bottom() - barSize.height() );
|
||||
break;
|
||||
|
||||
case Qsk::Left:
|
||||
r.setWidth( hint.width() );
|
||||
r.setWidth( barSize.width() );
|
||||
break;
|
||||
|
||||
case Qsk::Right:
|
||||
r.setLeft( r.right() - hint.width() );
|
||||
r.setLeft( r.right() - barSize.width() );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ bool QskWindow::event( QEvent* event )
|
||||
{
|
||||
if ( size().isEmpty() )
|
||||
{
|
||||
QSize sz = effectivePreferredSize();
|
||||
QSize sz = sizeConstraint();
|
||||
if ( !sz.isEmpty() )
|
||||
{
|
||||
sz = sz.expandedTo( minimumSize() );
|
||||
@ -403,7 +403,7 @@ QSize QskWindow::preferredSize() const
|
||||
return d->preferredSize;
|
||||
}
|
||||
|
||||
QSize QskWindow::effectivePreferredSize() const
|
||||
QSize QskWindow::sizeConstraint() const
|
||||
{
|
||||
Q_D( const QskWindow );
|
||||
|
||||
@ -419,7 +419,7 @@ QSize QskWindow::effectivePreferredSize() const
|
||||
{
|
||||
if ( auto control = qskControlCast( child ) )
|
||||
{
|
||||
const QSizeF itemConstraint = control->sizeHint();
|
||||
const QSizeF itemConstraint = control->sizeConstraint();
|
||||
|
||||
if ( doWidth )
|
||||
constraint.setWidth( qMax( constraint.width(), itemConstraint.width() ) );
|
||||
|
@ -51,7 +51,7 @@ class QSK_EXPORT QskWindow : public QQuickWindow
|
||||
Q_INVOKABLE void setPreferredSize( const QSize& );
|
||||
Q_INVOKABLE QSize preferredSize() const;
|
||||
|
||||
Q_INVOKABLE QSize effectivePreferredSize() const;
|
||||
Q_INVOKABLE QSize sizeConstraint() const;
|
||||
|
||||
Q_INVOKABLE void setFixedSize( const QSize& );
|
||||
|
||||
|
@ -102,7 +102,7 @@ static void qskSetupWindow(
|
||||
|
||||
window->setModality( transientParent ? Qt::WindowModal : Qt::ApplicationModal );
|
||||
|
||||
const QSize size = window->effectivePreferredSize();
|
||||
const QSize size = window->sizeConstraint();
|
||||
|
||||
if ( window->parent() )
|
||||
{
|
||||
|
@ -353,7 +353,7 @@ void QskDialogSubWindow::aboutToShow()
|
||||
const qreal cy = 0.5 * parentItem()->height();
|
||||
|
||||
QRectF rect;
|
||||
rect.setSize( sizeHint() );
|
||||
rect.setSize( sizeConstraint() );
|
||||
rect.moveCenter( QPointF( cx, cy ) );
|
||||
|
||||
setGeometry( rect );
|
||||
@ -370,7 +370,7 @@ void QskDialogSubWindow::updateLayout()
|
||||
|
||||
if ( m_data->buttonBox && m_data->buttonBox->isVisibleToParent() )
|
||||
{
|
||||
const auto h = m_data->buttonBox->sizeHint().height();
|
||||
const auto h = m_data->buttonBox->sizeConstraint().height();
|
||||
rect.setBottom( rect.bottom() - h );
|
||||
|
||||
m_data->buttonBox->setGeometry( rect.x(), rect.bottom(), rect.width(), h );
|
||||
|
@ -408,7 +408,7 @@ void QskInputContext::showPanel( const QQuickItem* item )
|
||||
|
||||
auto window = m_data->createWindow( panel );
|
||||
|
||||
QSize size = window->effectivePreferredSize();
|
||||
QSize size = window->sizeConstraint();
|
||||
if ( size.isEmpty() )
|
||||
{
|
||||
// no idea, may be something based on the screen size
|
||||
|
Loading…
x
Reference in New Issue
Block a user