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 "layout.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
@ -99,4 +101,13 @@ LayoutItem *Layout::parent() const
|
|||||||
return d->parent;
|
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. */
|
/** Triggers an update of the layout. */
|
||||||
void update();
|
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:
|
private:
|
||||||
class Private;
|
class Private;
|
||||||
Private *const d;
|
Private *const d;
|
||||||
|
@ -38,7 +38,9 @@ class Widget::Private
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Private()
|
Private()
|
||||||
: parent(0)
|
: minimumSize(0,0)
|
||||||
|
, maximumSize(INFINITY,INFINITY)
|
||||||
|
, parent(0)
|
||||||
, opacity(1.0)
|
, opacity(1.0)
|
||||||
{ }
|
{ }
|
||||||
~Private() { }
|
~Private() { }
|
||||||
|
Loading…
Reference in New Issue
Block a user