TechDraw: Tidy, and fix Qt5 template text edition

This commit is contained in:
Ian Rees
2017-04-26 14:11:34 +12:00
parent 3cf1cfce3e
commit 950ac44f9f
8 changed files with 62 additions and 86 deletions

View File

@@ -47,9 +47,8 @@
using namespace TechDrawGui;
QGISVGTemplate::QGISVGTemplate(QGraphicsScene *scene, QWidget* srWidget)
QGISVGTemplate::QGISVGTemplate(QGraphicsScene *scene)
: QGITemplate(scene),
qgview(srWidget),
firstTime(true)
{
@@ -188,7 +187,6 @@ void QGISVGTemplate::createClickHandles(void)
QString xStr = QString::fromStdString(xMatch[1].str());
QString yStr = QString::fromStdString(yMatch[1].str());
QString editableName = QString::fromStdString(nameMatch[1].str());
double x = Rez::guiX(xStr.toDouble());
double y = Rez::guiX(yStr.toDouble());
@@ -200,8 +198,9 @@ void QGISVGTemplate::createClickHandles(void)
double width = editClickBoxSize;
double height = editClickBoxSize;
TemplateTextField *item = new TemplateTextField(this, tmplte, nameMatch[1].str(), qgview);
auto item( new TemplateTextField(this, tmplte, nameMatch[1].str()) );
float pad = 1;
item->setRect(x - pad, Rez::guiX(-tmplte->getHeight()) + y - height - pad,
width + 2 * pad, height + 2 * pad);