diff --git a/common/camera.h b/common/camera.h index a3a9ae17..e4408743 100644 --- a/common/camera.h +++ b/common/camera.h @@ -40,7 +40,7 @@ class lcCamera : public lcObject public: lcCamera(bool Simple); lcCamera(float ex, float ey, float ez, float tx, float ty, float tz); - virtual ~lcCamera(); + ~lcCamera(); const char* GetName() const override { @@ -67,12 +67,12 @@ public: mState &= ~LC_CAMERA_ORTHO; } - virtual bool IsSelected() const override + bool IsSelected() const override { return (mState & LC_CAMERA_SELECTION_MASK) != 0; } - virtual bool IsSelected(quint32 Section) const override + bool IsSelected(quint32 Section) const override { switch (Section) { @@ -91,7 +91,7 @@ public: return false; } - virtual void SetSelected(bool Selected) override + void SetSelected(bool Selected) override { if (Selected) mState |= LC_CAMERA_SELECTION_MASK; @@ -99,7 +99,7 @@ public: mState &= ~(LC_CAMERA_SELECTION_MASK | LC_CAMERA_FOCUS_MASK); } - virtual void SetSelected(quint32 Section, bool Selected) override + void SetSelected(quint32 Section, bool Selected) override { switch (Section) { @@ -126,12 +126,12 @@ public: } } - virtual bool IsFocused() const override + bool IsFocused() const override { return (mState & LC_CAMERA_FOCUS_MASK) != 0; } - virtual bool IsFocused(quint32 Section) const override + bool IsFocused(quint32 Section) const override { switch (Section) { @@ -150,7 +150,7 @@ public: return false; } - virtual void SetFocused(quint32 Section, bool Focus) override + void SetFocused(quint32 Section, bool Focus) override { switch (Section) { @@ -177,7 +177,7 @@ public: } } - virtual quint32 GetFocusSection() const override + quint32 GetFocusSection() const override { if (mState & LC_CAMERA_POSITION_FOCUSED) return LC_CAMERA_SECTION_POSITION; @@ -191,12 +191,12 @@ public: return ~0U; } - virtual quint32 GetAllowedTransforms() const override + quint32 GetAllowedTransforms() const override { return LC_OBJECT_TRANSFORM_MOVE_X | LC_OBJECT_TRANSFORM_MOVE_Y | LC_OBJECT_TRANSFORM_MOVE_Z; } - virtual lcVector3 GetSectionPosition(quint32 Section) const override + lcVector3 GetSectionPosition(quint32 Section) const override { switch (Section) { @@ -259,10 +259,10 @@ public: } public: - virtual void RayTest(lcObjectRayTest& ObjectRayTest) const override; - virtual void BoxTest(lcObjectBoxTest& ObjectBoxTest) const override; - virtual void DrawInterface(lcContext* Context, const lcScene& Scene) const override; - virtual void RemoveKeyFrames() override; + void RayTest(lcObjectRayTest& ObjectRayTest) const override; + void BoxTest(lcObjectBoxTest& ObjectBoxTest) const override; + void DrawInterface(lcContext* Context, const lcScene& Scene) const override; + void RemoveKeyFrames() override; void InsertTime(lcStep Start, lcStep Time); void RemoveTime(lcStep Start, lcStep Time); diff --git a/common/group.cpp b/common/group.cpp index e216fc98..e81b2e0c 100644 --- a/common/group.cpp +++ b/common/group.cpp @@ -8,10 +8,6 @@ lcGroup::lcGroup() mGroup = nullptr; } -lcGroup::~lcGroup() -{ -} - void lcGroup::FileLoad(lcFile* File) { qint32 GroupIndex; diff --git a/common/group.h b/common/group.h index 655619ac..5c7e66f4 100644 --- a/common/group.h +++ b/common/group.h @@ -8,7 +8,6 @@ class lcGroup { public: lcGroup(); - ~lcGroup(); lcGroup* GetTopGroup() { diff --git a/common/lc_array.h b/common/lc_array.h index 6d61c675..34cd15b7 100644 --- a/common/lc_array.h +++ b/common/lc_array.h @@ -41,6 +41,24 @@ public: return *this; } + lcArray(lcArray&& Array) + { + mData = nullptr; + *this = std::move(Array); + } + + lcArray& operator=(lcArray&& Array) + { + delete[] mData; + + mData = std::exchange(Array.mData, nullptr); + mLength = std::exchange(Array.mLength, 0); + mAlloc = std::exchange(Array.mAlloc, 0); + mGrow = Array.mGrow; + + return *this; + } + const T& operator[](int Index) const { return mData[Index]; diff --git a/common/lc_context.cpp b/common/lc_context.cpp index 25d8945b..3ba723c9 100644 --- a/common/lc_context.cpp +++ b/common/lc_context.cpp @@ -102,7 +102,7 @@ void lcContext::CreateShaderPrograms() " LC_SHADER_PRECISION float Diffuse = min(abs(dot(Normal, LightDirection)) * 0.6 + 0.65, 1.0);\n" }; - const char* VertexShaders[lcMaterialType::Count] = + const char* VertexShaders[static_cast(lcMaterialType::Count)] = { ":/resources/shaders/unlit_color_vs.glsl", // UnlitColor ":/resources/shaders/unlit_texture_modulate_vs.glsl", // UnlitTextureModulate @@ -113,7 +113,7 @@ void lcContext::CreateShaderPrograms() ":/resources/shaders/fakelit_texture_decal_vs.glsl" // FakeLitTextureDecal }; - const char* FragmentShaders[lcMaterialType::Count] = + const char* FragmentShaders[static_cast(lcMaterialType::Count)] = { ":/resources/shaders/unlit_color_ps.glsl", // UnlitColor ":/resources/shaders/unlit_texture_modulate_ps.glsl", // UnlitTextureModulate diff --git a/common/lc_file.h b/common/lc_file.h index e4b1704d..81a1e7b2 100644 --- a/common/lc_file.h +++ b/common/lc_file.h @@ -18,6 +18,11 @@ public: { } + lcFile(const lcFile&) = delete; + lcFile(lcFile&&) = delete; + lcFile& operator=(const lcFile&) = delete; + lcFile& operator=(lcFile&&) = delete; + virtual long GetPosition() const = 0; virtual void Seek(qint64 Offset, int From) = 0; virtual size_t GetLength() const = 0; @@ -454,7 +459,12 @@ class lcMemFile : public lcFile { public: lcMemFile(); - virtual ~lcMemFile(); + ~lcMemFile(); + + lcMemFile(const lcMemFile&) = delete; + lcMemFile(lcMemFile&&) = delete; + lcMemFile& operator=(const lcMemFile&) = delete; + lcMemFile& operator=(lcMemFile&&) = delete; long GetPosition() const override; void Seek(qint64 Offset, int From) override; @@ -488,11 +498,16 @@ public: { } - virtual ~lcDiskFile() + ~lcDiskFile() { Close(); } + lcDiskFile(const lcDiskFile&) = delete; + lcDiskFile(lcDiskFile&&) = delete; + lcDiskFile& operator=(const lcDiskFile&) = delete; + lcDiskFile& operator=(lcDiskFile&&) = delete; + void SetFileName(const QString& FileName) { mFile.setFileName(FileName); diff --git a/common/lc_http.h b/common/lc_http.h index 7443f379..374492c2 100644 --- a/common/lc_http.h +++ b/common/lc_http.h @@ -12,7 +12,7 @@ class lcHttpReply : public QThread public: lcHttpReply(QObject* Parent, const QString& URL); - void run(); + void run() override; bool error() const { diff --git a/common/lc_library.h b/common/lc_library.h index 4277df84..deb95c85 100644 --- a/common/lc_library.h +++ b/common/lc_library.h @@ -77,6 +77,11 @@ public: lcPiecesLibrary(); ~lcPiecesLibrary(); + lcPiecesLibrary(const lcPiecesLibrary&) = delete; + lcPiecesLibrary(lcPiecesLibrary&&) = delete; + lcPiecesLibrary& operator=(const lcPiecesLibrary&) = delete; + lcPiecesLibrary& operator=(lcPiecesLibrary&&) = delete; + bool Load(const QString& LibraryPath, bool ShowProgress); void Unload(); void RemoveTemporaryPieces(); diff --git a/common/lc_mainwindow.h b/common/lc_mainwindow.h index 09df3191..fd787d62 100644 --- a/common/lc_mainwindow.h +++ b/common/lc_mainwindow.h @@ -40,8 +40,8 @@ public: } protected: - virtual void mousePressEvent(QMouseEvent* Event) override; - virtual void mouseReleaseEvent(QMouseEvent* Event) override; + void mousePressEvent(QMouseEvent* Event) override; + void mouseReleaseEvent(QMouseEvent* Event) override; int mMousePressTab; }; @@ -357,10 +357,10 @@ protected slots: void Print(QPrinter* Printer); protected: - void closeEvent(QCloseEvent *event); - void dragEnterEvent(QDragEnterEvent* Event); - void dropEvent(QDropEvent* Event); - QMenu* createPopupMenu(); + void closeEvent(QCloseEvent *event) override; + void dragEnterEvent(QDragEnterEvent* Event) override; + void dropEvent(QDropEvent* Event) override; + QMenu* createPopupMenu() override; void CreateActions(); void CreateMenus(); diff --git a/common/lc_partpalettedialog.h b/common/lc_partpalettedialog.h index 9ae11db9..18cd15b9 100644 --- a/common/lc_partpalettedialog.h +++ b/common/lc_partpalettedialog.h @@ -15,7 +15,7 @@ public: ~lcPartPaletteDialog(); protected slots: - void accept(); + void accept() override; void on_NewButton_clicked(); void on_DeleteButton_clicked(); void on_RenameButton_clicked(); diff --git a/common/lc_partselectionwidget.h b/common/lc_partselectionwidget.h index fe9c7900..83eae960 100644 --- a/common/lc_partselectionwidget.h +++ b/common/lc_partselectionwidget.h @@ -38,8 +38,8 @@ public: { } - virtual void paint(QPainter* Painter, const QStyleOptionViewItem& Option, const QModelIndex& Index) const; - virtual QSize sizeHint(const QStyleOptionViewItem& Option, const QModelIndex& Index) const; + void paint(QPainter* Painter, const QStyleOptionViewItem& Option, const QModelIndex& Index) const override; + QSize sizeHint(const QStyleOptionViewItem& Option, const QModelIndex& Index) const override; protected: lcPartSelectionListModel* mListModel; @@ -51,12 +51,12 @@ class lcPartSelectionListModel : public QAbstractListModel public: lcPartSelectionListModel(QObject* Parent); - virtual ~lcPartSelectionListModel(); + ~lcPartSelectionListModel(); - virtual int rowCount(const QModelIndex& Parent = QModelIndex()) const; - virtual QVariant data(const QModelIndex& Index, int Role = Qt::DisplayRole) const; - virtual QVariant headerData(int Section, Qt::Orientation Orientation, int Role = Qt::DisplayRole) const; - virtual Qt::ItemFlags flags(const QModelIndex& Index) const; + int rowCount(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; + Qt::ItemFlags flags(const QModelIndex& Index) const override; PieceInfo* GetPieceInfo(const QModelIndex& Index) const { @@ -141,7 +141,7 @@ class lcPartSelectionListView : public QListView public: lcPartSelectionListView(QWidget* Parent, lcPartSelectionWidget* PartSelectionWidget); - virtual void startDrag(Qt::DropActions SupportedActions); + void startDrag(Qt::DropActions SupportedActions) override; void SetCategory(lcPartCategoryType Type, int Index); @@ -232,8 +232,8 @@ protected: void LoadPartPalettes(); void SavePartPalettes(); - virtual void resizeEvent(QResizeEvent* Event); - virtual bool event(QEvent* Event); + void resizeEvent(QResizeEvent* Event) override; + bool event(QEvent* Event) override; QTreeWidget* mCategoriesWidget; QLineEdit* mFilterWidget; diff --git a/common/lc_selectbycolordialog.h b/common/lc_selectbycolordialog.h index 94d3839e..52296c0c 100644 --- a/common/lc_selectbycolordialog.h +++ b/common/lc_selectbycolordialog.h @@ -15,7 +15,7 @@ public: int mColorIndex; public slots: - void accept(); + void accept() override; protected: lcQColorPicker* mColorPicker; diff --git a/common/lc_timelinewidget.h b/common/lc_timelinewidget.h index 6465420d..dfd92488 100644 --- a/common/lc_timelinewidget.h +++ b/common/lc_timelinewidget.h @@ -6,7 +6,7 @@ class lcTimelineWidget : public QTreeWidget public: lcTimelineWidget(QWidget* Parent); - virtual ~lcTimelineWidget(); + ~lcTimelineWidget(); void Update(bool Clear, bool UpdateItems); void UpdateSelection(); @@ -23,8 +23,8 @@ public slots: void CustomMenuRequested(QPoint Pos); protected: - virtual void dropEvent(QDropEvent* Event); - virtual void mousePressEvent(QMouseEvent* Event); + void dropEvent(QDropEvent* DropEvent) override; + void mousePressEvent(QMouseEvent* MouseEvent) override; void UpdateModel(); void UpdateCurrentStepItem(); diff --git a/common/light.h b/common/light.h index fd06dd4c..bbb6fa23 100644 --- a/common/light.h +++ b/common/light.h @@ -26,7 +26,7 @@ class lcLight : public lcObject public: lcLight(float px, float py, float pz); lcLight(float px, float py, float pz, float tx, float ty, float tz); - virtual ~lcLight(); + ~lcLight(); bool IsPointLight() const { @@ -43,12 +43,12 @@ public: return (mState & LC_LIGHT_DIRECTIONAL) != 0; } - virtual bool IsSelected() const override + bool IsSelected() const override { return (mState & LC_LIGHT_SELECTION_MASK) != 0; } - virtual bool IsSelected(quint32 Section) const override + bool IsSelected(quint32 Section) const override { switch (Section) { @@ -63,7 +63,7 @@ public: return false; } - virtual void SetSelected(bool Selected) override + void SetSelected(bool Selected) override { if (Selected) { @@ -76,7 +76,7 @@ public: mState &= ~(LC_LIGHT_SELECTION_MASK | LC_LIGHT_FOCUS_MASK); } - virtual void SetSelected(quint32 Section, bool Selected) override + void SetSelected(quint32 Section, bool Selected) override { switch (Section) { @@ -99,12 +99,12 @@ public: } } - virtual bool IsFocused() const override + bool IsFocused() const override { return (mState & LC_LIGHT_FOCUS_MASK) != 0; } - virtual bool IsFocused(quint32 Section) const override + bool IsFocused(quint32 Section) const override { switch (Section) { @@ -119,7 +119,7 @@ public: return false; } - virtual void SetFocused(quint32 Section, bool Focused) override + void SetFocused(quint32 Section, bool Focused) override { switch (Section) { @@ -142,7 +142,7 @@ public: } } - virtual quint32 GetFocusSection() const override + quint32 GetFocusSection() const override { if (mState & LC_LIGHT_POSITION_FOCUSED) return LC_LIGHT_SECTION_POSITION; @@ -153,12 +153,12 @@ public: return ~0U; } - virtual quint32 GetAllowedTransforms() const override + quint32 GetAllowedTransforms() const override { return LC_OBJECT_TRANSFORM_MOVE_X | LC_OBJECT_TRANSFORM_MOVE_Y | LC_OBJECT_TRANSFORM_MOVE_Z; } - virtual lcVector3 GetSectionPosition(quint32 Section) const override + lcVector3 GetSectionPosition(quint32 Section) const override { switch (Section) { @@ -175,10 +175,10 @@ public: void SaveLDraw(QTextStream& Stream) const; public: - virtual void RayTest(lcObjectRayTest& ObjectRayTest) const override; - virtual void BoxTest(lcObjectBoxTest& ObjectBoxTest) const override; - virtual void DrawInterface(lcContext* Context, const lcScene& Scene) const override; - virtual void RemoveKeyFrames() override; + void RayTest(lcObjectRayTest& ObjectRayTest) const override; + void BoxTest(lcObjectBoxTest& ObjectBoxTest) const override; + void DrawInterface(lcContext* Context, const lcScene& Scene) const override; + void RemoveKeyFrames() override; void InsertTime(lcStep Start, lcStep Time); void RemoveTime(lcStep Start, lcStep Time); diff --git a/common/minifig.h b/common/minifig.h index e7398861..3e9c3b4d 100644 --- a/common/minifig.h +++ b/common/minifig.h @@ -63,14 +63,14 @@ public: void AddTemplatesJson(const QByteArray& TemplateData); QByteArray GetTemplatesJson() const; - void OnDraw(); - void OnLeftButtonDown(); - void OnLeftButtonUp(); - void OnLeftButtonDoubleClick(); - void OnRightButtonDown(); - void OnRightButtonUp(); - void OnMouseMove(); - void OnInitialUpdate(); + void OnDraw() override; + void OnLeftButtonDown() override; + void OnLeftButtonUp() override; + void OnLeftButtonDoubleClick() override; + void OnRightButtonDown() override; + void OnRightButtonUp() override; + void OnMouseMove() override; + void OnInitialUpdate() override; void Calculate(); int GetSelectionIndex(int Type) const; diff --git a/common/piece.h b/common/piece.h index 731ab033..398495dd 100644 --- a/common/piece.h +++ b/common/piece.h @@ -71,19 +71,19 @@ public: lcPiece(const lcPiece& Other); ~lcPiece(); - virtual bool IsSelected() const override + bool IsSelected() const override { return (mState & LC_PIECE_SELECTION_MASK) != 0; } - virtual bool IsSelected(quint32 Section) const override + bool IsSelected(quint32 Section) const override { Q_UNUSED(Section); return (mState & LC_PIECE_SELECTION_MASK) != 0; } - virtual void SetSelected(bool Selected) override + void SetSelected(bool Selected) override { if (Selected) mState |= LC_PIECE_SELECTION_MASK; @@ -91,7 +91,7 @@ public: mState &= ~(LC_PIECE_SELECTION_MASK | LC_PIECE_FOCUS_MASK); } - virtual void SetSelected(quint32 Section, bool Selected) override + void SetSelected(quint32 Section, bool Selected) override { switch (Section) { @@ -174,12 +174,12 @@ public: } } - virtual bool IsFocused() const override + bool IsFocused() const override { return (mState & LC_PIECE_FOCUS_MASK) != 0; } - virtual bool IsFocused(quint32 Section) const override + bool IsFocused(quint32 Section) const override { switch (Section) { @@ -220,7 +220,7 @@ public: return false; } - virtual void SetFocused(quint32 Section, bool Focused) override + void SetFocused(quint32 Section, bool Focused) override { switch (Section) { @@ -303,7 +303,7 @@ public: } } - virtual quint32 GetFocusSection() const override + quint32 GetFocusSection() const override { if (mState & LC_PIECE_POSITION_FOCUSED) return LC_PIECE_SECTION_POSITION; @@ -341,9 +341,9 @@ public: return LC_PIECE_SECTION_INVALID; } - virtual quint32 GetAllowedTransforms() const override; + quint32 GetAllowedTransforms() const override; - virtual lcVector3 GetSectionPosition(quint32 Section) const override + lcVector3 GetSectionPosition(quint32 Section) const override { switch (Section) { @@ -400,10 +400,10 @@ public: return mFileLine; } - virtual void RayTest(lcObjectRayTest& ObjectRayTest) const override; - virtual void BoxTest(lcObjectBoxTest& ObjectBoxTest) const override; - virtual void DrawInterface(lcContext* Context, const lcScene& Scene) const override; - virtual void RemoveKeyFrames() override; + void RayTest(lcObjectRayTest& ObjectRayTest) const override; + void BoxTest(lcObjectBoxTest& ObjectBoxTest) const override; + void DrawInterface(lcContext* Context, const lcScene& Scene) const override; + void RemoveKeyFrames() override; void AddMainModelRenderMeshes(lcScene& Scene, bool Highlight, bool Fade) const; void AddSubModelRenderMeshes(lcScene& Scene, const lcMatrix44& WorldMatrix, int DefaultColorIndex, lcRenderMeshState RenderMeshState, bool ParentActive) const; diff --git a/common/view.h b/common/view.h index 31dbe20f..fbe9f4f5 100644 --- a/common/view.h +++ b/common/view.h @@ -60,7 +60,7 @@ class View : public lcGLWidget { public: View(lcModel* Model); - virtual ~View(); + ~View(); void Clear() { @@ -85,20 +85,20 @@ public: static void CreateResources(lcContext* Context); static void DestroyResources(lcContext* Context); - void OnDraw(); - void OnInitialUpdate(); - void OnUpdateCursor(); - void OnLeftButtonDown(); - void OnLeftButtonUp(); - void OnLeftButtonDoubleClick(); - void OnMiddleButtonDown(); - void OnMiddleButtonUp(); - void OnRightButtonDown(); - void OnRightButtonUp(); - void OnBackButtonUp(); - void OnForwardButtonUp(); - void OnMouseMove(); - void OnMouseWheel(float Direction); + void OnDraw() override; + void OnInitialUpdate() override; + void OnUpdateCursor() override; + void OnLeftButtonDown() override; + void OnLeftButtonUp() override; + void OnLeftButtonDoubleClick() override; + void OnMiddleButtonDown() override; + void OnMiddleButtonUp() override; + void OnRightButtonDown() override; + void OnRightButtonUp() override; + void OnBackButtonUp() override; + void OnForwardButtonUp() override; + void OnMouseMove() override; + void OnMouseWheel(float Direction) override; bool IsTracking() const { diff --git a/qt/lc_qarraydialog.h b/qt/lc_qarraydialog.h index 11d32f64..54e65816 100644 --- a/qt/lc_qarraydialog.h +++ b/qt/lc_qarraydialog.h @@ -20,7 +20,7 @@ public: lcVector3 mRotations[3]; public slots: - void accept(); + void accept() override; private: Ui::lcQArrayDialog *ui; diff --git a/qt/lc_qcategorydialog.h b/qt/lc_qcategorydialog.h index 29e631d7..930b6337 100644 --- a/qt/lc_qcategorydialog.h +++ b/qt/lc_qcategorydialog.h @@ -18,7 +18,7 @@ public: lcLibraryCategory *options; public slots: - void accept(); + void accept() override; private: Ui::lcQCategoryDialog *ui; diff --git a/qt/lc_qcolorlist.h b/qt/lc_qcolorlist.h index b9bc642e..708a6672 100644 --- a/qt/lc_qcolorlist.h +++ b/qt/lc_qcolorlist.h @@ -20,12 +20,12 @@ signals: void colorSelected(int colorIndex); protected: - virtual bool event(QEvent* Event) override; - virtual void paintEvent(QPaintEvent* PaintEvent) override; - virtual void resizeEvent(QResizeEvent* ResizeEvent) override; - virtual void mousePressEvent(QMouseEvent* MouseEvent) override; - virtual void mouseMoveEvent(QMouseEvent* MouseEvent) override; - virtual void keyPressEvent(QKeyEvent* KeyEvent) override; + bool event(QEvent* Event) override; + void paintEvent(QPaintEvent* PaintEvent) override; + void resizeEvent(QResizeEvent* ResizeEvent) override; + void mousePressEvent(QMouseEvent* MouseEvent) override; + void mouseMoveEvent(QMouseEvent* MouseEvent) override; + void keyPressEvent(QKeyEvent* KeyEvent) override; void SelectCell(int CellIdx); diff --git a/qt/lc_qcolorpicker.h b/qt/lc_qcolorpicker.h index 021f6bf1..788e9d0a 100644 --- a/qt/lc_qcolorpicker.h +++ b/qt/lc_qcolorpicker.h @@ -8,7 +8,7 @@ class lcQColorPickerPopup : public QFrame Q_OBJECT public: - lcQColorPickerPopup(QWidget *parent = 0, int colorIndex = 0); + lcQColorPickerPopup(QWidget *parent = nullptr, int colorIndex = 0); ~lcQColorPickerPopup(); void exec(); @@ -23,9 +23,9 @@ public slots: void colorSelected(int colorIndex); protected: - void showEvent(QShowEvent *e); - void hideEvent(QHideEvent *e); - void mouseReleaseEvent(QMouseEvent *e); + void showEvent(QShowEvent* ShowEvent) override; + void hideEvent(QHideEvent* HideEvent) override; + void mouseReleaseEvent(QMouseEvent* MouseEvent) override; private: QEventLoop *eventLoop; diff --git a/qt/lc_qeditgroupsdialog.h b/qt/lc_qeditgroupsdialog.h index c527ac99..b05dca2c 100644 --- a/qt/lc_qeditgroupsdialog.h +++ b/qt/lc_qeditgroupsdialog.h @@ -26,8 +26,8 @@ public: }; public slots: - void accept(); - void reject(); + void accept() override; + void reject() override; void on_newGroup_clicked(); void onItemClicked(QTreeWidgetItem* Item, int Column); void onItemDoubleClicked(QTreeWidgetItem* Item, int Column); @@ -38,7 +38,7 @@ private: void UpdateParents(QTreeWidgetItem* ParentItem, lcGroup* ParentGroup); void AddChildren(QTreeWidgetItem* ParentItem, lcGroup* ParentGroup); - void timerEvent(QTimerEvent* Event); + void timerEvent(QTimerEvent* Event) override; lcModel* mModel; QTreeWidgetItem* mLastItemClicked; diff --git a/qt/lc_qfinddialog.h b/qt/lc_qfinddialog.h index fb8ae95c..1d9317a7 100644 --- a/qt/lc_qfinddialog.h +++ b/qt/lc_qfinddialog.h @@ -18,7 +18,7 @@ public: lcSearchOptions* mSearchOptions; public slots: - void accept(); + void accept() override; private: Ui::lcQFindDialog *ui; diff --git a/qt/lc_qglwidget.h b/qt/lc_qglwidget.h index 2232d8d3..da704de7 100644 --- a/qt/lc_qglwidget.h +++ b/qt/lc_qglwidget.h @@ -6,10 +6,10 @@ class lcGLWidget; class lcQGLWidget : public QGLWidget { public: - lcQGLWidget(QWidget *parent, lcGLWidget *owner, bool view); + lcQGLWidget(QWidget* Parent, lcGLWidget* Owner, bool IsView); ~lcQGLWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; lcGLWidget *widget; QSize preferredSize; @@ -27,20 +27,20 @@ public: QTimer mUpdateTimer; protected: - void initializeGL(); - void resizeGL(int x, int h); - void paintGL(); - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - void mouseDoubleClickEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void wheelEvent(QWheelEvent *event); - void dragEnterEvent(QDragEnterEvent *event); - void dragLeaveEvent(QDragLeaveEvent *event); - void dragMoveEvent(QDragMoveEvent *event); - void dropEvent(QDropEvent *event); + void initializeGL() override; + void resizeGL(int Width, int Height) override; + void paintGL() override; + void keyPressEvent(QKeyEvent* KeyEvent) override; + void keyReleaseEvent(QKeyEvent* KeyEvent) override; + void mousePressEvent(QMouseEvent* MouseEvent) override; + void mouseReleaseEvent(QMouseEvent* MouseEvent) override; + void mouseDoubleClickEvent(QMouseEvent* MouseEvent) override; + void mouseMoveEvent(QMouseEvent* MouseEvent) override; + void wheelEvent(QWheelEvent* WheelEvent) override; + void dragEnterEvent(QDragEnterEvent* DragEnterEvent) override; + void dragLeaveEvent(QDragLeaveEvent* DragLeaveEvent) override; + void dragMoveEvent(QDragMoveEvent* DragMoveEvent) override; + void dropEvent(QDropEvent* DropEvent) override; int mWheelAccumulator; }; diff --git a/qt/lc_qgroupdialog.h b/qt/lc_qgroupdialog.h index a3a0ac7d..f4a20c26 100644 --- a/qt/lc_qgroupdialog.h +++ b/qt/lc_qgroupdialog.h @@ -11,15 +11,14 @@ class lcQGroupDialog : public QDialog Q_OBJECT public: - explicit lcQGroupDialog(QWidget *parent, const QString& Name); + explicit lcQGroupDialog(QWidget* Parent, const QString& Name); ~lcQGroupDialog(); QString mName; public slots: - void accept(); + void accept() override; private: Ui::lcQGroupDialog *ui; }; - diff --git a/qt/lc_qhtmldialog.h b/qt/lc_qhtmldialog.h index 3774f99e..e1550529 100644 --- a/qt/lc_qhtmldialog.h +++ b/qt/lc_qhtmldialog.h @@ -16,7 +16,7 @@ public: ~lcQHTMLDialog(); public slots: - void accept(); + void accept() override; void on_outputFolderBrowse_clicked(); private: diff --git a/qt/lc_qimagedialog.h b/qt/lc_qimagedialog.h index 32c013be..4ef8855e 100644 --- a/qt/lc_qimagedialog.h +++ b/qt/lc_qimagedialog.h @@ -21,7 +21,7 @@ public: int mEnd; public slots: - void accept(); + void accept() override; void on_fileNameBrowse_clicked(); private: diff --git a/qt/lc_qmodellistdialog.h b/qt/lc_qmodellistdialog.h index 18967321..981370f0 100644 --- a/qt/lc_qmodellistdialog.h +++ b/qt/lc_qmodellistdialog.h @@ -19,7 +19,7 @@ public: QList>& mModels; public slots: - void accept(); + void accept() override; void on_NewModel_clicked(); void on_DeleteModel_clicked(); void on_RenameModel_clicked(); diff --git a/qt/lc_qpreferencesdialog.h b/qt/lc_qpreferencesdialog.h index 79607b4b..521dd6a5 100644 --- a/qt/lc_qpreferencesdialog.h +++ b/qt/lc_qpreferencesdialog.h @@ -22,10 +22,10 @@ public: CategoryRole = Qt::UserRole }; - bool eventFilter(QObject *object, QEvent *event); + bool eventFilter(QObject* Object, QEvent* Event) override; public slots: - void accept(); + void accept() override; void on_partsLibraryBrowse_clicked(); void on_partsArchiveBrowse_clicked(); void on_ColorConfigBrowseButton_clicked(); diff --git a/qt/lc_qpropertiesdialog.cpp b/qt/lc_qpropertiesdialog.cpp index c429ceee..e20b56a2 100644 --- a/qt/lc_qpropertiesdialog.cpp +++ b/qt/lc_qpropertiesdialog.cpp @@ -16,7 +16,7 @@ public: mLast = false; } - virtual bool operator<(const QTableWidgetItem& Other) const override + bool operator<(const QTableWidgetItem& Other) const override { if (mLast) return false; diff --git a/qt/lc_qpropertiesdialog.h b/qt/lc_qpropertiesdialog.h index 6a755711..6f89d056 100644 --- a/qt/lc_qpropertiesdialog.h +++ b/qt/lc_qpropertiesdialog.h @@ -18,7 +18,7 @@ public: lcPropertiesDialogOptions *options; public slots: - void accept(); + void accept() override; void colorClicked(); void on_imageNameButton_clicked(); diff --git a/qt/lc_qpropertiestree.cpp b/qt/lc_qpropertiestree.cpp index d98965db..9e2f6817 100644 --- a/qt/lc_qpropertiestree.cpp +++ b/qt/lc_qpropertiestree.cpp @@ -406,7 +406,7 @@ public: { } - QValidator::State validate(QString& Input, int& Pos) const + QValidator::State validate(QString& Input, int& Pos) const override { if (mAllowEmpty && Input.isEmpty()) return Acceptable; diff --git a/qt/lc_qpropertiestree.h b/qt/lc_qpropertiestree.h index e369a6f0..7ea77165 100644 --- a/qt/lc_qpropertiestree.h +++ b/qt/lc_qpropertiestree.h @@ -21,7 +21,7 @@ class lcQPropertiesTree : public QTreeWidget public: lcQPropertiesTree(QWidget *parent = 0); - QSize sizeHint() const; + QSize sizeHint() const override; QTreeWidgetItem *indexToItem(const QModelIndex &index) const { @@ -57,9 +57,9 @@ protected slots: void slotColorButtonClicked(); protected: - void keyPressEvent(QKeyEvent *event); - void mousePressEvent(QMouseEvent *event); - void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; + void keyPressEvent(QKeyEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; void updateColorEditor(QPushButton *editor, int value) const; QTreeWidgetItem *addProperty(QTreeWidgetItem *parent, const QString& label, PropertyType propertyType); @@ -128,13 +128,13 @@ public: m_treeWidget = treeWidget; } - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; - void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; - void setModelData(QWidget *, QAbstractItemModel *, const QModelIndex &) const {} - void setEditorData(QWidget *, const QModelIndex &) const {} - bool eventFilter(QObject *object, QEvent *event); + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override; + void setModelData(QWidget *, QAbstractItemModel *, const QModelIndex &) const override {} + void setEditorData(QWidget *, const QModelIndex &) const override {} + bool eventFilter(QObject *object, QEvent *event) override; QTreeWidgetItem *editedItem() const { @@ -147,8 +147,8 @@ public: } protected: - void drawDecoration(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QPixmap &pixmap) const; - void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const; + void drawDecoration(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QPixmap &pixmap) const override; + void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const override; private slots: void slotEditorDestroyed(QObject *object); diff --git a/qt/lc_qselectdialog.h b/qt/lc_qselectdialog.h index 6890b265..183ab4ed 100644 --- a/qt/lc_qselectdialog.h +++ b/qt/lc_qselectdialog.h @@ -23,7 +23,7 @@ public: }; public slots: - void accept(); + void accept() override; void on_selectAll_clicked(); void on_selectNone_clicked(); void on_selectInvert_clicked(); diff --git a/qt/lc_qupdatedialog.h b/qt/lc_qupdatedialog.h index 8a495418..1038c91b 100644 --- a/qt/lc_qupdatedialog.h +++ b/qt/lc_qupdatedialog.h @@ -23,8 +23,8 @@ public: public slots: void DownloadFinished(lcHttpReply* Reply); - void accept(); - void reject(); + void accept() override; + void reject() override; void finished(int result); private: diff --git a/qt/lc_qutils.h b/qt/lc_qutils.h index 98032b62..70b8c7c4 100644 --- a/qt/lc_qutils.h +++ b/qt/lc_qutils.h @@ -9,9 +9,9 @@ float lcParseValueLocalized(const QString& Value); class lcQTreeWidgetColumnStretcher : public QObject { public: - lcQTreeWidgetColumnStretcher(QTreeWidget *treeWidget, int columnToStretch); + lcQTreeWidgetColumnStretcher(QTreeWidget* TreeWidget, int ColumnToStretch); - virtual bool eventFilter(QObject *obj, QEvent *ev); + bool eventFilter(QObject* Object, QEvent* Event) override; const int m_columnToStretch; }; @@ -24,7 +24,7 @@ public: { } - virtual QSize sizeHint() const override + QSize sizeHint() const override { QFontMetrics FontMetrics(font()); @@ -34,7 +34,7 @@ public: } protected: - virtual bool event(QEvent* Event) override + bool event(QEvent* Event) override { if (Event->type() == QEvent::ShortcutOverride) { diff --git a/qt/lc_renderdialog.h b/qt/lc_renderdialog.h index 5242ac20..95c6fdd9 100644 --- a/qt/lc_renderdialog.h +++ b/qt/lc_renderdialog.h @@ -24,8 +24,8 @@ public: } protected: - virtual void resizeEvent(QResizeEvent* Event) override; - virtual void paintEvent(QPaintEvent* PaintEvent) override; + void resizeEvent(QResizeEvent* Event) override; + void paintEvent(QPaintEvent* PaintEvent) override; QImage mImage; QImage mScaledImage; @@ -40,7 +40,7 @@ public: ~lcRenderDialog(); public slots: - void reject(); + void reject() override; void on_RenderButton_clicked(); void on_OutputBrowseButton_clicked(); void Update(); diff --git a/qt/lc_setsdatabasedialog.h b/qt/lc_setsdatabasedialog.h index 4989d8e1..42828b44 100644 --- a/qt/lc_setsdatabasedialog.h +++ b/qt/lc_setsdatabasedialog.h @@ -25,7 +25,7 @@ public: return mInventory; } - virtual bool eventFilter(QObject* Object, QEvent* Event) override; + bool eventFilter(QObject* Object, QEvent* Event) override; public slots: void DownloadFinished(lcHttpReply* Reply);