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());
|
||||
}
|
||||
|
||||
@@ -24,6 +24,15 @@
|
||||
#define _DrawGuiUtil_h_
|
||||
|
||||
#include <string>
|
||||
#include <QRectF>
|
||||
#include <QPointF>
|
||||
|
||||
namespace TechDraw {
|
||||
class DrawPage;
|
||||
}
|
||||
namespace Gui {
|
||||
class Command;
|
||||
}
|
||||
|
||||
namespace TechDrawGui
|
||||
{
|
||||
@@ -34,6 +43,8 @@ class TechDrawGuiExport DrawGuiUtil {
|
||||
static TechDraw::DrawPage* findPage(Gui::Command* cmd);
|
||||
static bool needPage(Gui::Command* cmd);
|
||||
static bool needView(Gui::Command* cmd, bool partOnly = true);
|
||||
static void dumpRectF(const char* text, const QRectF& r);
|
||||
static void dumpPointF(const char* text, const QPointF& p);
|
||||
};
|
||||
|
||||
} //end namespace TechDrawGui
|
||||
|
||||
Reference in New Issue
Block a user