| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QQUICKGROUPBOX_P_H |
| 5 | #define QQUICKGROUPBOX_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtQuickTemplates2/private/qquickframe_p.h> |
| 19 | |
| 20 | QT_BEGIN_NAMESPACE |
| 21 | |
| 22 | class QQuickGroupBoxPrivate; |
| 23 | |
| 24 | class Q_QUICKTEMPLATES2_EXPORT QQuickGroupBox : public QQuickFrame |
| 25 | { |
| 26 | Q_OBJECT |
| 27 | Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) |
| 28 | Q_PROPERTY(QQuickItem *label READ label WRITE setLabel NOTIFY labelChanged FINAL) |
| 29 | // 2.5 (Qt 5.12) |
| 30 | Q_PROPERTY(qreal implicitLabelWidth READ implicitLabelWidth NOTIFY implicitLabelWidthChanged FINAL REVISION(2, 5)) |
| 31 | Q_PROPERTY(qreal implicitLabelHeight READ implicitLabelHeight NOTIFY implicitLabelHeightChanged FINAL REVISION(2, 5)) |
| 32 | Q_CLASSINFO("DeferredPropertyNames", "background,contentItem,label") |
| 33 | QML_NAMED_ELEMENT(GroupBox) |
| 34 | QML_ADDED_IN_VERSION(2, 0) |
| 35 | |
| 36 | public: |
| 37 | explicit QQuickGroupBox(QQuickItem *parent = nullptr); |
| 38 | ~QQuickGroupBox(); |
| 39 | |
| 40 | QString title() const; |
| 41 | void setTitle(const QString &title); |
| 42 | |
| 43 | QQuickItem *label() const; |
| 44 | void setLabel(QQuickItem *label); |
| 45 | |
| 46 | // 2.5 (Qt 5.12) |
| 47 | qreal implicitLabelWidth() const; |
| 48 | qreal implicitLabelHeight() const; |
| 49 | |
| 50 | Q_SIGNALS: |
| 51 | void titleChanged(); |
| 52 | void labelChanged(); |
| 53 | // 2.5 (Qt 5.12) |
| 54 | Q_REVISION(2, 5) void implicitLabelWidthChanged(); |
| 55 | Q_REVISION(2, 5) void implicitLabelHeightChanged(); |
| 56 | |
| 57 | protected: |
| 58 | void componentComplete() override; |
| 59 | |
| 60 | QFont defaultFont() const override; |
| 61 | |
| 62 | #if QT_CONFIG(accessibility) |
| 63 | QAccessible::Role accessibleRole() const override; |
| 64 | void accessibilityActiveChanged(bool active) override; |
| 65 | #endif |
| 66 | |
| 67 | private: |
| 68 | Q_DISABLE_COPY(QQuickGroupBox) |
| 69 | Q_DECLARE_PRIVATE(QQuickGroupBox) |
| 70 | }; |
| 71 | |
| 72 | QT_END_NAMESPACE |
| 73 | |
| 74 | #endif // QQUICKGROUPBOX_P_H |
| 75 |
