MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / tryLoadForm

Method tryLoadForm

src/Gui/TaskView/TaskDialogPython.cpp:771–800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

769}
770
771bool TaskDialogPython::tryLoadForm()
772{
773 if (dlg.hasAttr(std::string("form"))) {
774 Py::Object f(dlg.getAttr(std::string("form")));
775 Py::List widgets;
776 if (f.isList()) {
777 widgets = f;
778 }
779 else {
780 widgets.append(f);
781 }
782
783 Gui::PythonWrapper wrap;
784 if (wrap.loadCoreModule()) {
785 for (Py::List::iterator it = widgets.begin(); it != widgets.end(); ++it) {
786 QObject* object = wrap.toQObject(*it);
787 if (object) {
788 QWidget* form = qobject_cast<QWidget*>(object);
789 if (form) {
790 appendForm(form, form->windowIcon().pixmap(32));
791 }
792 }
793 }
794 }
795
796 return true;
797 }
798
799 return false;
800}
801
802void TaskDialogPython::appendForm(QWidget* form, const QPixmap& icon)
803{

Callers

nothing calls this directly

Calls 6

loadCoreModuleMethod · 0.80
toQObjectMethod · 0.80
pixmapMethod · 0.80
appendMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected