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 QQUICKDIALOGBUTTONBOX_P_P_H
5#define QQUICKDIALOGBUTTONBOX_P_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/qquickcontainer_p_p.h>
19#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickDialogButtonBoxPrivate : public QQuickContainerPrivate
24{
25public:
26 Q_DECLARE_PUBLIC(QQuickDialogButtonBox)
27
28 static QQuickDialogButtonBoxPrivate *get(QQuickDialogButtonBox *box)
29 {
30 return box->d_func();
31 }
32
33 void itemImplicitWidthChanged(QQuickItem *item) override;
34 void itemImplicitHeightChanged(QQuickItem *item) override;
35
36 void resizeContent() override;
37
38 void updateLayout();
39
40 qreal getContentWidth() const override;
41 qreal getContentHeight() const override;
42
43 void handleClick();
44
45 static QString buttonText(QPlatformDialogHelper::StandardButton standardButton);
46
47 QQuickAbstractButton *createStandardButton(QPlatformDialogHelper::StandardButton button);
48 void removeStandardButtons();
49
50 void updateLanguage();
51
52 QPlatformDialogHelper::StandardButton standardButton(QQuickAbstractButton *button) const;
53
54 Qt::Alignment alignment;
55 QQuickDialogButtonBox::Position position = QQuickDialogButtonBox::Footer;
56 QPlatformDialogHelper::StandardButtons standardButtons = QPlatformDialogHelper::NoButton;
57 QPlatformDialogHelper::ButtonLayout buttonLayout = QPlatformDialogHelper::UnknownLayout;
58 QQmlComponent *delegate = nullptr;
59};
60
61class QQuickDialogButtonBoxAttachedPrivate : public QObjectPrivate
62{
63 Q_DECLARE_PUBLIC(QQuickDialogButtonBoxAttached)
64
65public:
66 static QQuickDialogButtonBoxAttachedPrivate *get(QQuickDialogButtonBoxAttached *q)
67 {
68 return q->d_func();
69 }
70
71 void setButtonBox(QQuickDialogButtonBox *box);
72
73 QQuickDialogButtonBox *buttonBox = nullptr;
74 QPlatformDialogHelper::ButtonRole buttonRole = QPlatformDialogHelper::InvalidRole;
75 QPlatformDialogHelper::StandardButton standardButton = QPlatformDialogHelper::NoButton;
76};
77
78QT_END_NAMESPACE
79
80#endif // QQUICKDIALOGBUTTONBOX_P_P_H
81

source code of qtdeclarative/src/quicktemplates/qquickdialogbuttonbox_p_p.h