Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquickfontdialogimpl_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QQUICKFONTDIALOGIMPL_P_H
5#define QQUICKFONTDIALOGIMPL_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 <QtGui/qfontdatabase.h>
19#include <QtQuick/private/qquicklistview_p.h>
20#include <QtQuick/private/qquicktextedit_p.h>
21#include <QtQuickTemplates2/private/qquicktextfield_p.h>
22#include <QtQuickTemplates2/private/qquickcombobox_p.h>
23#include <QtQuickTemplates2/private/qquickcheckbox_p.h>
24#include <QtQuickTemplates2/private/qquickdialog_p.h>
26
28
30
34
35class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickFontDialogImpl : public QQuickDialog
36{
38 Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged FINAL)
39 QML_NAMED_ELEMENT(FontDialogImpl)
42
43public:
44 explicit QQuickFontDialogImpl(QObject *parent = nullptr);
45
46 static QQuickFontDialogImplAttached *qmlAttachedProperties(QObject *object);
47
48 QSharedPointer<QFontDialogOptions> options() const;
49 void setOptions(const QSharedPointer<QFontDialogOptions> &options);
50
51 QFont currentFont() const;
52 void setCurrentFont(const QFont &font, bool selectInListViews = false);
53
54 void init();
55
57 void optionsChanged();
58 void currentFontChanged(const QFont &font);
59
61 void keyReleaseEvent(QKeyEvent *event) override;
62 void focusOutEvent(QFocusEvent *event) override;
63
64 Q_DISABLE_COPY(QQuickFontDialogImpl)
65 Q_DECLARE_PRIVATE(QQuickFontDialogImpl)
66};
67
68class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickFontDialogImplAttached : public QObject
69{
71 Q_PROPERTY(QQuickListView *familyListView READ familyListView WRITE setFamilyListView
72 NOTIFY familyListViewChanged)
73 Q_PROPERTY(QQuickListView *styleListView READ styleListView WRITE setStyleListView
74 NOTIFY styleListViewChanged)
75 Q_PROPERTY(QQuickListView *sizeListView READ sizeListView WRITE setSizeListView
76 NOTIFY sizeListViewChanged)
77 Q_PROPERTY(QQuickTextEdit *sampleEdit READ sampleEdit WRITE setSampleEdit
78 NOTIFY sampleEditChanged)
79 Q_PROPERTY(QQuickDialogButtonBox *buttonBox READ buttonBox WRITE setButtonBox
80 NOTIFY buttonBoxChanged)
81 Q_PROPERTY(QQuickComboBox *writingSystemComboBox READ writingSystemComboBox
82 WRITE setWritingSystemComboBox NOTIFY writingSystemComboBoxChanged)
83 Q_PROPERTY(QQuickCheckBox *underlineCheckBox READ underlineCheckBox WRITE setUnderlineCheckBox
84 NOTIFY underlineCheckBoxChanged)
85 Q_PROPERTY(QQuickCheckBox *strikeoutCheckBox READ strikeoutCheckBox WRITE setStrikeoutCheckBox
86 NOTIFY strikeoutCheckBoxChanged)
87
88 Q_PROPERTY(QQuickTextField *familyEdit READ familyEdit WRITE setFamilyEdit
89 NOTIFY familyEditChanged)
90 Q_PROPERTY(QQuickTextField *styleEdit READ styleEdit WRITE setStyleEdit NOTIFY styleEditChanged)
91 Q_PROPERTY(QQuickTextField *sizeEdit READ sizeEdit WRITE setSizeEdit NOTIFY sizeEditChanged)
92
93 Q_MOC_INCLUDE(<QtQuickTemplates2 / private / qquickdialogbuttonbox_p.h>)
94
95public:
97
98 QQuickListView *familyListView() const;
99 void setFamilyListView(QQuickListView *familyListView);
100
101 QQuickListView *styleListView() const;
102 void setStyleListView(QQuickListView *styleListView);
103
104 QQuickListView *sizeListView() const;
105 void setSizeListView(QQuickListView *sizeListView);
106
107 QQuickTextEdit *sampleEdit() const;
108 void setSampleEdit(QQuickTextEdit *sampleEdit);
109
110 QQuickDialogButtonBox *buttonBox() const;
111 void setButtonBox(QQuickDialogButtonBox *buttonBox);
112
113 QQuickComboBox *writingSystemComboBox() const;
114 void setWritingSystemComboBox(QQuickComboBox *writingSystemComboBox);
115
116 QQuickCheckBox *underlineCheckBox() const;
117 void setUnderlineCheckBox(QQuickCheckBox *underlineCheckBox);
118
119 QQuickCheckBox *strikeoutCheckBox() const;
120 void setStrikeoutCheckBox(QQuickCheckBox *strikethroughCheckBox);
121
122 QQuickTextField *familyEdit() const;
123 void setFamilyEdit(QQuickTextField *familyEdit);
124
125 QQuickTextField *styleEdit() const;
126 void setStyleEdit(QQuickTextField *styleEdit);
127
128 QQuickTextField *sizeEdit() const;
129 void setSizeEdit(QQuickTextField *sizeEdit);
130
132 void buttonBoxChanged();
133 void familyListViewChanged();
134 void styleListViewChanged();
135 void sizeListViewChanged();
136 void sampleEditChanged();
137 void writingSystemComboBoxChanged();
138 void underlineCheckBoxChanged();
139 void strikeoutCheckBoxChanged();
140 void familyEditChanged();
141 void styleEditChanged();
142 void sizeEditChanged();
143
144public:
145 void searchFamily(const QString &s) { searchListView(s, familyListView()); }
146 void searchStyle(const QString &s) { searchListView(s, styleListView()); }
147 void clearSearch();
148
149 void updateFamilies();
150 void selectFontInListViews(const QFont &font);
151
152private:
153 void updateStyles();
154 void updateSizes();
155
156 void _q_familyChanged();
157 void _q_styleChanged();
158 void _q_sizeEdited();
159 void _q_sizeChanged();
160 void _q_updateSample();
161
162 void _q_writingSystemChanged(int index);
163
164 void searchListView(const QString &s, QQuickListView *listView);
165
166 QFontDatabase::WritingSystem m_writingSystem;
167 QString m_selectedFamily;
168 QString m_selectedStyle;
169 QString m_search;
170 int m_selectedSize;
171 bool m_smoothlyScalable;
172 bool m_ignoreFamilyUpdate;
173 bool m_ignoreStyleUpdate;
174
175 Q_DISABLE_COPY(QQuickFontDialogImplAttached)
176 Q_DECLARE_PRIVATE(QQuickFontDialogImplAttached)
177};
178
180
181#endif // QQUICKFONTDIALOGIMPL_P_H
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
WritingSystem
\value Any \value Latin \value Greek \value Cyrillic \value Armenian \value Hebrew \value Arabic \val...
\reentrant
Definition qfont.h:22
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLuint index
[2]
GLfloat GLfloat GLfloat GLfloat h
struct _cl_event * event
GLdouble s
[6]
Definition qopenglext.h:235
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define QML_ATTACHED(ATTACHED_TYPE)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_MOC_INCLUDE(...)
#define Q_SIGNALS
#define explicit
QListView * listView