diff options
Diffstat (limited to 'src/controls')
-rw-r--r-- | src/controls/qquickframe.cpp | 42 | ||||
-rw-r--r-- | src/controls/qquickframe_p.h | 10 | ||||
-rw-r--r-- | src/controls/qquickframe_p_p.h | 2 | ||||
-rw-r--r-- | src/controls/qquicktoolbar.cpp | 4 | ||||
-rw-r--r-- | src/controls/qquicktoolbar_p.h | 4 |
5 files changed, 57 insertions, 5 deletions
diff --git a/src/controls/qquickframe.cpp b/src/controls/qquickframe.cpp index 2f2ec65d..ae642b61 100644 --- a/src/controls/qquickframe.cpp +++ b/src/controls/qquickframe.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE TODO */ -QQuickFramePrivate::QQuickFramePrivate() : frame(Q_NULLPTR) +QQuickFramePrivate::QQuickFramePrivate() : contentWidth(0), contentHeight(0), frame(Q_NULLPTR) { } @@ -65,6 +65,46 @@ QQuickFrame::QQuickFrame(QQuickFramePrivate &dd, QQuickItem *parent) : } /*! + \qmlproperty real QtQuickControls2::Frame::contentWidth + + TODO +*/ +qreal QQuickFrame::contentWidth() const +{ + Q_D(const QQuickFrame); + return d->contentWidth; +} + +void QQuickFrame::setContentWidth(qreal width) +{ + Q_D(QQuickFrame); + if (d->contentWidth != width) { + d->contentWidth = width; + emit contentWidthChanged(); + } +} + +/*! + \qmlproperty real QtQuickControls2::Frame::contentHeight + + TODO +*/ +qreal QQuickFrame::contentHeight() const +{ + Q_D(const QQuickFrame); + return d->contentHeight; +} + +void QQuickFrame::setContentHeight(qreal height) +{ + Q_D(QQuickFrame); + if (d->contentHeight != height) { + d->contentHeight = height; + emit contentHeightChanged(); + } +} + +/*! \qmlproperty Item QtQuickControls2::Frame::frame TODO diff --git a/src/controls/qquickframe_p.h b/src/controls/qquickframe_p.h index d7bcc490..b56f9fcb 100644 --- a/src/controls/qquickframe_p.h +++ b/src/controls/qquickframe_p.h @@ -57,15 +57,25 @@ class QQuickFramePrivate; class Q_QUICKCONTROLS_EXPORT QQuickFrame : 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(QQuickItem *frame READ frame WRITE setFrame NOTIFY frameChanged FINAL) public: explicit QQuickFrame(QQuickItem *parent = Q_NULLPTR); + qreal contentWidth() const; + void setContentWidth(qreal width); + + qreal contentHeight() const; + void setContentHeight(qreal height); + QQuickItem *frame() const; void setFrame(QQuickItem *frame); Q_SIGNALS: + void contentWidthChanged(); + void contentHeightChanged(); void frameChanged(); protected: diff --git a/src/controls/qquickframe_p_p.h b/src/controls/qquickframe_p_p.h index 19a9af84..60b0775f 100644 --- a/src/controls/qquickframe_p_p.h +++ b/src/controls/qquickframe_p_p.h @@ -57,6 +57,8 @@ class Q_QUICKCONTROLS_EXPORT QQuickFramePrivate : public QQuickControlPrivate public: QQuickFramePrivate(); + qreal contentWidth; + qreal contentHeight; QQuickItem *frame; }; diff --git a/src/controls/qquicktoolbar.cpp b/src/controls/qquicktoolbar.cpp index 90959ba9..9418c491 100644 --- a/src/controls/qquicktoolbar.cpp +++ b/src/controls/qquicktoolbar.cpp @@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE /*! \qmltype ToolBar - \inherits Container + \inherits Frame \instantiates QQuickToolBar \inqmlmodule QtQuick.Controls \ingroup containers @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE */ QQuickToolBar::QQuickToolBar(QQuickItem *parent) : - QQuickContainer(parent) + QQuickFrame(parent) { } diff --git a/src/controls/qquicktoolbar_p.h b/src/controls/qquicktoolbar_p.h index 50352186..878ffe8c 100644 --- a/src/controls/qquicktoolbar_p.h +++ b/src/controls/qquicktoolbar_p.h @@ -48,11 +48,11 @@ // We mean it. // -#include <QtQuickControls/private/qquickcontainer_p.h> +#include <QtQuickControls/private/qquickframe_p.h> QT_BEGIN_NAMESPACE -class Q_QUICKCONTROLS_EXPORT QQuickToolBar : public QQuickContainer +class Q_QUICKCONTROLS_EXPORT QQuickToolBar : public QQuickFrame { Q_OBJECT |