[TD] some Detail View fixes

see https://forum.freecadweb.org/viewtopic.php?f=35&t=45236&p=388925#p388925 for a description of the changes
This commit is contained in:
donovaly
2020-04-18 14:56:01 +02:00
parent bbdaa62890
commit ec58acb7df
6 changed files with 60 additions and 17 deletions

View File

@@ -71,7 +71,7 @@ using namespace Gui;
#define CREATEMODE 0
#define EDITMODE 1
//creation ctor
//creation constructor
TaskDetail::TaskDetail(TechDraw::DrawViewPart* baseFeat):
ui(new Ui_TaskDetail),
m_detailFeat(nullptr),
@@ -119,11 +119,11 @@ TaskDetail::TaskDetail(TechDraw::DrawViewPart* baseFeat):
//use editingFinished signal instead of valueChanged to prevent keyboard lock out
//valueChanged fires every keystroke causing a recompute.
connect(ui->qsbX, SIGNAL(editingFinished()),
connect(ui->qsbX, SIGNAL(valueChanged(double)),
this, SLOT(onXEdit()));
connect(ui->qsbY, SIGNAL(editingFinished()),
connect(ui->qsbY, SIGNAL(valueChanged(double)),
this, SLOT(onYEdit()));
connect(ui->qsbRadius, SIGNAL(editingFinished()),
connect(ui->qsbRadius, SIGNAL(valueChanged(double)),
this, SLOT(onRadiusEdit()));
connect(ui->aeReference, SIGNAL(editingFinished()),
this, SLOT(onReferenceEdit()));
@@ -135,7 +135,7 @@ TaskDetail::TaskDetail(TechDraw::DrawViewPart* baseFeat):
this, SLOT(onHighlightMoved(QPointF)));
}
//edit ctor
//edit constructor
TaskDetail::TaskDetail(TechDraw::DrawViewDetail* detailFeat):
ui(new Ui_TaskDetail),
m_detailFeat(detailFeat),
@@ -190,13 +190,14 @@ TaskDetail::TaskDetail(TechDraw::DrawViewDetail* detailFeat):
connect(ui->pbDragger, SIGNAL(clicked(bool)),
this, SLOT(onDraggerClicked(bool)));
//use editingFinished signal instead of valueChanged to prevent keyboard lock out
//valueChanged fires every keystroke causing a recompute.
connect(ui->qsbX, SIGNAL(editingFinished()),
// the UI file uses setKeyboardTracking(false) so that a
// recomputation will only be triggered when the arrow yeys of the spinboxes are used
connect(ui->qsbX, SIGNAL(valueChanged(double)),
this, SLOT(onXEdit()));
connect(ui->qsbY, SIGNAL(editingFinished()),
connect(ui->qsbY, SIGNAL(valueChanged(double)),
this, SLOT(onYEdit()));
connect(ui->qsbRadius, SIGNAL(editingFinished()),
connect(ui->qsbRadius, SIGNAL(valueChanged(double)),
this, SLOT(onRadiusEdit()));
connect(ui->aeReference, SIGNAL(editingFinished()),
this, SLOT(onReferenceEdit()));

View File

@@ -46,7 +46,7 @@ namespace TechDraw
{
class DrawPage;
class DrawView;
class DrawDetail;
class DrawViewDetail;
class DrawViewPart;
}

View File

@@ -128,6 +128,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
@@ -178,6 +181,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>
@@ -194,6 +200,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
<property name="unit" stdset="0">
<string notr="true"/>
</property>

View File

@@ -238,17 +238,17 @@ void TaskProjGroup::projectionTypeChanged(int index)
void TaskProjGroup::scaleTypeChanged(int index)
{
if(blockUpdate)
if (blockUpdate)
return;
//defaults to prevent scale changing
ui->sbScaleNum->setEnabled(false);
ui->sbScaleDen->setEnabled(false);
if(index == 0) {
if (index == 0) {
// Document Scale Type
multiView->ScaleType.setValue("Page");
} else if(index == 1) {
} else if (index == 1) {
// Automatic Scale Type
//block recompute
multiView->ScaleType.setValue("Automatic");
@@ -256,7 +256,7 @@ void TaskProjGroup::scaleTypeChanged(int index)
multiView->Scale.setValue(autoScale);
//unblock recompute
} else if(index == 2) {
} else if (index == 2) {
// Custom Scale Type
//block recompute
multiView->ScaleType.setValue("Custom");

View File

@@ -54,10 +54,10 @@
#include <Mod/TechDraw/App/DrawViewDetail.h>
#include <Mod/TechDraw/App/DrawHatch.h>
#include <Mod/TechDraw/App/DrawGeomHatch.h>
#include <Mod/TechDraw/App/DrawPage.h>
#include <Mod/TechDraw/App/DrawWeldSymbol.h>
#include <Mod/TechDraw/App/LineGroup.h>
#include<Mod/TechDraw/App/DrawPage.h>
#include "QGIView.h"
#include "TaskDetail.h"
#include "ViewProviderViewPart.h"