separate clearProperties
This commit is contained in:
parent
064dc13f3d
commit
4a734d6cc7
@ -164,11 +164,8 @@ void MainWindow::addProperty(QtVariantProperty *property, const QString &id)
|
||||
QtBrowserItem *item = propertyEditor->addProperty(property);
|
||||
}
|
||||
|
||||
void MainWindow::onItemClicked(QTreeWidgetItem *item, int pos)
|
||||
void MainWindow::clearProperties()
|
||||
{
|
||||
if (!item->parent())
|
||||
return;
|
||||
ElementType type = static_cast<ElementTreeItem *>(item)->getType();
|
||||
QMap<QtProperty *, QString>::ConstIterator itProp =
|
||||
propertyToId.constBegin();
|
||||
while (itProp != propertyToId.constEnd()) {
|
||||
@ -177,6 +174,16 @@ void MainWindow::onItemClicked(QTreeWidgetItem *item, int pos)
|
||||
}
|
||||
propertyToId.clear();
|
||||
idToProperty.clear();
|
||||
}
|
||||
|
||||
void MainWindow::onItemClicked(QTreeWidgetItem *item, int pos)
|
||||
{
|
||||
if (!item->parent())
|
||||
return;
|
||||
|
||||
clearProperties();
|
||||
|
||||
ElementType type = static_cast<ElementTreeItem *>(item)->getType();
|
||||
|
||||
if (type == ElementType::BEL) {
|
||||
IdString c = static_cast<BelTreeItem *>(item)->getData();
|
||||
|
@ -31,6 +31,7 @@ class MainWindow : public QMainWindow
|
||||
|
||||
private:
|
||||
void addProperty(QtVariantProperty *property, const QString &id);
|
||||
void clearProperties();
|
||||
|
||||
private Q_SLOTS:
|
||||
void prepareMenu(const QPoint &pos);
|
||||
|
Loading…
Reference in New Issue
Block a user