Show unit prefix in dialog with variables.
--HG-- branch : develop
This commit is contained in:
parent
469eb6f9b3
commit
3b58eb3afa
|
@ -71,6 +71,8 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
|
|||
}
|
||||
}
|
||||
|
||||
ShowUnits();
|
||||
|
||||
TextDelegate *textDelegate = new TextDelegate(nameRegExp, data, ui->tableWidgetIncrement);
|
||||
ui->tableWidgetIncrement->setItemDelegateForColumn(0, textDelegate);// name
|
||||
DoubleSpinBoxDelegate *doubleDelegate = new DoubleSpinBoxDelegate(ui->tableWidgetIncrement);
|
||||
|
@ -345,6 +347,33 @@ void DialogIncrements::SetItemViewOnly(QTableWidgetItem *item)
|
|||
item->setFlags(flags);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::ShowUnits()
|
||||
{
|
||||
ShowHeaderUnits(ui->tableWidgetIncrement, 2);// base value
|
||||
ShowHeaderUnits(ui->tableWidgetIncrement, 3);// in sizes
|
||||
ShowHeaderUnits(ui->tableWidgetIncrement, 4);// in heights
|
||||
|
||||
ShowHeaderUnits(ui->tableWidgetMeasurements, 2);// base value
|
||||
ShowHeaderUnits(ui->tableWidgetMeasurements, 3);// in sizes
|
||||
ShowHeaderUnits(ui->tableWidgetMeasurements, 4);// in heights
|
||||
|
||||
ShowHeaderUnits(ui->tableWidgetLines, 1);// lengths
|
||||
ShowHeaderUnits(ui->tableWidgetSplines, 1);// lengths
|
||||
ShowHeaderUnits(ui->tableWidgetArcs, 1);// lengths
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::ShowHeaderUnits(QTableWidget *table, int column)
|
||||
{
|
||||
SCASSERT(table != nullptr);
|
||||
|
||||
const QString unit = VDomDocument::UnitsToStr(qApp->patternUnit());
|
||||
const QString header = table->horizontalHeaderItem(column)->text();
|
||||
const QString unitHeader = QString("%1 (%2)").arg(header).arg(unit);
|
||||
table->horizontalHeaderItem(column)->setText(unitHeader);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void DialogIncrements::ShowMeasurements()
|
||||
{
|
||||
|
|
|
@ -105,6 +105,8 @@ private:
|
|||
const qreal &ksize, const qreal &kheight, const QString &description);
|
||||
void HideColumns(QTableWidget *table);
|
||||
void SetItemViewOnly(QTableWidgetItem *item);
|
||||
void ShowUnits();
|
||||
void ShowHeaderUnits(QTableWidget *table, int column);
|
||||
};
|
||||
|
||||
#endif // DIALOGINCREMENTS_H
|
||||
|
|
Loading…
Reference in New Issue
Block a user