Mesh: use of TaskDialog::addTaskBox

This commit is contained in:
wmayer
2024-03-26 12:01:02 +01:00
committed by wwmayer
parent 655e2f6978
commit 7a535eedc5
11 changed files with 11 additions and 33 deletions

View File

@@ -134,10 +134,7 @@ double DlgDecimating::reduction() const
TaskDecimating::TaskDecimating()
{
widget = new DlgDecimating(); // NOLINT
Gui::TaskView::TaskBox* taskbox =
new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget, false, nullptr);
std::vector<Mesh::Feature*> meshes = Gui::Selection().getObjectsOfType<Mesh::Feature>();
if (meshes.size() == 1) {

View File

@@ -152,21 +152,16 @@ SmoothingDialog::~SmoothingDialog() = default;
TaskSmoothing::TaskSmoothing()
{
widget = new DlgSmoothing(); // NOLINT
Gui::TaskView::TaskBox* taskbox =
new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget, false, nullptr);
selection = new Selection(); // NOLINT
selection->setObjects(
Gui::Selection().getSelectionEx(nullptr, Mesh::Feature::getClassTypeId()));
Gui::Selection().clearSelection();
Gui::TaskView::TaskBox* tasksel = new Gui::TaskView::TaskBox();
tasksel->groupLayout()->addWidget(selection);
tasksel->hide();
Content.push_back(tasksel);
QWidget* box = addTaskBoxWithoutHeader(selection);
box->hide();
connect(widget, &DlgSmoothing::toggledSelection, tasksel, &QWidget::setVisible);
connect(widget, &DlgSmoothing::toggledSelection, box, &QWidget::setVisible);
}
bool TaskSmoothing::accept()

View File

@@ -406,9 +406,7 @@ bool RemeshGmsh::loadOutput()
TaskRemeshGmsh::TaskRemeshGmsh(Mesh::Feature* mesh)
{
widget = new RemeshGmsh(mesh);
taskbox = new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget, false);
}
void TaskRemeshGmsh::clicked(int id)

View File

@@ -135,7 +135,6 @@ public:
private:
RemeshGmsh* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace MeshGui

View File

@@ -244,9 +244,7 @@ void RemoveComponentsDialog::clicked(QAbstractButton* btn)
TaskRemoveComponents::TaskRemoveComponents()
{
widget = new RemoveComponents(); // NOLINT
taskbox = new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget, false);
}
void TaskRemoveComponents::modifyStandardButtons(QDialogButtonBox* box)

View File

@@ -125,7 +125,6 @@ public:
private:
RemoveComponents* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace MeshGui

View File

@@ -159,9 +159,7 @@ void Segmentation::changeEvent(QEvent* e)
TaskSegmentation::TaskSegmentation(Mesh::Feature* mesh)
{
widget = new Segmentation(mesh); // NOLINT
taskbox = new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget, false);
}
bool TaskSegmentation::accept()

View File

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

View File

@@ -544,9 +544,7 @@ void SegmentationBestFit::changeEvent(QEvent* e)
TaskSegmentationBestFit::TaskSegmentationBestFit(Mesh::Feature* mesh)
{
widget = new SegmentationBestFit(mesh); // NOLINT
taskbox = new Gui::TaskView::TaskBox(QPixmap(), widget->windowTitle(), false, nullptr);
taskbox->groupLayout()->addWidget(widget);
Content.push_back(taskbox);
addTaskBox(widget, false);
}
bool TaskSegmentationBestFit::accept()

View File

@@ -143,7 +143,6 @@ public:
private:
SegmentationBestFit* widget;
Gui::TaskView::TaskBox* taskbox;
};
} // namespace MeshGui

View File

@@ -85,6 +85,7 @@ public:
QGroupBox* box = new QGroupBox();
box->setTitle(tr("Mesh info box"));
box->setWindowTitle(tr("Mesh info"));
// box->setAutoFillBackground(true);
QGridLayout* grid = new QGridLayout(box);
grid->addWidget(labelPoints, 0, 0);
@@ -97,10 +98,7 @@ public:
grid->addWidget(labelMax, 3, 0);
grid->addWidget(numMax, 3, 1);
Gui::TaskView::TaskBox* taskbox =
new Gui::TaskView::TaskBox(QPixmap(), tr("Mesh info"), false, nullptr);
taskbox->groupLayout()->addWidget(box);
Content.push_back(taskbox);
addTaskBox(box, false);
}
bool shouldShow() override
{