Don't show section "Size and Height".

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-11-11 20:52:25 +02:00
parent 0838cf2817
commit 4e21bf05e0
8 changed files with 9 additions and 129 deletions

View File

@ -617,13 +617,6 @@ QStringList VMeasurements::ListAll() const
}
}
if (type == MeasurementsType::Standard)
{
// Additionaly each standard table provide size and height
listNames.append(size_M);
listNames.append(height_M);
}
return listNames;
}
@ -648,12 +641,6 @@ bool VMeasurements::IsDefinedKnownNamesValid() const
{
QStringList names = AllGroupNames();
if (type == MeasurementsType::Standard)
{
names.append(size_M);
names.append(height_M);
}
QSet<QString> set;
foreach (const QString &var, names)
{
@ -676,14 +663,12 @@ bool VMeasurements::IsDefinedKnownNamesValid() const
void VMeasurements::SetDataSize()
{
data->SetSize(UnitConvertor(BaseSize(), MUnit(), *data->GetPatternUnit()));
data->SetSizeName(size_M);
}
//---------------------------------------------------------------------------------------------------------------------
void VMeasurements::SetDataHeight()
{
data->SetHeight(UnitConvertor(BaseHeight(), MUnit(), *data->GetPatternUnit()));
data->SetHeightName(height_M);
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -36,8 +36,6 @@
// Keep synchronize all names with initialization in VTranslateVars class!!!!!
//measurements
// Need for standard table
const QString size_M = QStringLiteral("size");
// A
const QString height_M = QStringLiteral("height"); // A01
const QString heightNeckBack_M = QStringLiteral("height_neck_back"); // A02

View File

@ -192,8 +192,6 @@ enum class GSizes : unsigned char { ALL,
#endif
// measurements
// Need for standard table
extern const QString size_M;
// A
extern const QString height_M; // A01
extern const QString heightNeckBack_M; // A02

View File

@ -507,7 +507,7 @@ const QHash<QString, qreal *> VContainer::PlainVariables() const
{
QHash<QString, qreal *> vars;
QHash<QString, QSharedPointer<VInternalVariable>>::const_iterator i = d->variables.constBegin();
auto i = d->variables.constBegin();
while (i != d->variables.constEnd())
{
QSharedPointer<VInternalVariable> var = i.value();
@ -522,12 +522,6 @@ const QHash<QString, qreal *> VContainer::PlainVariables() const
++i;
}
if (qApp->patternType() == MeasurementsType::Standard)
{
vars.insert(SizeName(), rsize());
vars.insert(HeightName(), rheight());
}
return vars;
}
@ -602,12 +596,6 @@ void VContainer::SetSize(qreal size)
_size = size;
}
//---------------------------------------------------------------------------------------------------------------------
void VContainer::SetSizeName(const QString &name)
{
d->sizeName = name;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief SetGrowth set value of growth
@ -618,12 +606,6 @@ void VContainer::SetHeight(qreal height)
_height = height;
}
//---------------------------------------------------------------------------------------------------------------------
void VContainer::SetHeightName(const QString &name)
{
d->heightName = name;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief size return size
@ -640,12 +622,6 @@ qreal *VContainer::rsize()
return &_size;
}
//---------------------------------------------------------------------------------------------------------------------
QString VContainer::SizeName() const
{
return d->sizeName;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief height return height
@ -662,12 +638,6 @@ qreal *VContainer::rheight()
return &_height;
}
//---------------------------------------------------------------------------------------------------------------------
QString VContainer::HeightName() const
{
return d->heightName;
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief data container with datagObjects return container of gObjects

View File

@ -54,20 +54,18 @@ class VContainerData : public QSharedData //-V690
public:
VContainerData(const VTranslateVars *trVars, const Unit *patternUnit)
:sizeName(size_M), heightName(height_M), gObjects(QHash<quint32, QSharedPointer<VGObject> >()),
:gObjects(QHash<quint32, QSharedPointer<VGObject> >()),
variables(QHash<QString, QSharedPointer<VInternalVariable> > ()), details(QHash<quint32, VDetail>()),
trVars(trVars), patternUnit(patternUnit)
{}
VContainerData(const VContainerData &data)
:QSharedData(data), sizeName(data.sizeName), heightName(data.heightName), gObjects(data.gObjects),
:QSharedData(data), gObjects(data.gObjects),
variables(data.variables), details(data.details), trVars(data.trVars), patternUnit(data.patternUnit)
{}
virtual ~VContainerData();
QString sizeName;
QString heightName;
/**
* @brief gObjects graphicals objects of pattern.
*/
@ -141,15 +139,11 @@ public:
static void ClearUniqueNames();
static void SetSize(qreal size);
void SetSizeName(const QString &name);
static void SetHeight(qreal height);
void SetHeightName(const QString &name);
static qreal size();
static qreal *rsize();
QString SizeName() const;
static qreal height();
static qreal *rheight();
QString HeightName()const;
bool VariableExist(const QString& name);

View File

@ -120,23 +120,6 @@ void DialogEditWrongFormula::ValChenged(int row)
return;
}
QListWidgetItem *item = ui->listWidget->item( row );
if (ui->radioButtonSizeGrowth->isChecked())
{
if (item->text()==data->HeightName())
{
SetDescription(item->text(), data->height(), VDomDocument::UnitsToStr(qApp->patternUnit(), true),
tr("Height"));
return;
}
if (item->text()==data->SizeName())
{
SetDescription(item->text(), data->size(), VDomDocument::UnitsToStr(qApp->patternUnit(), true),
tr("Size"));
return;
}
}
if (ui->radioButtonStandardTable->isChecked())
{
const QString name = qApp->TrVars()->VarFromUser(item->text());
@ -203,31 +186,6 @@ void DialogEditWrongFormula::ValChenged(int row)
}
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief SizeHeight show in list base variables
*/
void DialogEditWrongFormula::SizeHeight()
{
ui->checkBoxHideEmpty->setEnabled(false);
ui->listWidget->blockSignals(true);
ui->listWidget->clear();
{
QListWidgetItem *item = new QListWidgetItem(data->HeightName());
item->setFont(QFont("Times", 12, QFont::Bold));
ui->listWidget->addItem(item);
}
QListWidgetItem *item = new QListWidgetItem(data->SizeName());
item->setFont(QFont("Times", 12, QFont::Bold));
ui->listWidget->addItem(item);
ui->listWidget->blockSignals(false);
ui->listWidget->setCurrentRow (0);
}
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief PutHere put variable into edit
@ -386,17 +344,9 @@ void DialogEditWrongFormula::InitVariables()
{
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &DialogEditWrongFormula::ValChenged);
if (qApp->patternType() == MeasurementsType::Standard)
{
SizeHeight();
connect(ui->radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogEditWrongFormula::SizeHeight);
}
else
{
ui->radioButtonSizeGrowth->setEnabled(false);
ui->radioButtonStandardTable->setChecked(true);
Measurements();
}
connect(ui->radioButtonStandardTable, &QRadioButton::clicked, this, &DialogEditWrongFormula::Measurements);
connect(ui->radioButtonIncrements, &QRadioButton::clicked, this, &DialogEditWrongFormula::Increments);
connect(ui->radioButtonLengthLine, &QRadioButton::clicked, this, &DialogEditWrongFormula::LengthLines);

View File

@ -64,7 +64,6 @@ public slots:
void DeployFormulaTextEdit();
virtual void EvalFormula() Q_DECL_OVERRIDE;
void ValChenged(int row);
void SizeHeight();
void PutHere();
void PutVal(QListWidgetItem * item);

View File

@ -224,22 +224,6 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonSizeGrowth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size and height</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonStandardTable">
<property name="sizePolicy">
@ -251,6 +235,9 @@
<property name="text">
<string>Measurements</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -404,7 +391,6 @@
<tabstop>plainTextEditFormula</tabstop>
<tabstop>toolButtonPutHere</tabstop>
<tabstop>pushButtonGrowLength</tabstop>
<tabstop>radioButtonSizeGrowth</tabstop>
<tabstop>radioButtonStandardTable</tabstop>
<tabstop>radioButtonIncrements</tabstop>
<tabstop>radioButtonLengthLine</tabstop>