2 // drawingsettingsdlg.cpp: Dialog for changing a drawing's settings
4 // Part of the Architektonas Project
5 // (C) 2021 Underground Software
6 // See the README and GPLv3 files for licensing and warranty information
8 // JLH = James Hammons <jlhamm@acm.org>
11 // --- ---------- ------------------------------------------------------------
12 // JLH 12/31/2021 Created this file
14 #include "drawingsettingsdlg.h"
16 DrawingSettingsDlg::DrawingSettingsDlg(QWidget * parent/*= 0*/): QDialog(parent), baseUnit(new QComboBox(this)), unitStyle(new QComboBox(this)), decimalPrecision(new QComboBox(this)), fractionalPrecision(new QComboBox(this))
18 QStringList buList = { "Inch", "Foot", "Yard", "Mile", "mm", "cm", "m", "km" };
19 QStringList usList = { "Decimal", "Fractional" };
20 QStringList dpList = { "0.1", "0.01", "0.001", "0.0001", "0.00001", "0.000001" };
21 QStringList fpList = { "1/2", "1/4", "1/8", "1/16", "1/32", "1/64" };
23 baseUnit->insertItems(0, buList);
24 unitStyle->insertItems(0, usList);
25 decimalPrecision->insertItems(0, dpList);
26 fractionalPrecision->insertItems(0, fpList);
28 QFormLayout * fl = new QFormLayout;
30 fl->addRow(tr("Base Unit:"), baseUnit);
31 fl->addRow(tr("Unit Style:"), unitStyle);
32 fl->addRow(tr("Decimal Precision:"), decimalPrecision);
33 fl->addRow(tr("Fractional Precision:"), fractionalPrecision);
35 buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
37 connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
38 connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
40 QVBoxLayout * mainLayout = new QVBoxLayout;
41 mainLayout->addLayout(fl);
42 mainLayout->addWidget(buttonBox);
43 setLayout(mainLayout);
45 setWindowTitle(tr("Drawing Settings"));
48 DrawingSettingsDlg::~DrawingSettingsDlg()