PD: Fix possible crash in primitive dialog

This commit is contained in:
wmayer
2024-07-18 14:28:52 +02:00
parent 5731a27609
commit 839fd1fec0
2 changed files with 515 additions and 461 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -101,6 +101,16 @@ private:
/** Notifies when the object is about to be removed. */
void slotDeletedObject(const Gui::ViewProviderDocumentObject& Obj) override;
template<typename T = App::DocumentObject> T* getObject() const
{
static_assert(std::is_base_of<App::DocumentObject, T>::value, "Wrong template argument");
if (vp) {
return dynamic_cast<T*>(vp->getObject());
}
return nullptr;
}
private:
QWidget* proxy;
std::unique_ptr<Ui_DlgPrimitives> ui;