diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index ef80a0c92..fa38d777f 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1981,6 +1981,7 @@ void MainWindow::PropertyBrowser() toolOptions = new VToolOptionsPropertyBrowser(ui->dockWidgetToolOptions); connect(ui->view, &VMainGraphicsView::itemClicked, toolOptions, &VToolOptionsPropertyBrowser::itemClicked); + connect(doc, &VPattern::FullUpdateFromFile, toolOptions, &VToolOptionsPropertyBrowser::UpdateOptions); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/widgets/vtooloptionspropertybrowser.cpp b/src/app/widgets/vtooloptionspropertybrowser.cpp index bfe5d341d..ac5b3c4f5 100644 --- a/src/app/widgets/vtooloptionspropertybrowser.cpp +++ b/src/app/widgets/vtooloptionspropertybrowser.cpp @@ -53,12 +53,6 @@ VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent) scroll->setWidgetResizable(true); scroll->setWidget(TreeView); -// QLayout* layout = parent->layout(); -// layout->setSpacing(5); -// layout->setMargin(0); -// layout->addWidget(scroll); -// parent->setLayout(layout); - parent->setWidget(scroll); connect(PropertyModel, SIGNAL(onDataChangedByEditor(VProperty*)), this, SLOT(userChangedData(VProperty*))); @@ -67,6 +61,12 @@ VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent) //--------------------------------------------------------------------------------------------------------------------- void VToolOptionsPropertyBrowser::itemClicked(QGraphicsItem *item) { + if (currentItem == item) + { + UpdateOptions(); + return; + } + QMap::ConstIterator itProp = propertyToId.constBegin(); while (itProp != propertyToId.constEnd()) { diff --git a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp index 8cf45b399..9ec0e7ccf 100644 --- a/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp +++ b/src/libs/vpropertyexplorer/plugins/vnumberproperty.cpp @@ -39,7 +39,8 @@ QWidget* VIntegerProperty::createEditor(QWidget * parent, const QStyleOptionView tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tmpEditor->setValue(d_ptr->VariantValue.toInt()); - return tmpEditor; + d_ptr->editor = tmpEditor; + return d_ptr->editor; } //! Gets the data from the widget @@ -126,7 +127,8 @@ QWidget* VDoubleProperty::createEditor(QWidget * parent, const QStyleOptionViewI tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tmpEditor->setValue(d_ptr->VariantValue.toDouble()); - return tmpEditor; + d_ptr->editor = tmpEditor; + return d_ptr->editor; } //! Gets the data from the widget diff --git a/src/libs/vpropertyexplorer/vproperty.cpp b/src/libs/vpropertyexplorer/vproperty.cpp index b845891db..59f96238e 100644 --- a/src/libs/vpropertyexplorer/vproperty.cpp +++ b/src/libs/vpropertyexplorer/vproperty.cpp @@ -86,7 +86,6 @@ QWidget* VProperty::createEditor(QWidget * parent, const QStyleOptionViewItem& o QItemEditorFactory::setDefaultFactory(factory); d_ptr->editor = factory->createEditor(d_ptr->PropertyVariantType, parent); - //return factory->createEditor(d_ptr->PropertyVariantType, parent); return d_ptr->editor; } diff --git a/src/libs/vpropertyexplorer/vpropertyset.cpp b/src/libs/vpropertyexplorer/vpropertyset.cpp index 7be540da8..ca7f0f871 100644 --- a/src/libs/vpropertyexplorer/vpropertyset.cpp +++ b/src/libs/vpropertyexplorer/vpropertyset.cpp @@ -103,12 +103,12 @@ int VPropertySet::count() const void VPropertySet::clear(bool delete_properties) { d_ptr->Properties.clear(); - while(!d_ptr->RootProperties.isEmpty()) { - VProperty* tmpProp = d_ptr->RootProperties.takeLast(); - if(tmpProp != NULL && delete_properties) { - delete tmpProp; - } - } +// while(!d_ptr->RootProperties.isEmpty()) { +// VProperty* tmpProp = d_ptr->RootProperties.takeLast(); +// if(tmpProp != NULL && delete_properties) { +// delete tmpProp; +// } +// } } QString VPropertySet::getPropertyID(const VProperty *prop, bool look_for_parent_id) const