ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvAskThreeDoubleValuesDlg.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
9 
11  const QString& vName1,
12  const QString& vName2,
13  const QString& vName3,
14  double minVal,
15  double maxVal,
16  double defaultVal1,
17  double defaultVal2,
18  double defaultVal3,
19  int precision /*=6*/,
20  const QString windowTitle /*=QString()*/,
21  QWidget* parent /*=nullptr*/)
22  : QDialog(parent, Qt::Tool), Ui::AskThreeDoubleValuesDialog() {
23  setupUi(this);
24 
25  checkBox->setVisible(false);
26 
27  label1->setText(vName1);
28  label2->setText(vName2);
29  label3->setText(vName3);
30  doubleSpinBox1->setRange(minVal, maxVal);
31  doubleSpinBox2->setRange(minVal, maxVal);
32  doubleSpinBox3->setRange(minVal, maxVal);
33  doubleSpinBox1->setValue(defaultVal1);
34  doubleSpinBox2->setValue(defaultVal2);
35  doubleSpinBox3->setValue(defaultVal3);
36  doubleSpinBox1->setDecimals(precision);
37  doubleSpinBox2->setDecimals(precision);
38  doubleSpinBox3->setDecimals(precision);
39 
40  if (!windowTitle.isEmpty()) {
41  setWindowTitle(windowTitle);
42  }
43 }
44 
45 void ccAskThreeDoubleValuesDlg::showCheckbox(const QString& label,
46  bool state,
47  QString tooltip /*=QString()*/) {
48  checkBox->setVisible(true);
49  checkBox->setEnabled(true);
50  checkBox->setChecked(state);
51  checkBox->setText(label);
52  checkBox->setToolTip(tooltip);
53 }
54 
56  return checkBox->isChecked();
57 }
ccAskThreeDoubleValuesDlg(const QString &vName1, const QString &vName2, const QString &vName3, double minVal, double maxVal, double defaultVal1, double defaultVal2, double defaultVal3, int precision=6, const QString windowTitle=QString(), QWidget *parent=nullptr)
Default constructor.
void showCheckbox(const QString &label, bool state, QString tooltip=QString())
Enable the checkbox (bottom-left)