WSF
EditorPrefWidget.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2018 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef EDITORPREFWIDGET_HPP
13#define EDITORPREFWIDGET_HPP
14
15#include <QTextCharFormat>
16
17#include "EditorPrefObject.hpp"
18#include "WkfPrefWidget.hpp"
19#include "ui_EditorPrefWidget.h"
20
21class QListWidgetItem;
22
23namespace wizard
24{
25class EditorPrefWidget : public wkf::PrefWidgetT<EditorPrefObject>
26{
27public:
28 EditorPrefWidget(QWidget* parent = nullptr);
29 ~EditorPrefWidget() override = default;
30
31 QString GetCategoryHint() const override { return "Editor"; }
32 bool GetCategoryHintPriority() const override { return true; }
33
34private:
35 void showEvent(QShowEvent* aEvent) override;
36 void ReadPreferenceData(const EditorPrefData& aPrefData) override;
37 void WritePreferenceData(EditorPrefData& aPrefData) override;
38
39 void UpdatePreview();
40 QTextCharFormat MakeFormat(const TextStyle& aStyle) const;
41 void UpdateStyle();
42 void StyleClicked(QListWidgetItem* aItem);
43
44 Ui::EditorPrefWidget mUi;
45 std::map<int, QString> mStyleNames;
46 bool mDarkThemed;
47};
48} // namespace wizard
49
50#endif
EditorPrefWidget(QWidget *parent=nullptr)
Definition EditorPrefWidget.cpp:17
bool GetCategoryHintPriority() const override
Definition EditorPrefWidget.hpp:32
QString GetCategoryHint() const override
Definition EditorPrefWidget.hpp:31
~EditorPrefWidget() override=default
Definition Runner.hpp:22
Definition EditorPrefObject.hpp:89
Definition EditorPrefObject.hpp:72
Copyrights Multiple, All Rights Reserved