hasScaledContents/setScaledcontents properties, useful for qtscript

svn path=/trunk/KDE/kdelibs/; revision=903557
This commit is contained in:
Marco Martin 2008-12-30 20:53:02 +00:00
parent 84685506af
commit ccf2fef95f
2 changed files with 23 additions and 0 deletions

View File

@ -148,6 +148,16 @@ QString Label::image() const
return d->imagePath;
}
void Label::setScaledContents(bool scaled)
{
static_cast<QLabel*>(widget())->setScaledContents(scaled);
}
bool Label::hasScaledContents() const
{
return static_cast<QLabel*>(widget())->hasScaledContents();
}
void Label::setAlignment(Qt::Alignment alignment)
{
nativeWidget()->setAlignment(alignment);

View File

@ -45,6 +45,7 @@ class PLASMA_EXPORT Label : public QGraphicsProxyWidget
Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(QString image READ image WRITE setImage)
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
Q_PROPERTY(bool hasScaledContents READ hasScaledContents WRITE setScaledContents)
Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
Q_PROPERTY(QLabel *nativeWidget READ nativeWidget)
@ -88,6 +89,18 @@ public:
*/
Qt::Alignment alignment() const;
/**
* Scale or not the contents of the label to the label size
*
* @arg scale
*/
void setScaledContents(bool scaled);
/**
* @return true if the contents are scaled to the label size
*/
bool hasScaledContents() const;
/**
* Sets the stylesheet used to control the visual display of this Label
*