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
qfontdialog.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
4#ifndef QFONTDIALOG_H
5#define QFONTDIALOG_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtGui/qwindowdefs.h>
9#include <QtGui/qfont.h>
10
11#include <QtWidgets/qdialog.h>
12
14
16
18
19class Q_WIDGETS_EXPORT QFontDialog : public QDialog
20{
22 Q_DECLARE_PRIVATE(QFontDialog)
23 Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged)
24 Q_PROPERTY(FontDialogOptions options READ options WRITE setOptions)
25
26public:
28 NoButtons = 0x00000001,
29 DontUseNativeDialog = 0x00000002,
30 ScalableFonts = 0x00000004,
31 NonScalableFonts = 0x00000008,
32 MonospacedFonts = 0x00000010,
33 ProportionalFonts = 0x00000020
34 };
35 Q_ENUM(FontDialogOption)
36
37 Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption)
38
39 explicit QFontDialog(QWidget *parent = nullptr);
40 explicit QFontDialog(const QFont &initial, QWidget *parent = nullptr);
42
43 void setCurrentFont(const QFont &font);
44 QFont currentFont() const;
45
46 QFont selectedFont() const;
47
48 void setOption(FontDialogOption option, bool on = true);
49 bool testOption(FontDialogOption option) const;
50 void setOptions(FontDialogOptions options);
51 FontDialogOptions options() const;
52
53 using QDialog::open;
54 void open(QObject *receiver, const char *member);
55
56 void setVisible(bool visible) override;
57
58 static QFont getFont(bool *ok, QWidget *parent = nullptr);
59 static QFont getFont(bool *ok, const QFont &initial, QWidget *parent = nullptr, const QString &title = QString(),
60 FontDialogOptions options = FontDialogOptions());
61
64 void fontSelected(const QFont &font);
65
66protected:
67 void changeEvent(QEvent *event) override;
68 void done(int result) override;
69 bool eventFilter(QObject *object, QEvent *event) override;
70
71private:
72 Q_DISABLE_COPY(QFontDialog)
73};
74
75Q_DECLARE_OPERATORS_FOR_FLAGS(QFontDialog::FontDialogOptions)
76
78
79#endif // QFONTDIALOG_H
The QDialog class is the base class of dialog windows.
Definition qdialog.h:19
virtual void open()
Definition qdialog.cpp:503
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtWidgets
Definition qfontdialog.h:20
void fontSelected(const QFont &font)
void currentFontChanged(const QFont &font)
\reentrant
Definition qfont.h:22
\inmodule QtCore
Definition qobject.h:103
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
struct _cl_event * event
GLuint64EXT * result
[6]
GLuint GLenum option
#define QT_REQUIRE_CONFIG(feature)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
file open(QIODevice::ReadOnly)
QString title
[35]