Part: use of TaskDialog::addTaskBox

This commit is contained in:
wmayer
2024-03-26 12:45:05 +01:00
committed by wwmayer
parent 6e575c4dd2
commit 5f64e2191e
27 changed files with 18 additions and 97 deletions

View File

@@ -538,11 +538,7 @@ void CrossSections::makePlanes(Plane type, const std::vector<double>& d, double
TaskCrossSections::TaskCrossSections(const Base::BoundBox3d& bb)
{
widget = new CrossSections(bb);
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_CrossSections"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_CrossSections"), widget);
}
bool TaskCrossSections::accept()

View File

@@ -96,7 +96,6 @@ public:
private:
CrossSections* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace PartGui

View File

@@ -471,11 +471,7 @@ void DlgBooleanOperation::accept()
TaskBooleanOperation::TaskBooleanOperation()
{
widget = new DlgBooleanOperation();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Booleans"),
widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Booleans"), widget, false);
}
void TaskBooleanOperation::clicked(int id)

View File

@@ -86,7 +86,6 @@ public:
private:
DlgBooleanOperation* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace PartGui

View File

@@ -754,11 +754,7 @@ void DlgExtrusion::writeParametersToFeature(App::DocumentObject &feature, App::D
TaskExtrusion::TaskExtrusion()
{
widget = new DlgExtrusion();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Extrude"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Extrude"), widget);
}
bool TaskExtrusion::accept()

View File

@@ -117,7 +117,6 @@ public:
private:
DlgExtrusion* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace PartGui

View File

@@ -1069,11 +1069,7 @@ void FilletEdgesDialog::accept()
TaskFilletEdges::TaskFilletEdges(Part::Fillet* fillet)
{
widget = new DlgFilletEdges(DlgFilletEdges::FILLET, fillet);
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Fillet"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Fillet"), widget);
}
TaskFilletEdges::~TaskFilletEdges()
@@ -1126,11 +1122,7 @@ const char* DlgChamferEdges::getFilletType() const
TaskChamferEdges::TaskChamferEdges(Part::Chamfer* chamfer)
{
widget = new DlgChamferEdges(chamfer);
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Chamfer"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Chamfer"), widget);
}
TaskChamferEdges::~TaskChamferEdges()

View File

@@ -168,7 +168,6 @@ public:
private:
DlgFilletEdges* widget;
Gui::TaskView::TaskBox* taskbox;
};
class TaskChamferEdges : public Gui::TaskView::TaskDialog
@@ -192,7 +191,6 @@ public:
private:
DlgChamferEdges* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace PartGui

View File

@@ -2185,16 +2185,11 @@ QString Location::toPlacement() const
TaskPrimitives::TaskPrimitives()
{
Gui::TaskView::TaskBox* taskbox;
widget = new DlgPrimitives();
taskbox = new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget);
location = new Location();
taskbox = new Gui::TaskView::TaskBox(QPixmap(), location->windowTitle() ,true, nullptr);
taskbox->groupLayout()->addWidget(location);
Content.push_back(taskbox);
addTaskBox(location);
}
QDialogButtonBox::StandardButtons TaskPrimitives::getStandardButtons() const
@@ -2227,17 +2222,12 @@ bool TaskPrimitives::reject()
TaskPrimitivesEdit::TaskPrimitivesEdit(Part::Primitive* feature)
{
// create and show dialog for the primitives
Gui::TaskView::TaskBox* taskbox;
widget = new DlgPrimitives(nullptr, feature);
taskbox = new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget);
// create and show dialog for the location
location = new Location(nullptr, feature);
taskbox = new Gui::TaskView::TaskBox(QPixmap(), location->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(location);
Content.push_back(taskbox);
addTaskBox(location);
}
QDialogButtonBox::StandardButtons TaskPrimitivesEdit::getStandardButtons() const

View File

@@ -570,11 +570,7 @@ void DlgRevolution::autoSolid()
TaskRevolution::TaskRevolution()
{
widget = new DlgRevolution();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Revolve"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Revolve"), widget);
}
bool TaskRevolution::accept()

View File

@@ -98,7 +98,6 @@ public:
private:
DlgRevolution* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace PartGui

View File

@@ -330,11 +330,7 @@ void DlgScale::writeParametersToFeature(App::DocumentObject &feature, App::Docum
TaskScale::TaskScale()
{
widget = new DlgScale();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Scale"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Scale"), widget);
}
bool TaskScale::accept()

View File

@@ -86,7 +86,6 @@ public:
private:
DlgScale* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace PartGui

View File

@@ -358,11 +358,7 @@ bool Mirroring::accept()
TaskMirroring::TaskMirroring()
{
widget = new Mirroring();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Mirror.svg"),
widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Mirror.svg"), widget, false);
}
bool TaskMirroring::accept()

View File

@@ -78,7 +78,6 @@ public:
private:
Mirroring* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace PartGui

View File

@@ -451,10 +451,7 @@ void FaceColors::changeEvent(QEvent* e)
TaskFaceColors::TaskFaceColors(ViewProviderPartExt* vp)
{
widget = new FaceColors(vp);
taskbox = new Gui::TaskView::TaskBox(
QPixmap(), widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget);
}
TaskFaceColors::~TaskFaceColors() = default;

View File

@@ -85,7 +85,6 @@ public:
private:
FaceColors* widget;
Gui::TaskView::TaskBox* taskbox;
};
} //namespace PartGui

View File

@@ -248,11 +248,7 @@ void LoftWidget::changeEvent(QEvent *e)
TaskLoft::TaskLoft()
{
widget = new LoftWidget();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Loft"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Loft"), widget);
}
TaskLoft::~TaskLoft() = default;

View File

@@ -73,7 +73,6 @@ public:
private:
LoftWidget* widget;
Gui::TaskView::TaskBox* taskbox;
};
} //namespace PartGui

View File

@@ -238,11 +238,7 @@ void OffsetWidget::changeEvent(QEvent *e)
TaskOffset::TaskOffset(Part::Offset* offset)
{
widget = new OffsetWidget(offset);
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Offset"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Offset"), widget);
}
TaskOffset::~TaskOffset() = default;

View File

@@ -80,7 +80,6 @@ public:
private:
OffsetWidget* widget;
Gui::TaskView::TaskBox* taskbox;
};
} //namespace PartGui

View File

@@ -599,11 +599,7 @@ void ShapeBuilderWidget::changeEvent(QEvent *e)
TaskShapeBuilder::TaskShapeBuilder()
{
widget = new ShapeBuilderWidget();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Shapebuilder"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Shapebuilder"), widget);
}
TaskShapeBuilder::~TaskShapeBuilder() = default;

View File

@@ -83,7 +83,6 @@ public:
private:
ShapeBuilderWidget* widget;
Gui::TaskView::TaskBox* taskbox;
};
} //namespace PartGui

View File

@@ -462,11 +462,7 @@ void SweepWidget::changeEvent(QEvent *e)
TaskSweep::TaskSweep() : label(nullptr)
{
widget = new SweepWidget();
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Sweep"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Sweep"), widget);
}
TaskSweep::~TaskSweep()

View File

@@ -80,7 +80,6 @@ public:
private:
SweepWidget* widget;
Gui::StatusWidget* label;
Gui::TaskView::TaskBox* taskbox;
};
} //namespace PartGui

View File

@@ -296,11 +296,7 @@ TaskThickness::TaskThickness(Part::Thickness* offset)
{
widget = new ThicknessWidget(offset);
widget->setWindowTitle(ThicknessWidget::tr("Thickness"));
taskbox = new Gui::TaskView::TaskBox(
Gui::BitmapFactory().pixmap("Part_Thickness"),
widget->windowTitle(), true, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(Gui::BitmapFactory().pixmap("Part_Thickness"), widget);
}
Part::Thickness* TaskThickness::getObject() const

View File

@@ -79,7 +79,6 @@ public:
private:
ThicknessWidget* widget;
Gui::TaskView::TaskBox* taskbox;
};
} //namespace PartGui