Add getter for QSizePolicy to SpacerItem

Change allows to change width and height with
changeSize() method without changing size policy.

Task-number: QTBUG-38518
Change-Id: I3eabb5fbfd9792c57c0a533ce14ec99b64603631
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
This commit is contained in:
Katja Marttila 2015-02-27 15:01:54 +02:00 committed by Shawn Rutledge
parent 483328a956
commit 7c3cfdbcb7
2 changed files with 9 additions and 0 deletions

View File

@ -340,6 +340,14 @@ QSpacerItem * QSpacerItem::spacerItem()
return this;
}
/*!
Returns the size policy of this item.
*/
QSizePolicy QSpacerItem::sizePolicy() const
{
return sizeP;
}
/*!
If this item is a QWidget, it is returned as a QWidget; otherwise
0 is returned. This function provides type-safe casting.

View File

@ -102,6 +102,7 @@ public:
void setGeometry(const QRect&);
QRect geometry() const;
QSpacerItem *spacerItem();
QSizePolicy sizePolicy() const;
private:
int width;