From bc855ce2659efee7f8e664d430aa05294785e5db Mon Sep 17 00:00:00 2001 From: dismine Date: Wed, 5 Feb 2014 15:30:54 +0200 Subject: [PATCH] Dialog detail spinBox instead doubleSpinBox. --HG-- branch : develop --- src/dialogs/dialogdetail.cpp | 26 +++++++++++++------------- src/dialogs/dialogdetail.ui | 27 +++------------------------ 2 files changed, 16 insertions(+), 37 deletions(-) diff --git a/src/dialogs/dialogdetail.cpp b/src/dialogs/dialogdetail.cpp index 4e7951a83..a465d7764 100644 --- a/src/dialogs/dialogdetail.cpp +++ b/src/dialogs/dialogdetail.cpp @@ -49,9 +49,9 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent) connect(bCansel, &QPushButton::clicked, this, &DialogDetail::DialogRejected); connect(ui.listWidget, &QListWidget::currentRowChanged, this, &DialogDetail::ObjectChanged); - connect(ui.doubleSpinBoxBiasX, static_cast(&QDoubleSpinBox::valueChanged), + connect(ui.spinBoxBiasX, static_cast(&QSpinBox::valueChanged), this, &DialogDetail::BiasXChanged); - connect(ui.doubleSpinBoxBiasY, static_cast(&QDoubleSpinBox::valueChanged), + connect(ui.spinBoxBiasY, static_cast(&QSpinBox::valueChanged), this, &DialogDetail::BiasYChanged); connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams); connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed); @@ -95,7 +95,7 @@ void DialogDetail::DialogAccepted() QListWidgetItem *item = ui.listWidget->item(i); details.append( qvariant_cast(item->data(Qt::UserRole))); } - details.setWidth(ui.doubleSpinBoxSeams->value()); + details.setWidth(ui.spinBoxSeams->value()); details.setName(ui.lineEditNameDetail->text()); details.setSeamAllowance(supplement); details.setClosed(closed); @@ -144,15 +144,15 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const NodeDet item->setData(Qt::UserRole, QVariant::fromValue(node)); ui.listWidget->addItem(item); ui.listWidget->setCurrentRow(ui.listWidget->count()-1); - disconnect(ui.doubleSpinBoxBiasX, static_cast(&QDoubleSpinBox::valueChanged), + disconnect(ui.spinBoxBiasX, static_cast(&QSpinBox::valueChanged), this, &DialogDetail::BiasXChanged); - disconnect(ui.doubleSpinBoxBiasY, static_cast(&QDoubleSpinBox::valueChanged), + disconnect(ui.spinBoxBiasY, static_cast(&QSpinBox::valueChanged), this, &DialogDetail::BiasYChanged); - ui.doubleSpinBoxBiasX->setValue(toMM(node.getMx())); - ui.doubleSpinBoxBiasY->setValue(toMM(node.getMy())); - connect(ui.doubleSpinBoxBiasX, static_cast(&QDoubleSpinBox::valueChanged), + ui.spinBoxBiasX->setValue(static_cast(toMM(node.getMx()))); + ui.spinBoxBiasY->setValue(static_cast(toMM(node.getMy()))); + connect(ui.spinBoxBiasX, static_cast(&QSpinBox::valueChanged), this, &DialogDetail::BiasXChanged); - connect(ui.doubleSpinBoxBiasY, static_cast(&QDoubleSpinBox::valueChanged), + connect(ui.spinBoxBiasY, static_cast(&QSpinBox::valueChanged), this, &DialogDetail::BiasYChanged); } @@ -170,7 +170,7 @@ void DialogDetail::setDetails(const VDetail &value) ui.checkBoxClosed->setChecked(details.getClosed()); ClickedClosed(details.getClosed()); ClickedSeams(details.getSeamAllowance()); - ui.doubleSpinBoxSeams->setValue(details.getWidth()); + ui.spinBoxSeams->setValue(static_cast(details.getWidth())); ui.listWidget->setCurrentRow(0); ui.listWidget->setFocus(Qt::OtherFocusReason); ui.toolButtonDelete->setEnabled(true); @@ -200,7 +200,7 @@ void DialogDetail::ClickedSeams(bool checked) { supplement = checked; ui.checkBoxClosed->setEnabled(checked); - ui.doubleSpinBoxSeams->setEnabled(checked); + ui.spinBoxSeams->setEnabled(checked); } void DialogDetail::ClickedClosed(bool checked) @@ -216,8 +216,8 @@ void DialogDetail::ObjectChanged(int row) } QListWidgetItem *item = ui.listWidget->item( row ); VNodeDetail node = qvariant_cast(item->data(Qt::UserRole)); - ui.doubleSpinBoxBiasX->setValue(toMM(node.getMx())); - ui.doubleSpinBoxBiasY->setValue(toMM(node.getMy())); + ui.spinBoxBiasX->setValue(static_cast(toMM(node.getMx()))); + ui.spinBoxBiasY->setValue(static_cast(toMM(node.getMy()))); } void DialogDetail::DeleteItem() diff --git a/src/dialogs/dialogdetail.ui b/src/dialogs/dialogdetail.ui index 6519b344d..00a850b6c 100644 --- a/src/dialogs/dialogdetail.ui +++ b/src/dialogs/dialogdetail.ui @@ -47,14 +47,7 @@ - - - -10000.000000000000000 - - - 10000.000000000000000 - - + @@ -74,14 +67,7 @@ - - - -10000.000000000000000 - - - 10000.000000000000000 - - + @@ -190,14 +176,7 @@ - - - -10000.000000000000000 - - - 10.000000000000000 - - +