qskinny/src/controls/QskBox.cpp

47 lines
1.0 KiB
C++
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#include "QskBox.h"
QSK_SUBCONTROL( QskBox, Panel )
2018-08-03 08:15:28 +02:00
QskBox::QskBox( QQuickItem* parent )
: Inherited( parent )
2017-07-21 18:21:34 +02:00
{
}
QskBox::~QskBox()
{
}
QRectF QskBox::layoutRect() const
2018-08-03 08:15:28 +02:00
{
return innerBox( Panel, subControlRect( Panel ) );
2017-07-21 18:21:34 +02:00
}
QSizeF QskBox::contentsSizeHint() const
{
QSizeF size( -1, -1 );
if ( autoLayoutChildren() )
{
const QSizeF hint = Inherited::contentsSizeHint();
2018-08-03 08:15:28 +02:00
2017-07-21 18:21:34 +02:00
if ( hint.width() > 0 )
size.setWidth( hint.width() );
2018-08-03 08:15:28 +02:00
2017-07-21 18:21:34 +02:00
if ( hint.height() > 0 )
size.setHeight( hint.height() );
2018-08-03 08:15:28 +02:00
}
2017-07-21 18:21:34 +02:00
const QSizeF minSize(
metric( Panel | QskAspect::MinimumWidth ),
metric( Panel | QskAspect::MinimumHeight ) );
return outerBoxSize( Panel, size ).expandedTo( minSize );
2018-08-03 08:15:28 +02:00
}
2017-07-21 18:21:34 +02:00
#include "moc_QskBox.cpp"