ToolWidget-Sketcher: Tool widget basic framework

================================================

Provides a framework to show in the taskbar a taskbox with a tool settings dialog.
This commit is contained in:
Paddle
2023-10-13 14:47:33 +02:00
committed by abdullahtahiriyo
parent a1b8a2ec70
commit c62f5f30fd
12 changed files with 1791 additions and 5 deletions

View File

@@ -495,7 +495,9 @@ ViewProviderSketch::ViewProviderSketch()
}
ViewProviderSketch::~ViewProviderSketch()
{}
{
connectionToolWidget.disconnect();
}
void ViewProviderSketch::slotUndoDocument(const Gui::Document& /*doc*/)
{
@@ -3242,10 +3244,12 @@ bool ViewProviderSketch::setEdit(int ModNum)
}
// start the edit dialog
if (sketchDlg)
Gui::Control().showDialog(sketchDlg);
else
Gui::Control().showDialog(new TaskDlgEditSketch(this));
if (!sketchDlg)
sketchDlg = new TaskDlgEditSketch(this);
connectionToolWidget = sketchDlg->registerToolWidgetChanged(std::bind(&SketcherGui::ViewProviderSketch::slotToolWidgetChanged, this, sp::_1));
Gui::Control().showDialog(sketchDlg);
// This call to the solver is needed to initialize the DoF and solve time controls
// The false parameter indicates that the geometry of the SketchObject shall not be updateData
@@ -3879,6 +3883,12 @@ QIcon ViewProviderSketch::mergeColorfulOverlayIcons(const QIcon& orig) const
return Gui::ViewProvider::mergeColorfulOverlayIcons(mergedicon);
}
void ViewProviderSketch::slotToolWidgetChanged(QWidget* newwidget)
{
if (sketchHandler)
sketchHandler->toolWidgetChanged(newwidget);
}
/*************************** functions ViewProviderSketch offers to friends such as
* DrawHandlerSketch ************************/