Version: 6.3.1
Public Member Functions | Protected Member Functions | Private Slots | Private Attributes

SMESHGUI_ComputeDlg_QThreadQDialog Class Reference

Dialog to display Cancel button. More...

#include <SMESHGUI_ComputeDlg.h>

Inheritance diagram for SMESHGUI_ComputeDlg_QThreadQDialog:
Inheritance graph
[legend]

Public Member Functions

 SMESHGUI_ComputeDlg_QThreadQDialog (QWidget *parent, SMESH::SMESH_Gen_var gen, SMESH::SMESH_Mesh_var mesh, GEOM::GEOM_Object_var mainShape)
bool result ()

Protected Member Functions

void timerEvent (QTimerEvent *timer)
void closeEvent (QCloseEvent *event)

Private Slots

void onCancel ()

Private Attributes

SMESHGUI_ComputeDlg_QThread qthread
QPushButton * cancelButton

Detailed Description

Dialog to display Cancel button.

Definition at line 293 of file SMESHGUI_ComputeDlg.h.


Constructor & Destructor Documentation

SMESHGUI_ComputeDlg_QThreadQDialog::SMESHGUI_ComputeDlg_QThreadQDialog ( QWidget parent,
SMESH::SMESH_Gen_var  gen,
SMESH::SMESH_Mesh_var  mesh,
GEOM::GEOM_Object_var  mainShape 
)

Definition at line 706 of file SMESHGUI_ComputeDlg.cxx.

References cancelButton, onCancel(), and qthread.

  : QDialog(parent),
    qthread(gen, mesh, mainShape)
{
  // --
  setWindowTitle(tr("Compute"));
  cancelButton = new QPushButton(tr("Cancel"));
  cancelButton->setDefault(true);
  connect(cancelButton, SIGNAL(clicked()), this, SLOT(onCancel()));
  QHBoxLayout *layout = new QHBoxLayout;
  layout->addWidget(cancelButton);
  setLayout(layout);
  resize(200, 50);
  // --
  startTimer(30); // 30 millisecs
  qthread.start();
}

Member Function Documentation

void SMESHGUI_ComputeDlg_QThreadQDialog::closeEvent ( QCloseEvent *  event) [protected]

Definition at line 746 of file SMESHGUI_ComputeDlg.cxx.

References qthread.

{
  if(qthread.isRunning())
    {
      event->ignore();
      return;
    }
  event->accept();
}
void SMESHGUI_ComputeDlg_QThreadQDialog::onCancel ( ) [private, slot]
bool SMESHGUI_ComputeDlg_QThreadQDialog::result ( )

Definition at line 727 of file SMESHGUI_ComputeDlg.cxx.

References qthread, and SMESHGUI_ComputeDlg_QThread.result().

Referenced by SMESHGUI_BaseComputeOp.computeMesh().

{
  return qthread.result();
}
void SMESHGUI_ComputeDlg_QThreadQDialog::timerEvent ( QTimerEvent *  timer) [protected]

Definition at line 737 of file SMESHGUI_ComputeDlg.cxx.

References qthread.

{
  if(qthread.isFinished())
    {
      close();
    }
  event->accept();
}

Field Documentation

Definition at line 313 of file SMESHGUI_ComputeDlg.h.

Referenced by SMESHGUI_ComputeDlg_QThreadQDialog().

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS