From bc3c3bbc9c2c023e75e17092eef59a47307c74e8 Mon Sep 17 00:00:00 2001 From: Dave Corley Date: Sun, 12 Jan 2025 09:20:31 -0700 Subject: [PATCH] FIX: tooltips lose some of the relevant information if not stored as a QString --- apps/opencs/view/render/instancemode.cpp | 38 ++++++++++++------------ apps/opencs/view/render/instancemode.hpp | 1 + 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/apps/opencs/view/render/instancemode.cpp b/apps/opencs/view/render/instancemode.cpp index 7a59222eff8..fb085f075a5 100644 --- a/apps/opencs/view/render/instancemode.cpp +++ b/apps/opencs/view/render/instancemode.cpp @@ -60,24 +60,6 @@ #include "pagedworldspacewidget.hpp" #include "worldspacewidget.hpp" -namespace -{ - constexpr std::string_view sInstanceModeTooltip = R"( - Instance editing - -)"; -} - int CSVRender::InstanceMode::getSubModeFromId(const std::string& id) const { return id == "move" ? 0 : (id == "rotate" ? 1 : 2); @@ -312,10 +294,28 @@ void CSVRender::InstanceMode::setDragAxis(const char axis) mDragAxis = newDragAxis; } +QString CSVRender::InstanceMode::getTooltip() +{ + return QString( + "Instance editing" + ""); +} + CSVRender::InstanceMode::InstanceMode( WorldspaceWidget* worldspaceWidget, osg::ref_ptr parentNode, QWidget* parent) : EditMode(worldspaceWidget, Misc::ScalableIcon::load(":scenetoolbar/editing-instance"), - Mask_Reference | Mask_Terrain, sInstanceModeTooltip.data(), parent) + Mask_Reference | Mask_Terrain, getTooltip(), parent) , mSubMode(nullptr) , mSubModeId("move") , mSelectionMode(nullptr) diff --git a/apps/opencs/view/render/instancemode.hpp b/apps/opencs/view/render/instancemode.hpp index 193423efd5c..f4dd9d99ea6 100644 --- a/apps/opencs/view/render/instancemode.hpp +++ b/apps/opencs/view/render/instancemode.hpp @@ -53,6 +53,7 @@ namespace CSVRender std::vector mObjectsAtDragStart; CSMWorld::IdTable* mSelectionGroups; + QString getTooltip(); int getSubModeFromId(const std::string& id) const; osg::Vec3 quatToEuler(const osg::Quat& quat) const;