Base: UnitsSchema: return std::string
This commit is contained in:
committed by
Yorik van Havre
parent
0b3adee2ab
commit
3bddb723d5
@@ -35,6 +35,8 @@
|
||||
# include <GL/glu.h>
|
||||
# endif
|
||||
|
||||
# include <fmt/format.h>
|
||||
|
||||
# include <Inventor/SbBox.h>
|
||||
# include <Inventor/SoEventManager.h>
|
||||
# include <Inventor/SoPickedPoint.h>
|
||||
@@ -2510,7 +2512,7 @@ void View3DInventorViewer::printDimension() const
|
||||
float fWidth = -1.0;
|
||||
getDimensions(fHeight, fWidth);
|
||||
|
||||
QString dim;
|
||||
std::string dim;
|
||||
|
||||
if (fWidth >= 0.0 && fHeight >= 0.0) {
|
||||
// Translate screen units into user's unit schema
|
||||
@@ -2518,14 +2520,14 @@ void View3DInventorViewer::printDimension() const
|
||||
Base::Quantity qHeight(Base::Quantity::MilliMetre);
|
||||
qWidth.setValue(fWidth);
|
||||
qHeight.setValue(fHeight);
|
||||
QString wStr = Base::UnitsApi::schemaTranslate(qWidth);
|
||||
QString hStr = Base::UnitsApi::schemaTranslate(qHeight);
|
||||
auto wStr = Base::UnitsApi::schemaTranslate(qWidth);
|
||||
auto hStr = Base::UnitsApi::schemaTranslate(qHeight);
|
||||
|
||||
// Create final string and update window
|
||||
dim = QString::fromLatin1("%1 x %2").arg(wStr, hStr);
|
||||
dim = fmt::format("{} x {}", wStr, hStr);
|
||||
}
|
||||
|
||||
getMainWindow()->setPaneText(2, dim);
|
||||
getMainWindow()->setPaneText(2, QString::fromStdString(dim));
|
||||
}
|
||||
|
||||
void View3DInventorViewer::selectAll()
|
||||
|
||||
Reference in New Issue
Block a user