mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-01 04:10:33 +05:00
21948: EDF SMESH : Memory is not freed when deleting a mesh
Show nb of nodes and elements in "Compute" dialog
This commit is contained in:
parent
cad015ecdc
commit
111d1ee46e
@ -725,20 +725,39 @@ SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog(QWidget *
|
|||||||
SMESH::SMESH_Gen_var gen,
|
SMESH::SMESH_Gen_var gen,
|
||||||
SMESH::SMESH_Mesh_var mesh,
|
SMESH::SMESH_Mesh_var mesh,
|
||||||
GEOM::GEOM_Object_var mainShape)
|
GEOM::GEOM_Object_var mainShape)
|
||||||
: QDialog(parent),
|
: QDialog(parent,
|
||||||
|
Qt::WindowSystemMenuHint |
|
||||||
|
Qt::WindowCloseButtonHint |
|
||||||
|
Qt::Dialog |
|
||||||
|
Qt::WindowMaximizeButtonHint),
|
||||||
qthread(gen, mesh, mainShape)
|
qthread(gen, mesh, mainShape)
|
||||||
{
|
{
|
||||||
// --
|
// --
|
||||||
setWindowTitle(tr("Compute"));
|
setWindowTitle(tr("Compute"));
|
||||||
|
setMinimumWidth( 200 );
|
||||||
|
|
||||||
cancelButton = new QPushButton(tr("Cancel"));
|
cancelButton = new QPushButton(tr("Cancel"));
|
||||||
cancelButton->setDefault(true);
|
cancelButton->setDefault(true);
|
||||||
|
|
||||||
|
QLabel * nbNodesName = new QLabel(tr("SMESH_MESHINFO_NODES"), this );
|
||||||
|
QLabel * nbElemsName = new QLabel(tr("SMESH_MESHINFO_ELEMENTS"), this );
|
||||||
|
nbNodesLabel = new QLabel(" 0", this );
|
||||||
|
nbElemsLabel = new QLabel(" 0", this );
|
||||||
|
|
||||||
|
QGridLayout* layout = new QGridLayout(this);
|
||||||
|
layout->setMargin( MARGIN );
|
||||||
|
layout->setSpacing( SPACING );
|
||||||
|
layout->addWidget(nbNodesName, 0, 0);
|
||||||
|
layout->addWidget(nbNodesLabel, 0, 1);
|
||||||
|
layout->addWidget(nbElemsName, 1, 0);
|
||||||
|
layout->addWidget(nbElemsLabel, 1, 1);
|
||||||
|
layout->addWidget(cancelButton, 2, 0, 1, 2);
|
||||||
|
adjustSize();
|
||||||
|
update();
|
||||||
|
|
||||||
connect(cancelButton, SIGNAL(clicked()), this, SLOT(onCancel()));
|
connect(cancelButton, SIGNAL(clicked()), this, SLOT(onCancel()));
|
||||||
QHBoxLayout *layout = new QHBoxLayout;
|
|
||||||
layout->addWidget(cancelButton);
|
|
||||||
setLayout(layout);
|
|
||||||
resize(200, 50);
|
|
||||||
// --
|
// --
|
||||||
startTimer(30); // 30 millisecs
|
startTimer(300); // millisecs
|
||||||
qthread.start();
|
qthread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -758,6 +777,8 @@ void SMESHGUI_ComputeDlg_QThreadQDialog::timerEvent(QTimerEvent *event)
|
|||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
nbNodesLabel->setText( QString("%1").arg( qthread.getMesh()->NbNodes() ));
|
||||||
|
nbElemsLabel->setText( QString("%1").arg( qthread.getMesh()->NbElements() ));
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,6 +276,7 @@ public:
|
|||||||
GEOM::GEOM_Object_var mainShape);
|
GEOM::GEOM_Object_var mainShape);
|
||||||
bool result();
|
bool result();
|
||||||
void cancel();
|
void cancel();
|
||||||
|
SMESH::SMESH_Mesh_var& getMesh() { return myMesh; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void run();
|
void run();
|
||||||
@ -312,7 +313,8 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
SMESHGUI_ComputeDlg_QThread qthread;
|
SMESHGUI_ComputeDlg_QThread qthread;
|
||||||
QPushButton * cancelButton;
|
QPushButton * cancelButton;
|
||||||
|
QLabel * nbNodesLabel;
|
||||||
|
QLabel * nbElemsLabel;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMESHGUI_COMPUTEDLG_H
|
#endif // SMESHGUI_COMPUTEDLG_H
|
||||||
|
Loading…
Reference in New Issue
Block a user