Default implementations of minimumSize() , maximumSize() in Layout and correct implementations of minimumSize() , maximumSize() in Widget to match equivalents in QLayout , QWidget.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=703547
This commit is contained in:
Robert Knight 2007-08-22 20:13:24 +00:00
parent 8232082478
commit 773612ac44
3 changed files with 25 additions and 2 deletions

View File

@ -18,6 +18,8 @@
#include "layout.h"
#include <math.h>
#include <QtCore/QList>
namespace Plasma
@ -99,4 +101,13 @@ LayoutItem *Layout::parent() const
return d->parent;
}
QSizeF Layout::minimumSize() const
{
return QSizeF(0,0);
}
QSizeF Layout::maximumSize() const
{
return QSizeF(INFINITY,INFINITY);
}
}

View File

@ -132,7 +132,17 @@ class PLASMA_EXPORT Layout : public LayoutItem
/** Triggers an update of the layout. */
void update();
/**
* Returns the minimum size of this layout.
* The default implementation allows unlimited resizing.
*/
virtual QSizeF minimumSize() const;
/**
* Returns the maximum size of this layout. The default
* implementation allows unlimited resizing.
*/
virtual QSizeF maximumSize() const;
private:
class Private;
Private *const d;

View File

@ -38,7 +38,9 @@ class Widget::Private
{
public:
Private()
: parent(0)
: minimumSize(0,0)
, maximumSize(INFINITY,INFINITY)
, parent(0)
, opacity(1.0)
{ }
~Private() { }