Update options after move.
--HG-- branch : feature
This commit is contained in:
parent
bdfd292386
commit
70a17f118e
|
@ -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);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -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<VProperty *, QString>::ConstIterator itProp = propertyToId.constBegin();
|
||||
while (itProp != propertyToId.constEnd())
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user