Add debug utils for QRectF/QPointF
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
# include <QStringList>
|
||||
# include <QRegExp>
|
||||
# include <QMessageBox>
|
||||
#include <QRectF>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -141,3 +142,21 @@ bool DrawGuiUtil::needView(Gui::Command* cmd, bool partOnly)
|
||||
}
|
||||
return haveView;
|
||||
}
|
||||
|
||||
void DrawGuiUtil::dumpRectF(const char* text, const QRectF& r)
|
||||
{
|
||||
Base::Console().Message("DUMP - dumpRectF - %s\n",text);
|
||||
double left = r.left();
|
||||
double right = r.right();
|
||||
double top = r.top();
|
||||
double bottom = r.bottom();
|
||||
Base::Console().Message("Extents: L: %.3f, R: %.3f, T: %.3f, B: %.3f\n",left,right,top,bottom);
|
||||
Base::Console().Message("Size: W: %.3f H: %.3f\n",r.width(),r.height());
|
||||
Base::Console().Message("Centre: (%.3f, %.3f)\n",r.center().x(),r.center().y());
|
||||
}
|
||||
|
||||
void DrawGuiUtil::dumpPointF(const char* text, const QPointF& p)
|
||||
{
|
||||
Base::Console().Message("DUMP - dumpPointF - %s\n",text);
|
||||
Base::Console().Message("Point: (%.3f, %.3f)\n",p.x(),p.y());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user