diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /models/FontOverrideModel.hpp | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'models/FontOverrideModel.hpp')
| -rwxr-xr-x | models/FontOverrideModel.hpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/models/FontOverrideModel.hpp b/models/FontOverrideModel.hpp index 2bff9aa8..c23e119a 100755 --- a/models/FontOverrideModel.hpp +++ b/models/FontOverrideModel.hpp @@ -1,29 +1,29 @@ -#ifndef FONT_OVERRIDE_MODEL_HPP_ -#define FONT_OVERRIDE_MODEL_HPP_ - -#include <QIdentityProxyModel> -#include <QFont> - -// fix up font display as header font changes don't currently work -// from views (I think fixed in Qt 5.11.1) -class FontOverrideModel final - : public QIdentityProxyModel -{ -public: - FontOverrideModel (QObject * parent = nullptr) : QIdentityProxyModel {parent} {} - void set_font (QFont const& font) {font_ = font;} - QVariant data (QModelIndex const& index, int role) const override - { - if (Qt::FontRole == role) return font_; - return QIdentityProxyModel::data (index, role); - } - QVariant headerData (int section, Qt::Orientation orientation, int role) const override - { - if (Qt::FontRole == role) return font_; - return QIdentityProxyModel::headerData (section, orientation, role); - } -private: - QFont font_; -}; - -#endif +#ifndef FONT_OVERRIDE_MODEL_HPP_
+#define FONT_OVERRIDE_MODEL_HPP_
+
+#include <QIdentityProxyModel>
+#include <QFont>
+
+// fix up font display as header font changes don't currently work
+// from views (I think fixed in Qt 5.11.1)
+class FontOverrideModel final
+ : public QIdentityProxyModel
+{
+public:
+ FontOverrideModel (QObject * parent = nullptr) : QIdentityProxyModel {parent} {}
+ void set_font (QFont const& font) {font_ = font;}
+ QVariant data (QModelIndex const& index, int role) const override
+ {
+ if (Qt::FontRole == role) return font_;
+ return QIdentityProxyModel::data (index, role);
+ }
+ QVariant headerData (int section, Qt::Orientation orientation, int role) const override
+ {
+ if (Qt::FontRole == role) return font_;
+ return QIdentityProxyModel::headerData (section, orientation, role);
+ }
+private:
+ QFont font_;
+};
+
+#endif
|
