Charlie Jiang pushed to branch gsoc-2022-chariri at FreeType / FreeType Demo Programs
Commits:
-
d51b8020
by Charlie Jiang at 2022-07-03T11:14:14+08:00
5 changed files:
- src/ftinspect/engine/engine.hpp
- src/ftinspect/engine/fontfilemanager.cpp
- src/ftinspect/engine/fontfilemanager.hpp
- src/ftinspect/models/ttsettingscomboboxmodel.hpp
- src/ftinspect/panels/settingpanel.cpp
Changes:
... | ... | @@ -175,7 +175,7 @@ public: |
175 | 175 | /// Actual definition
|
176 | 176 | |
177 | 177 | // XXX cover all available modules
|
178 | - enum FontType
|
|
178 | + enum FontType : int
|
|
179 | 179 | {
|
180 | 180 | FontType_CFF,
|
181 | 181 | FontType_TrueType,
|
... | ... | @@ -19,11 +19,6 @@ FontFileManager::FontFileManager() |
19 | 19 | }
|
20 | 20 | |
21 | 21 | |
22 | -FontFileManager::~FontFileManager()
|
|
23 | -{
|
|
24 | -}
|
|
25 | - |
|
26 | - |
|
27 | 22 | int
|
28 | 23 | FontFileManager::size()
|
29 | 24 | {
|
... | ... | @@ -20,7 +20,7 @@ class FontFileManager |
20 | 20 | Q_OBJECT
|
21 | 21 | public:
|
22 | 22 | FontFileManager();
|
23 | - ~FontFileManager() override;
|
|
23 | + virtual ~FontFileManager() = default;
|
|
24 | 24 | |
25 | 25 | int size();
|
26 | 26 | void append(QStringList newFileNames);
|
... | ... | @@ -26,7 +26,7 @@ public: |
26 | 26 | };
|
27 | 27 | |
28 | 28 | explicit HintingModeComboBoxModel(QObject* parent);
|
29 | - ~HintingModeComboBoxModel() = default;
|
|
29 | + virtual ~HintingModeComboBoxModel() = default;
|
|
30 | 30 | |
31 | 31 | int rowCount(const QModelIndex& parent) const;
|
32 | 32 | QVariant data(const QModelIndex& index,
|
... | ... | @@ -53,13 +53,13 @@ private: |
53 | 53 | public:
|
54 | 54 | // Note: Ensure related funcs are also changed when
|
55 | 55 | // these enums are changed!
|
56 | - enum HintingEngineType
|
|
56 | + enum HintingEngineType : int
|
|
57 | 57 | {
|
58 | 58 | HintingEngineType_TrueType,
|
59 | 59 | HintingEngineType_CFF
|
60 | 60 | };
|
61 | 61 | |
62 | - enum HintingMode
|
|
62 | + enum HintingMode : int
|
|
63 | 63 | {
|
64 | 64 | HintingMode_TrueType_v35 = 0,
|
65 | 65 | HintingMode_TrueType_v38,
|
... | ... | @@ -83,7 +83,7 @@ public: |
83 | 83 | };
|
84 | 84 | |
85 | 85 | explicit SimpleComboBoxModel(QObject* parent);
|
86 | - ~SimpleComboBoxModel() = default;
|
|
86 | + virtual ~SimpleComboBoxModel() = default;
|
|
87 | 87 | |
88 | 88 | int rowCount(const QModelIndex& parent) const;
|
89 | 89 | QVariant data(const QModelIndex& index,
|
... | ... | @@ -99,6 +99,7 @@ protected: |
99 | 99 | class LCDFilterComboBoxModel
|
100 | 100 | : public SimpleComboBoxModel
|
101 | 101 | {
|
102 | + Q_OBJECT
|
|
102 | 103 | public:
|
103 | 104 | enum LCDFilter : int;
|
104 | 105 | struct LCDFilterItem
|
... | ... | @@ -108,7 +109,7 @@ public: |
108 | 109 | };
|
109 | 110 | |
110 | 111 | explicit LCDFilterComboBoxModel(QObject* parent);
|
111 | - ~LCDFilterComboBoxModel() = default;
|
|
112 | + virtual ~LCDFilterComboBoxModel() = default;
|
|
112 | 113 | |
113 | 114 | public:
|
114 | 115 | enum LCDFilter
|
... | ... | @@ -124,11 +125,12 @@ public: |
124 | 125 | class AntiAliasingComboBoxModel
|
125 | 126 | : public SimpleComboBoxModel
|
126 | 127 | {
|
128 | + Q_OBJECT
|
|
127 | 129 | public:
|
128 | 130 | enum AntiAliasing : int;
|
129 | 131 | |
130 | 132 | explicit AntiAliasingComboBoxModel(QObject* parent);
|
131 | - ~AntiAliasingComboBoxModel() = default;
|
|
133 | + virtual ~AntiAliasingComboBoxModel() = default;
|
|
132 | 134 |
|
133 | 135 | QVariant data(const QModelIndex& index,
|
134 | 136 | int role) const;
|
... | ... | @@ -143,7 +145,7 @@ private: |
143 | 145 | bool lightAntiAliasingEnabled_;
|
144 | 146 | |
145 | 147 | public:
|
146 | - enum AntiAliasing
|
|
148 | + enum AntiAliasing : int
|
|
147 | 149 | {
|
148 | 150 | AntiAliasing_None,
|
149 | 151 | AntiAliasing_Normal,
|
... | ... | @@ -238,13 +238,13 @@ SettingPanel::createConnections() |
238 | 238 | {
|
239 | 239 | // use `qOverload` here to prevent ambiguity.
|
240 | 240 | connect(hintingModeComboBox_,
|
241 | - qOverload<int>(&QComboBox::currentIndexChanged),
|
|
241 | + QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
242 | 242 | this, &SettingPanel::checkHintingMode);
|
243 | 243 | connect(antiAliasingComboBox_,
|
244 | - qOverload<int>(&QComboBox::currentIndexChanged),
|
|
244 | + QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
245 | 245 | this, &SettingPanel::checkAntiAliasing);
|
246 | 246 | connect(lcdFilterComboBox_,
|
247 | - qOverload<int>(&QComboBox::currentIndexChanged),
|
|
247 | + QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
248 | 248 | this, &SettingPanel::checkLCDFilter);
|
249 | 249 | |
250 | 250 | connect(gammaSlider_, &QSlider::valueChanged,
|