mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-14 02:30:33 +05:00
make Cancel button checkable
This commit is contained in:
parent
7c7b4b0636
commit
f4ec60b8ca
@ -737,6 +737,7 @@ SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog(QWidget
|
|||||||
|
|
||||||
cancelButton = new QPushButton(tr("CANCEL"));
|
cancelButton = new QPushButton(tr("CANCEL"));
|
||||||
cancelButton->setDefault(true);
|
cancelButton->setDefault(true);
|
||||||
|
cancelButton->setCheckable(true);
|
||||||
|
|
||||||
QLabel * nbNodesName = new QLabel(tr("SMESH_MESHINFO_NODES"), this );
|
QLabel * nbNodesName = new QLabel(tr("SMESH_MESHINFO_NODES"), this );
|
||||||
QLabel * nbElemsName = new QLabel(tr("SMESH_MESHINFO_ELEMENTS"), this );
|
QLabel * nbElemsName = new QLabel(tr("SMESH_MESHINFO_ELEMENTS"), this );
|
||||||
@ -779,13 +780,13 @@ bool SMESHGUI_ComputeDlg_QThreadQDialog::result()
|
|||||||
void SMESHGUI_ComputeDlg_QThreadQDialog::onCancel()
|
void SMESHGUI_ComputeDlg_QThreadQDialog::onCancel()
|
||||||
{
|
{
|
||||||
qthread.cancel();
|
qthread.cancel();
|
||||||
cancelButton->setDown( true );
|
|
||||||
cancelButton->setText( tr("CANCELING"));
|
cancelButton->setText( tr("CANCELING"));
|
||||||
|
cancelButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SMESHGUI_ComputeDlg_QThreadQDialog::timerEvent(QTimerEvent *event)
|
void SMESHGUI_ComputeDlg_QThreadQDialog::timerEvent(QTimerEvent *event)
|
||||||
{
|
{
|
||||||
if ( !cancelButton->isDown() ) // not yet cancelled
|
if ( !cancelButton->isChecked() ) // not yet cancelled
|
||||||
progressBar->setValue( progressBar->maximum() * qthread.getMesh()->GetComputeProgress() );
|
progressBar->setValue( progressBar->maximum() * qthread.getMesh()->GetComputeProgress() );
|
||||||
|
|
||||||
if(qthread.isFinished())
|
if(qthread.isFinished())
|
||||||
|
Loading…
Reference in New Issue
Block a user