Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mesh: embed Evaluation dialog into a scroll area
  • Loading branch information
wwmayer committed Oct 24, 2021
1 parent 9f2dd4a commit ca6d49d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp
Expand Up @@ -25,6 +25,7 @@
#ifndef _PreComp_
# include <QDockWidget>
# include <QMessageBox>
# include <QScrollArea>
#endif

#include "DlgEvaluateMeshImp.h"
Expand Down Expand Up @@ -1273,11 +1274,18 @@ bool DockEvaluateMeshImp::hasInstance()
DockEvaluateMeshImp::DockEvaluateMeshImp( QWidget* parent, Qt::WindowFlags fl )
: DlgEvaluateMeshImp( parent, fl )
{
scrollArea = new QScrollArea();
scrollArea->setObjectName(QLatin1String("scrollArea"));
scrollArea->setFrameShape(QFrame::NoFrame);
scrollArea->setFrameShadow(QFrame::Plain);
scrollArea->setWidgetResizable(true);
scrollArea->setWidget(this);

// embed this dialog into a dockable widget container
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
// use Qt macro for preparing for translation stuff (but not translating yet)
QDockWidget* dw = pDockMgr->addDockWindow("Evaluate & Repair Mesh",
this, Qt::RightDockWidgetArea);
scrollArea, Qt::RightDockWidgetArea);
//dw->setAttribute(Qt::WA_DeleteOnClose);
dw->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
dw->show();
Expand All @@ -1298,7 +1306,11 @@ void DockEvaluateMeshImp::closeEvent(QCloseEvent*)
{
// closes the dock window
Gui::DockWindowManager* pDockMgr = Gui::DockWindowManager::instance();
pDockMgr->removeDockWindow(this);
pDockMgr->removeDockWindow(scrollArea);

// make sure to also delete the scroll area
scrollArea->setWidget(nullptr);
scrollArea->deleteLater();
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Mesh/Gui/DlgEvaluateMeshImp.h
Expand Up @@ -34,6 +34,7 @@
#include <Mod/Mesh/App/Types.h>

class QAbstractButton;
class QScrollArea;

namespace Gui {
class View3DInventor;
Expand Down Expand Up @@ -159,6 +160,7 @@ class DockEvaluateMeshImp : public DlgEvaluateMeshImp
QSize sizeHint () const;

private:
QScrollArea* scrollArea;
static DockEvaluateMeshImp* _instance;
};

Expand Down

0 comments on commit ca6d49d

Please sign in to comment.