Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquicklabsplatformfontdialog_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKLABSPLATFORMFONTDIALOG_P_H
6#define QQUICKLABSPLATFORMFONTDIALOG_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20#include <QtGui/qfont.h>
21#include <QtQml/qqml.h>
22
23#if QT_DEPRECATED_SINCE(6, 9)
24
25QT_BEGIN_NAMESPACE
26
27class QQuickLabsPlatformFontDialog : public QQuickLabsPlatformDialog
28{
29 Q_OBJECT
30 QML_NAMED_ELEMENT(FontDialog)
31 QML_EXTENDED_NAMESPACE(QFontDialogOptions)
32 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
33 Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged FINAL)
34 Q_PROPERTY(QFontDialogOptions::FontDialogOptions options READ options WRITE setOptions NOTIFY optionsChanged FINAL)
35
36public:
37 explicit QQuickLabsPlatformFontDialog(QObject *parent = nullptr);
38
39 QFont font() const;
40 void setFont(const QFont &font);
41
42 QFont currentFont() const;
43 void setCurrentFont(const QFont &font);
44
45 QFontDialogOptions::FontDialogOptions options() const;
46 void setOptions(QFontDialogOptions::FontDialogOptions options);
47
48Q_SIGNALS:
49 void fontChanged();
50 void currentFontChanged();
51 void optionsChanged();
52
53protected:
54 bool useNativeDialog() const override;
55 void onCreate(QPlatformDialogHelper *dialog) override;
56 void onShow(QPlatformDialogHelper *dialog) override;
57 void accept() override;
58
59private:
60 QFont m_font;
61 QFont m_currentFont; // TODO: QFontDialogOptions::initialFont
62 QSharedPointer<QFontDialogOptions> m_options;
63};
64
65QT_END_NAMESPACE
66
67#endif // QT_DEPRECATED_SINCE(6, 9)
68
69#endif // QQUICKLABSPLATFORMFONTDIALOG_P_H