39 #include "ui_control3dview.h"
48 #include <QMessageBox>
58 #include <QStyledItemDelegate>
59 #include <QStandardItemModel>
60 #include <QColorDialog>
66 using namespace DISPLIB;
74 const QStringList& slFlags,
77 , m_pUi(new Ui::Control3DViewWidget)
78 , m_colCurrentSceneColor(QColor(0,0,0))
79 , m_colCurrentLightColor(QColor(255,255,255))
87 m_pUi->m_pushButton_sceneColorPicker->setStyleSheet(QString(
"background-color: rgb(0, 0, 0);"));
88 m_pUi->m_pushButton_lightColorPicker->setStyleSheet(QString(
"background-color: rgb(255, 255, 255);"));
93 m_pUi->m_treeView_loadedData->setContextMenuPolicy(Qt::CustomContextMenu);
94 connect(
m_pUi->m_treeView_loadedData, &QWidget::customContextMenuRequested,
113 if(slFlags.contains(
"Data")) {
114 m_pUi->m_treeView_loadedData->show();
116 m_pUi->m_treeView_loadedData->hide();
119 if(slFlags.contains(
"View")) {
120 m_pUi->m_groupBox_viewOptions->show();
122 connect(
m_pUi->m_pushButton_sceneColorPicker,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
124 connect(
m_pUi->m_checkBox_showFullScreen, &QCheckBox::clicked,
127 connect(
m_pUi->m_checkBox_rotate, &QCheckBox::clicked,
130 connect(
m_pUi->m_checkBox_coordAxis, &QCheckBox::clicked,
133 connect(
m_pUi->m_pushButton_takeScreenshot,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
136 connect(
m_pUi->m_radioButton_single, &QRadioButton::pressed,
139 connect(
m_pUi->m_radioButton_multi, &QRadioButton::pressed,
142 m_pUi->m_groupBox_viewOptions->hide();
145 if(slFlags.contains(
"Light")) {
146 m_pUi->m_groupBox_lightOptions->show();
148 connect(
m_pUi->m_pushButton_lightColorPicker,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
150 connect(
m_pUi->m_doubleSpinBox_colorIntensity,
static_cast<void (QDoubleSpinBox::*)(
double)
>(&QDoubleSpinBox::valueChanged),
153 m_pUi->m_groupBox_lightOptions->hide();
162 m_pUi->m_treeView_loadedData->setItemDelegate(pItemDelegate);
163 m_pUi->m_treeView_loadedData->setHeaderHidden(
false);
164 m_pUi->m_treeView_loadedData->setEditTriggers(QAbstractItemView::CurrentChanged);
172 m_pUi->m_treeView_loadedData->setModel(pDataTreeModel);
182 if(!
m_pUi->m_treeView_loadedData->isHeaderHidden()) {
183 m_pUi->m_treeView_loadedData->setHeaderHidden(
true);
185 m_pUi->m_treeView_loadedData->setHeaderHidden(
false);
193 if(index.isValid()) {
194 m_pUi->m_treeView_loadedData->model()->removeRow(index.row(), index.parent());
202 if(
m_pUi->m_treeView_loadedData->isColumnHidden(1)) {
203 m_pUi->m_treeView_loadedData->setColumnHidden(1,
false);
205 m_pUi->m_treeView_loadedData->setColumnHidden(1,
true);
218 QSettings settings(
"MNECPP");
230 QSettings settings(
"MNECPP");
238 case GuiMode::Clinical:
250 case ProcessingMode::Offline:
261 this->setWindowOpacity(1/(100.0/value));
268 QColorDialog* pDialog =
new QColorDialog(
this);
272 connect(pDialog, &QColorDialog::currentColorChanged,
287 QMenu *menu =
new QMenu(
this);
290 QAction* pHideHeader = menu->addAction(tr(
"Toggle header"));
291 connect(pHideHeader, &QAction::triggered,
295 QAction* pRemoveItem = menu->addAction(tr(
"Remove"));
296 connect(pRemoveItem, &QAction::triggered, [=]() {
297 if (QMessageBox::question(
this,
299 tr(
"Are you sure you want to delete the item?")) == QMessageBox::Yes) {
309 menu->popup(
m_pUi->m_treeView_loadedData->viewport()->mapToGlobal(pos));
317 this->setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint);
320 this->setWindowFlags(this->windowFlags() & ~Qt::WindowStaysOnTopHint);
357 QColorDialog* pDialog =
new QColorDialog(
this);
361 connect(pDialog, &QColorDialog::currentColorChanged,