Warning, file /include/QtWidgets/qfontcombobox.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QFONTCOMBOBOX_H
0005 #define QFONTCOMBOBOX_H
0006
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qcombobox.h>
0009 #include <QtGui/qfontdatabase.h>
0010
0011 QT_REQUIRE_CONFIG(fontcombobox);
0012
0013 QT_BEGIN_NAMESPACE
0014
0015 class QFontComboBoxPrivate;
0016
0017 class Q_WIDGETS_EXPORT QFontComboBox : public QComboBox
0018 {
0019 Q_OBJECT
0020 Q_PROPERTY(QFontDatabase::WritingSystem writingSystem READ writingSystem WRITE setWritingSystem)
0021 Q_PROPERTY(FontFilters fontFilters READ fontFilters WRITE setFontFilters)
0022 Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged)
0023
0024 public:
0025 explicit QFontComboBox(QWidget *parent = nullptr);
0026 ~QFontComboBox();
0027
0028 void setWritingSystem(QFontDatabase::WritingSystem);
0029 QFontDatabase::WritingSystem writingSystem() const;
0030
0031 enum FontFilter {
0032 AllFonts = 0,
0033 ScalableFonts = 0x1,
0034 NonScalableFonts = 0x2,
0035 MonospacedFonts = 0x4,
0036 ProportionalFonts = 0x8
0037 };
0038 Q_DECLARE_FLAGS(FontFilters, FontFilter)
0039 Q_FLAG(FontFilters)
0040
0041 void setFontFilters(FontFilters filters);
0042 FontFilters fontFilters() const;
0043
0044 QFont currentFont() const;
0045 QSize sizeHint() const override;
0046
0047 void setSampleTextForSystem(QFontDatabase::WritingSystem writingSystem, const QString &sampleText);
0048 QString sampleTextForSystem(QFontDatabase::WritingSystem writingSystem) const;
0049
0050 void setSampleTextForFont(const QString &fontFamily, const QString &sampleText);
0051 QString sampleTextForFont(const QString &fontFamily) const;
0052
0053 void setDisplayFont(const QString &fontFamily, const QFont &font);
0054 std::optional<QFont> displayFont(const QString &fontFamily) const;
0055
0056 public Q_SLOTS:
0057 void setCurrentFont(const QFont &f);
0058
0059 Q_SIGNALS:
0060 void currentFontChanged(const QFont &f);
0061
0062 protected:
0063 bool event(QEvent *e) override;
0064
0065 private:
0066 Q_DISABLE_COPY(QFontComboBox)
0067 Q_DECLARE_PRIVATE(QFontComboBox)
0068 };
0069
0070 Q_DECLARE_OPERATORS_FOR_FLAGS(QFontComboBox::FontFilters)
0071
0072 QT_END_NAMESPACE
0073
0074 #endif