Commit 057553fa authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

added inited flag to DataContainerInspectorWidget

parent f0763803
......@@ -59,6 +59,7 @@ namespace campvis {
DataContainerInspectorWidget::DataContainerInspectorWidget(QWidget* parent)
: QWidget(parent)
, _inited(false)
, _dataContainer(0)
, _dctWidget(0)
, _canvas(0)
......@@ -158,6 +159,9 @@ namespace campvis {
}
void DataContainerInspectorWidget::updateInfoWidget() {
if (!_inited)
return;
// get the selection from the tree widget
const QModelIndexList& indices = _dctWidget->selectionModel()->selectedRows();
std::vector< std::pair<QString, QtDataHandle> > handles;
......@@ -223,9 +227,12 @@ namespace campvis {
void DataContainerInspectorWidget::init() {
if (_canvas != 0)
_canvas->init();
_inited = true;
}
void DataContainerInspectorWidget::deinit() {
_inited = false;
if (_canvas != 0)
_canvas->deinit();
......@@ -236,6 +243,7 @@ namespace campvis {
}
_dataContainer = 0;
_dctWidget->update(0);
}
void DataContainerInspectorWidget::onDCTWidgetSelectionModelSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) {
......
......@@ -150,6 +150,8 @@ namespace campvis {
*/
QString humanizeBytes(size_t numBytes) const;
bool _inited;
DataContainer* _dataContainer; ///< The DataContainer this widget is inspecting
DataContainerTreeWidget* _dctWidget; ///< The TreeWidget showing the DataHandles in _dataContainer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment