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
4#ifndef QDESIGNER_APPFONTWIDGET_H
5#define QDESIGNER_APPFONTWIDGET_H
6
7#include <QtWidgets/qgroupbox.h>
8#include <QtWidgets/qdialog.h>
9
10QT_BEGIN_NAMESPACE
11
12class AppFontModel;
13
14class QTreeView;
15class QToolButton;
16class QItemSelection;
17class QDesignerSettingsInterface;
18
19// AppFontWidget: Manages application fonts which the user can load and
20// provides API for saving/restoring them.
21
23{
26public:
27 explicit AppFontWidget(QWidget *parent = nullptr);
28
30
31 static void save(QDesignerSettingsInterface *s, const QString &prefix);
32 static void restore(const QDesignerSettingsInterface *s, const QString &prefix);
33
34private slots:
35 void addFiles();
36 void slotRemoveFiles();
37 void slotRemoveAll();
38 void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
39
40private:
41 QTreeView *m_view;
42 QToolButton *m_addButton;
43 QToolButton *m_removeButton;
44 QToolButton *m_removeAllButton;
45 AppFontModel *m_model;
46};
47
48// AppFontDialog: Non modal dialog for AppFontWidget which has Qt::WA_DeleteOnClose set.
49
50class AppFontDialog : public QDialog
51{
54public:
55 explicit AppFontDialog(QWidget *parent = nullptr);
56
57private:
58 AppFontWidget *m_appFontWidget;
59};
60
61QT_END_NAMESPACE
62
63#endif // QDESIGNER_APPFONTWIDGET_H
static void removeFonts(const QModelIndexList &selectedIndexes, AppFontModel *model, QWidget *dialogParent)
static constexpr auto fontFileKeyC
@ debugAppFontWidget
@ IdRole
@ FileNameRole
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)