From 151fba7fcab1d11d18bfa01e11b9e8c6313949e5 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 29 Jan 2014 05:12:29 +0000 Subject: [PATCH] It removes ".e" form in the conversion of a double to string. Scenario: import "barrage" image, show it, copy coordinate, paste in to Office. The digit contains exponential value. Status bar shows another conversion. --- src/HYDROGUI/HYDROGUI_CopyPastePositionOp.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_CopyPastePositionOp.cxx b/src/HYDROGUI/HYDROGUI_CopyPastePositionOp.cxx index 55a41afc..48ed4378 100644 --- a/src/HYDROGUI/HYDROGUI_CopyPastePositionOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CopyPastePositionOp.cxx @@ -24,6 +24,7 @@ #include "HYDROGUI_Module.h" #include "HYDROGUI_Displayer.h" +#include "HYDROGUI_Tool.h" #include #include @@ -56,8 +57,11 @@ void HYDROGUI_CopyPastePositionOp::startOperation() SUIT_ViewManager* aViewMgr = aModule->getApp()->activeViewManager(); SUIT_ViewWindow* aViewWindow = aViewMgr ? aViewMgr->getActiveView() : 0; double aX, aY, aZ; - if ( aDisplayer->GetCursorViewCoordinates( aViewWindow, aX, aY, aZ ) ) - aResult = tr( "%1,%2" ).arg( aX ).arg( aY ); + if ( aDisplayer->GetCursorViewCoordinates( aViewWindow, aX, aY, aZ ) ) { + QString aXStr = HYDROGUI_Tool::GetCoordinateString( aX ); + QString anYStr = HYDROGUI_Tool::GetCoordinateString( aY ); + aResult = tr( "%1,%2" ).arg( aXStr ).arg( anYStr ); + } } if ( !aResult.isEmpty() ) { QClipboard* aClBoard = QApplication::clipboard(); -- 2.39.2