PD: Fix crash when clicking on invalid edge in task panel

Fixes #10843
This commit is contained in:
wmayer
2024-10-13 17:42:56 +02:00
committed by Chris Hennes
parent e478192aa5
commit f9547e8231
2 changed files with 19 additions and 1 deletions

View File

@@ -260,12 +260,27 @@ void TaskDressUpParameters::setSelection(QListWidgetItem* current) {
// highlight the selected item
bool block = this->blockSelection(true);
Gui::Selection().addSelection(docName.c_str(), objName.c_str(), subName.c_str(), 0, 0, 0);
tryAddSelection(docName, objName, subName);
this->blockSelection(block);
}
}
}
void TaskDressUpParameters::tryAddSelection(const std::string& doc,
const std::string& obj,
const std::string& sub)
{
try {
Gui::Selection().addSelection(doc.c_str(), obj.c_str(), sub.c_str(), 0, 0, 0);
}
catch (const Base::Exception& e) {
e.ReportException();
}
catch (const Standard_Failure& e) {
Base::Console().Error("OCC error: %s\n", e.GetMessageString());
}
}
void TaskDressUpParameters::itemClickedTimeout() {
// executed after double-click time passed
wasDoubleClicked = false;

View File

@@ -100,6 +100,9 @@ protected:
return nullptr;
}
private:
void tryAddSelection(const std::string& doc, const std::string& obj, const std::string& sub);
protected:
QWidget* proxy;
QAction* deleteAction;