From 425921dc2348ad964597c7c853df33955ea8fb59 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 30 Aug 2019 03:40:25 -0400 Subject: [PATCH 1/3] General: Use override where applicable --- hecl-gui/ArgumentEditor.hpp | 2 +- hecl-gui/MainWindow.hpp | 4 +++- hecl-gui/SysReqTableView.hpp | 10 +++++----- hecl-gui/VectorISATableModel.hpp | 2 +- hecl-gui/VectorISATableModelIntel.hpp | 4 ++-- hecl-gui/VectorISATableView.hpp | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/hecl-gui/ArgumentEditor.hpp b/hecl-gui/ArgumentEditor.hpp index 3c0eb40f4..27ea7706e 100644 --- a/hecl-gui/ArgumentEditor.hpp +++ b/hecl-gui/ArgumentEditor.hpp @@ -18,7 +18,7 @@ class ArgumentEditor : public QDialog { QStringListModel m_model; public: explicit ArgumentEditor(QWidget* parent = nullptr); - virtual ~ArgumentEditor(); + ~ArgumentEditor() override; private slots: void on_addButton_clicked(); diff --git a/hecl-gui/MainWindow.hpp b/hecl-gui/MainWindow.hpp index f1367e96a..ccad1d904 100644 --- a/hecl-gui/MainWindow.hpp +++ b/hecl-gui/MainWindow.hpp @@ -43,9 +43,11 @@ class MainWindow : public QMainWindow { public: explicit MainWindow(QWidget* parent = nullptr); - ~MainWindow(); + ~MainWindow() override; + void setTextTermFormatting(const QString& text); void insertContinueNote(const QString& text); + private slots: void onExtract(); void onExtractFinished(int exitCode, QProcess::ExitStatus); diff --git a/hecl-gui/SysReqTableView.hpp b/hecl-gui/SysReqTableView.hpp index a8223b38c..6fe3287f4 100644 --- a/hecl-gui/SysReqTableView.hpp +++ b/hecl-gui/SysReqTableView.hpp @@ -27,10 +27,10 @@ class SysReqTableModel : public QAbstractTableModel { public: SysReqTableModel(QObject* parent = Q_NULLPTR); - int rowCount(const QModelIndex& parent = QModelIndex()) const; - int columnCount(const QModelIndex& parent = QModelIndex()) const; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; bool isBlenderVersionOk() const { return m_blendMajor > 2 || (m_blendMajor == 2 && m_blendMinor >= 80); } void updateFreeDiskSpace(const QString& path); }; @@ -43,7 +43,7 @@ class SysReqTableView : public QTableView { public: SysReqTableView(QWidget* parent = Q_NULLPTR); - void paintEvent(QPaintEvent* e) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent* e) override; const SysReqTableModel& getModel() const { return m_model; } const VectorISATableView& getVectorISATable() const { return m_vectorISATable; } bool willRun(const URDEVersion& v) const { diff --git a/hecl-gui/VectorISATableModel.hpp b/hecl-gui/VectorISATableModel.hpp index 3f776a794..608329f43 100644 --- a/hecl-gui/VectorISATableModel.hpp +++ b/hecl-gui/VectorISATableModel.hpp @@ -10,5 +10,5 @@ protected: public: VectorISATableModel(QObject* parent = Q_NULLPTR) : QAbstractTableModel(parent) {} - int rowCount(const QModelIndex& parent = QModelIndex()) const { return 1; } + int rowCount(const QModelIndex& parent = QModelIndex()) const override { return 1; } }; diff --git a/hecl-gui/VectorISATableModelIntel.hpp b/hecl-gui/VectorISATableModelIntel.hpp index 1abacc965..d8ce6d791 100644 --- a/hecl-gui/VectorISATableModelIntel.hpp +++ b/hecl-gui/VectorISATableModelIntel.hpp @@ -7,9 +7,9 @@ class VectorISATableModelIntel : public VectorISATableModel { public: VectorISATableModelIntel(QObject* parent = Q_NULLPTR) : VectorISATableModel(parent) {} - int columnCount(const QModelIndex& parent = QModelIndex()) const { return 7; } + int columnCount(const QModelIndex& parent = QModelIndex()) const override { return 7; } - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const { + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override { if (role != Qt::DisplayRole && role != Qt::UserRole) return {}; diff --git a/hecl-gui/VectorISATableView.hpp b/hecl-gui/VectorISATableView.hpp index 8adeb83c6..5bb4aa30b 100644 --- a/hecl-gui/VectorISATableView.hpp +++ b/hecl-gui/VectorISATableView.hpp @@ -19,7 +19,7 @@ class VectorISATableView : public QTableView { public: VectorISATableView(QWidget* parent = Q_NULLPTR); - void paintEvent(QPaintEvent* e) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent* e) override; VectorISA getISA() const { return m_model.getISA(m_maxISA); } bool willRun(VectorISA visa) const { return m_model.willRun(visa); } }; From 9d527b91ca9276845265ab152b64e7eadaeba7b6 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 5 Sep 2019 19:56:42 -0700 Subject: [PATCH 2/3] Use QPlainTextEdit for processOutput rather than QTextEdit for better performance, and memory overhead --- hecl-gui/MainWindow.ui | 206 ++++++++++++++++++++--------------------- 1 file changed, 100 insertions(+), 106 deletions(-) diff --git a/hecl-gui/MainWindow.ui b/hecl-gui/MainWindow.ui index a547e36d2..b59812b7e 100644 --- a/hecl-gui/MainWindow.ui +++ b/hecl-gui/MainWindow.ui @@ -7,7 +7,7 @@ 0 0 684 - 695 + 792 @@ -213,7 +213,7 @@ - + @@ -305,12 +305,6 @@ - - true - - - Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - @@ -326,13 +320,13 @@ System Check - - - - false + + + + <html><head/><body><p><span style=" color:#ff0000;">Development Track selected!<br/>Development builds are considered unstable and may cause crashes. </span></p></body></html> - - 0 + + true @@ -399,6 +393,88 @@ + + + + + 0 + 0 + + + + + 500 + 300 + + + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + + + 68 + 68 + 68 + + + + + + + + QAbstractItemView::NoSelection + + + + + + + false + + + 0 + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + @@ -461,91 +537,6 @@ - - - - Qt::Vertical - - - - 0 - 0 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 500 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - - - 68 - 68 - 68 - - - - - - - - QAbstractItemView::NoSelection - - - @@ -628,15 +619,18 @@ - - - - <html><head/><body><p><span style=" color:#ff0000;">Development Track selected!<br/>Development builds are considered unstable and may cause crashes. </span></p></body></html> + + + + Qt::Vertical - - true + + + 0 + 0 + - + From 55d5e5d4a5cef6f76bc5901a96a9a8e6c570690c Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 5 Sep 2019 20:00:17 -0700 Subject: [PATCH 3/3] Restore some clobbered settings --- hecl-gui/MainWindow.ui | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hecl-gui/MainWindow.ui b/hecl-gui/MainWindow.ui index b59812b7e..fafc3f9c6 100644 --- a/hecl-gui/MainWindow.ui +++ b/hecl-gui/MainWindow.ui @@ -205,7 +205,7 @@ - 1 + 0 @@ -305,6 +305,12 @@ + + true + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse +