From 3c2bd55df659ba2f35dd370a8eac9a84a6fe4153 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Tue, 9 Dec 2025 14:26:36 -0500 Subject: [PATCH] CPoiMapSidebar: Pass QModelIndex by const reference --- src/Editor/WorldEditor/CPoiMapSidebar.cpp | 8 ++++---- src/Editor/WorldEditor/CPoiMapSidebar.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Editor/WorldEditor/CPoiMapSidebar.cpp b/src/Editor/WorldEditor/CPoiMapSidebar.cpp index 3a774b9e..9583977e 100644 --- a/src/Editor/WorldEditor/CPoiMapSidebar.cpp +++ b/src/Editor/WorldEditor/CPoiMapSidebar.cpp @@ -253,7 +253,7 @@ void CPoiMapSidebar::OnSelectionChanged(const QItemSelection& rkSelected, const } } -void CPoiMapSidebar::OnItemDoubleClick(QModelIndex Index) +void CPoiMapSidebar::OnItemDoubleClick(const QModelIndex& Index) { QModelIndex SourceIndex = mModel.mapToSource(Index); CScriptNode *pPOI = mSourceModel.PoiNodePointer(SourceIndex); @@ -361,7 +361,7 @@ void CPoiMapSidebar::OnRemovePoiButtonClicked() } } -void CPoiMapSidebar::OnPoiPicked(const SRayIntersection& rkIntersect, QMouseEvent *pEvent) +void CPoiMapSidebar::OnPoiPicked(const SRayIntersection& rkIntersect, const QMouseEvent* pEvent) { CScriptNode *pPOI = static_cast(rkIntersect.pNode); if (pPOI->Instance()->ObjectTypeID() != CFourCC("POIN").ToLong()) return; @@ -374,7 +374,7 @@ void CPoiMapSidebar::OnPoiPicked(const SRayIntersection& rkIntersect, QMouseEven Editor()->ExitPickMode(); } -void CPoiMapSidebar::OnModelPicked(const SRayIntersection& rkRayIntersect, QMouseEvent* pEvent) +void CPoiMapSidebar::OnModelPicked(const SRayIntersection& rkRayIntersect, const QMouseEvent* pEvent) { if (!rkRayIntersect.pNode) return; @@ -418,7 +418,7 @@ void CPoiMapSidebar::OnModelPicked(const SRayIntersection& rkRayIntersect, QMous } } -void CPoiMapSidebar::OnModelHover(const SRayIntersection& rkIntersect, QMouseEvent *pEvent) +void CPoiMapSidebar::OnModelHover(const SRayIntersection& rkIntersect, const QMouseEvent *pEvent) { // Restore old hover model to correct overlay color, and set new hover model if (mpHoverModel) diff --git a/src/Editor/WorldEditor/CPoiMapSidebar.h b/src/Editor/WorldEditor/CPoiMapSidebar.h index 94d0a1f6..14fb6b50 100644 --- a/src/Editor/WorldEditor/CPoiMapSidebar.h +++ b/src/Editor/WorldEditor/CPoiMapSidebar.h @@ -66,16 +66,16 @@ public slots: void SetHighlightAll(); void SetHighlightNone(); void OnSelectionChanged(const QItemSelection& rkSelected, const QItemSelection& rkDeselected); - void OnItemDoubleClick(QModelIndex Index); + void OnItemDoubleClick(const QModelIndex& Index); void OnUnmapAllPressed(); void OnPickButtonClicked(); void StopPicking(); void OnInstanceListButtonClicked(); void OnRemovePoiButtonClicked(); - void OnPoiPicked(const SRayIntersection& rkIntersect, QMouseEvent *pEvent); - void OnModelPicked(const SRayIntersection& rkIntersect, QMouseEvent *pEvent); - void OnModelHover(const SRayIntersection& rkIntersect, QMouseEvent *pEvent); + void OnPoiPicked(const SRayIntersection& rkIntersect, const QMouseEvent* pEvent); + void OnModelPicked(const SRayIntersection& rkIntersect, const QMouseEvent* pEvent); + void OnModelHover(const SRayIntersection& rkIntersect, const QMouseEvent* pEvent); }; #endif // CPOIMAPEDITDIALOG_H