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:
parent
8232082478
commit
773612ac44
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -38,7 +38,9 @@ class Widget::Private
|
||||
{
|
||||
public:
|
||||
Private()
|
||||
: parent(0)
|
||||
: minimumSize(0,0)
|
||||
, maximumSize(INFINITY,INFINITY)
|
||||
, parent(0)
|
||||
, opacity(1.0)
|
||||
{ }
|
||||
~Private() { }
|
||||
|
Loading…
Reference in New Issue
Block a user