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
appfontdialog.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3// Qt-Security score:significant reason:default
4
5#ifndef QDESIGNER_APPFONTWIDGET_H
6#define QDESIGNER_APPFONTWIDGET_H
7
8#include <QtWidgets/qgroupbox.h>
9#include <QtWidgets/qdialog.h>
10
11QT_BEGIN_NAMESPACE
12
13class AppFontModel;
14
15class QTreeView;
16class QToolButton;
17class QItemSelection;
18class QDesignerSettingsInterface;
19
20// AppFontWidget: Manages application fonts which the user can load and
21// provides API for saving/restoring them.
22
24{
27public:
28 explicit AppFontWidget(QWidget *parent = nullptr);
29
31
32 static void save(QDesignerSettingsInterface *s, const QString &prefix);
33 static void restore(const QDesignerSettingsInterface *s, const QString &prefix);
34
35private slots:
36 void addFiles();
37 void slotRemoveFiles();
38 void slotRemoveAll();
39 void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
40
41private:
42 QTreeView *m_view;
43 QToolButton *m_addButton;
44 QToolButton *m_removeButton;
45 QToolButton *m_removeAllButton;
46 AppFontModel *m_model;
47};
48
49// AppFontDialog: Non modal dialog for AppFontWidget which has Qt::WA_DeleteOnClose set.
50
51class AppFontDialog : public QDialog
52{
55public:
56 explicit AppFontDialog(QWidget *parent = nullptr);
57
58private:
59 AppFontWidget *m_appFontWidget;
60};
61
62QT_END_NAMESPACE
63
64#endif // QDESIGNER_APPFONTWIDGET_H
static void removeFonts(const QModelIndexList &selectedIndexes, AppFontModel *model, QWidget *dialogParent)
@ debugAppFontWidget
static constexpr auto fontFileKeyC
@ IdRole
@ FileNameRole
std::pair< QString, int > FileNameFontIdPair
bool removeAt(int index, QString *errorMessage)
void save(QDesignerSettingsInterface *s, const QString &prefix) const
int add(const QString &fontFile, QString *errorMessage)
static AppFontManager & instance()
void restore(const QDesignerSettingsInterface *s, const QString &prefix)
bool remove(int id, QString *errorMessage)
const FileNameFontIdPairs & fonts() const
bool remove(const QString &fontFile, QString *errorMessage)
void init(const AppFontManager &mgr)
int idAt(const QModelIndex &idx) const
void add(const QString &fontFile, int id)
QStringList fontFiles() const
static void restore(const QDesignerSettingsInterface *s, const QString &prefix)
static void save(QDesignerSettingsInterface *s, const QString &prefix)