24 #include <QInputDialog>
31 debugDrawer(debugDrawer)
46 ui.checkBoxDefaultLayerVisibility->setCheckState(settings->value(QString::fromStdString(
"DefaultLayerVisibility")).toBool() ? Qt::Checked : Qt::Unchecked);
47 settings->beginGroup(
"layer");
48 for (
const auto& key : settings->allKeys())
50 QListWidgetItem* item =
new QListWidgetItem(key,
ui.listWidgetDefaultLayerVisibility);
51 item->setCheckState(settings->value(key).toBool() ? Qt::Checked : Qt::Unchecked);
52 ui.listWidgetDefaultLayerVisibility->addItem(item);
59 settings->setValue(QString::fromStdString(
"DefaultLayerVisibility"),
ui.checkBoxDefaultLayerVisibility->checkState() == Qt::Checked);
60 settings->beginGroup(
"layer");
61 for (
const auto& layerInfo :
debugDrawer->getAllDefaultLayerVisibilities())
63 settings->setValue(QString::fromStdString(layerInfo.first), layerInfo.second);
72 for (
int i = 0; i <
ui.listWidgetDefaultLayerVisibility->count(); ++i)
90 ui.listWidgetLayerVisibility->clear();
91 for (
const auto& layerInfo :
debugDrawer->layerInformation())
93 QListWidgetItem* item =
new QListWidgetItem(QString::fromStdString(layerInfo.layerName),
ui.listWidgetLayerVisibility);
94 item->setCheckState(layerInfo.visible ? Qt::Checked : Qt::Unchecked);
95 ui.listWidgetLayerVisibility->addItem(item);
97 ui.checkBoxDefaultLayerVisibility->setCheckState(
debugDrawer->getDefaultLayerVisibility() ? Qt::Checked : Qt::Unchecked);
98 ui.listWidgetDefaultLayerVisibility->clear();
99 for (
const auto& layerInfo :
debugDrawer->getAllDefaultLayerVisibilities())
101 QListWidgetItem* item =
new QListWidgetItem(QString::fromStdString(layerInfo.first),
ui.listWidgetDefaultLayerVisibility);
102 item->setCheckState(layerInfo.second ? Qt::Checked : Qt::Unchecked);
103 ui.listWidgetDefaultLayerVisibility->addItem(item);
113 debugDrawer->enableLayerVisu(item->text().toStdString(), item->checkState() == Qt::Checked);
122 debugDrawer->setDefaultLayerVisibility(checkState != Qt::Unchecked);
131 debugDrawer->setDefaultLayerVisibility(item->text().toStdString(), item->checkState() == Qt::Checked);
137 QString text = QInputDialog::getText(
this,
"Layer name",
138 "Layer name:", QLineEdit::Normal,
139 ui.listWidgetLayerVisibility->selectedItems().empty() ?
"" :
ui.listWidgetLayerVisibility->selectedItems().front()->text(), &
ok);
140 if (
ok && !text.isEmpty())
142 QListWidgetItem* item =
new QListWidgetItem(text,
ui.listWidgetDefaultLayerVisibility);
143 item->setCheckState(
debugDrawer->getDefaultLayerVisibility() ? Qt::Checked : Qt::Unchecked);
144 ui.listWidgetDefaultLayerVisibility->addItem(item);
150 for (
const auto& selected :
ui.listWidgetDefaultLayerVisibility->selectedItems())
154 debugDrawer->removeDefaultLayerVisibility(selected->text().toStdString());
156 ui.listWidgetDefaultLayerVisibility->takeItem(
ui.listWidgetDefaultLayerVisibility->row(selected));