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
qfontdialog_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QFONTDIALOG_P_H
6#define QFONTDIALOG_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//
19
20#include <QtWidgets/private/qtwidgetsglobal_p.h>
21#include "private/qdialog_p.h"
22#include "qfontdatabase.h"
23#include "qfontdialog.h"
24#include <qpa/qplatformdialoghelper.h>
25
26#include <QtCore/qpointer.h>
27#include "qsharedpointer.h"
28
30
31QT_BEGIN_NAMESPACE
32
33class QBoxLayout;
34class QCheckBox;
35class QComboBox;
36class QDialogButtonBox;
37class QFontListView;
38class QGroupBox;
39class QLabel;
40class QLineEdit;
41
42class Q_AUTOTEST_EXPORT QFontDialogPrivate : public QDialogPrivate
43{
44 Q_DECLARE_PUBLIC(QFontDialog)
45
46public:
47 QFontDialogPrivate();
48 ~QFontDialogPrivate();
49
50 QPlatformFontDialogHelper *platformFontDialogHelper() const
51 { return static_cast<QPlatformFontDialogHelper *>(platformHelper()); }
52
53 void updateFamilies();
54 void updateStyles();
55 void updateSizes();
56
57 static QFont getFont(bool *ok, const QFont &initial, QWidget *parent,
58 const QString &title, QFontDialog::FontDialogOptions options);
59
60 void init();
61 void sizeChanged(const QString &);
62 void familyHighlighted(int);
63 void writingSystemHighlighted(int);
64 void styleHighlighted(int);
65 void sizeHighlighted(int);
66 void updateSample();
67 void updateSampleFont(const QFont &newFont);
68 void retranslateStrings();
69
70 QLabel *familyAccel;
71 QLineEdit *familyEdit;
72 QFontListView *familyList;
73
74 QLabel *styleAccel;
75 QLineEdit *styleEdit;
76 QFontListView *styleList;
77
78 QLabel *sizeAccel;
79 QLineEdit *sizeEdit;
80 QFontListView *sizeList;
81
82 QGroupBox *effects;
83 QCheckBox *strikeout;
84 QCheckBox *underline;
85 QComboBox *color;
86
87 QGroupBox *sample;
88 QLineEdit *sampleEdit;
89
90 QLabel *writingSystemAccel;
91 QComboBox *writingSystemCombo;
92
93 QBoxLayout *buttonLayout;
94 QBoxLayout *effectsLayout;
95 QBoxLayout *sampleLayout;
96 QBoxLayout *sampleEditLayout;
97
98 QDialogButtonBox *buttonBox;
99
100 QString family;
101 QFontDatabase::WritingSystem writingSystem;
102 QString style;
103 int size;
104 bool smoothScalable;
105 QFont selectedFont;
106 QSharedPointer<QFontDialogOptions> options;
107 QPointer<QObject> receiverToDisconnectOnClose;
108 QByteArray memberToDisconnectOnClose;
109
110 bool canBeNativeDialog() const override;
111 void setVisible(bool visible) override;
112 void _q_runNativeAppModalPanel();
113
114private:
115 virtual void initHelper(QPlatformDialogHelper *) override;
116 virtual void helperPrepareShow(QPlatformDialogHelper *) override;
117};
118
119QT_END_NAMESPACE
120
121#endif // QFONTDIALOG_P_H
\inmodule QtWidgets
Definition qfontdialog.h:21
QStringListModel * model() const
int count() const
void setCurrentItem(int item)
void currentChanged(const QModelIndex &current, const QModelIndex &previous) override
This slot is called when a new item becomes the current item.
QString currentText() const
int currentItem() const
QString text(int i) const
friend class QWidget
Definition qpainter.h:431
static const Qt::WindowFlags qfd_DefaultWindowFlags
QT_REQUIRE_CONFIG(thread)