Add function QMLView::sizeRootObjectToView()
This commit is contained in:
parent
62fa35926c
commit
210b41b262
2 changed files with 9 additions and 0 deletions
|
@ -69,3 +69,11 @@ void QMLView::setProperty( const QString & name, const QScriptValue &value ) {
|
||||||
context->setContextProperty(name, value.toVariant());
|
context->setContextProperty(name, value.toVariant());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QMLView::sizeRootObjectToView(bool enable) {
|
||||||
|
if (enable) {
|
||||||
|
this->setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
||||||
|
} else {
|
||||||
|
this->setResizeMode(QDeclarativeView::SizeViewToRootObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ signals:
|
||||||
public slots:
|
public slots:
|
||||||
void load(const QString &url);
|
void load(const QString &url);
|
||||||
void setProperty( const QString & name, const QScriptValue &value );
|
void setProperty( const QString & name, const QScriptValue &value );
|
||||||
|
void sizeRootObjectToView(bool enable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class PrivateData;
|
class PrivateData;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue