Gui: ignore recursive call of PropertyView::onTimer()
This commit is contained in:
@@ -29,7 +29,9 @@
|
||||
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Parameter.h>
|
||||
#include <Base/Tools.h>
|
||||
|
||||
#include "PropertyView.h"
|
||||
#include "Application.h"
|
||||
@@ -333,6 +335,13 @@ void PropertyView::onSelectionChanged(const SelectionChanges& msg)
|
||||
|
||||
void PropertyView::onTimer()
|
||||
{
|
||||
// See https://forum.freecadweb.org/viewtopic.php?f=8&t=72526
|
||||
if (this->updating) {
|
||||
Base::Console().Log("Ignore recursive call of PropertyView::onTimer()\n");
|
||||
return;
|
||||
}
|
||||
Base::StateLocker guard(this->updating);
|
||||
|
||||
timer->stop();
|
||||
|
||||
if(!this->isSelectionAttached()) {
|
||||
|
||||
@@ -109,6 +109,7 @@ private:
|
||||
Connection connectChangedDocument;
|
||||
QTabWidget* tabs;
|
||||
QTimer* timer;
|
||||
bool updating = false;
|
||||
};
|
||||
|
||||
namespace DockWnd {
|
||||
|
||||
@@ -415,6 +415,7 @@ void PropertyModel::buildUp(const PropertyModel::PropertyList& props)
|
||||
int first = static_cast<int>(groupInfo.children.size());
|
||||
if (last > first) {
|
||||
QModelIndex midx = this->index(groupInfo.groupItem->_row, 0, QModelIndex());
|
||||
// This can trigger a recursive call of PropertyView::onTimer()
|
||||
beginRemoveRows(midx, first, last - 1);
|
||||
groupInfo.groupItem->removeChildren(first, last - 1);
|
||||
endRemoveRows();
|
||||
|
||||
Reference in New Issue
Block a user