ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvGraphicalSegmentationOptionsDlg.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 
10 // Qt
11 #include <QSettings>
12 
14  const QString windowTitle /*=QString()*/, QWidget* parent /*=nullptr*/)
15  : QDialog(parent, Qt::Tool), Ui::GraphicalSegmentationOptionsDlg() {
16  setupUi(this);
17 
18  QSettings settings;
19  settings.beginGroup(SegmentationToolOptionsKey());
20  QString remainingSuffix =
21  settings.value(RemainingSuffixKey(), ".remaining").toString();
22  QString segmentedSuffix =
23  settings.value(SegmentedSuffixKey(), ".segmented").toString();
24  settings.endGroup();
25 
26  remainingTextLineEdit->setText(remainingSuffix);
27  segmentedTextLineEdit->setText(segmentedSuffix);
28 
29  if (!windowTitle.isEmpty()) {
30  setWindowTitle(windowTitle);
31  }
32 }
33 
35  QSettings settings;
36  settings.beginGroup(SegmentationToolOptionsKey());
37  settings.setValue(RemainingSuffixKey(), remainingTextLineEdit->text());
38  settings.setValue(SegmentedSuffixKey(), segmentedTextLineEdit->text());
39  settings.endGroup();
40 
41  QDialog::accept();
42 }
static QString RemainingSuffixKey()
Returns the QSettings key to store the 'remaining entity' suffix.
static QString SegmentationToolOptionsKey()
Returns the QSettings key to store the segmentation tool options.
ccGraphicalSegmentationOptionsDlg(const QString windowTitle=QString(), QWidget *parent=nullptr)
Default constructor.
static QString SegmentedSuffixKey()
Returns the QSettings key to store the 'segmented entity' suffix.