aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpane_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-03-09 11:44:27 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-03-09 13:32:21 +0000
commit87dec648804bfa974a297c37542dd77de9f72e9f (patch)
tree1a242c80ce83e8a3185a5a7ca0a9d78a76175860 /src/quicktemplates2/qquickpane_p.h
parentb6d847ac5bb0e32f928f616cee03d323aab33e55 (diff)
QQuickPane: calculate content size in C++ unless explicitly defined
No more need for the clumsy and slow contentWidth and contentHeight bindings in Pane and its derivatives. QmlBench on TX1: Pane: 26.4 -> 32.8 frames (~24%) Frame: 25.4 -> 31 frames (~22%) GroupBox: 28.6 -> 32 frames (~12%) Change-Id: I4ba1d46ba6328de2ee0955c241d4b090127f6b85 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpane_p.h')
-rw-r--r--src/quicktemplates2/qquickpane_p.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickpane_p.h b/src/quicktemplates2/qquickpane_p.h
index 759c59d8..53bf7067 100644
--- a/src/quicktemplates2/qquickpane_p.h
+++ b/src/quicktemplates2/qquickpane_p.h
@@ -58,20 +58,23 @@ class QQuickPanePrivate;
class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPane : public QQuickControl
{
Q_OBJECT
- Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged FINAL)
- Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged FINAL)
+ Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth RESET resetContentWidth NOTIFY contentWidthChanged FINAL)
+ Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight RESET resetContentHeight NOTIFY contentHeightChanged FINAL)
Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL)
Q_PROPERTY(QQmlListProperty<QQuickItem> contentChildren READ contentChildren NOTIFY contentChildrenChanged FINAL)
Q_CLASSINFO("DefaultProperty", "contentData")
public:
explicit QQuickPane(QQuickItem *parent = nullptr);
+ ~QQuickPane();
qreal contentWidth() const;
void setContentWidth(qreal width);
+ void resetContentWidth();
qreal contentHeight() const;
void setContentHeight(qreal height);
+ void resetContentHeight();
QQmlListProperty<QObject> contentData();
QQmlListProperty<QQuickItem> contentChildren();