@ -60,6 +60,7 @@ CMainWindow::CMainWindow(QWidget *parent, Qt::WindowFlags flags)
m_IsExiting ( false )
m_IsExiting ( false )
{
{
setObjectName ( " CMainWindow " ) ;
setObjectName ( " CMainWindow " ) ;
setWindowTitle ( tr ( " NeL Mesh Editor " ) ) ;
m_UndoStack = new QUndoStack ( this ) ;
m_UndoStack = new QUndoStack ( this ) ;
@ -78,11 +79,8 @@ CMainWindow::CMainWindow(QWidget *parent, Qt::WindowFlags flags)
recalculateMinimumWidth ( ) ;
recalculateMinimumWidth ( ) ;
// As a special case, a QTimer with a timeout of 0 will time out as soon as all the events in the window system's event queue have been processed. This can be used to do heavy work while providing a snappy user interface.
m_Timer = new QTimer ( this ) ;
m_Timer = new QTimer ( this ) ;
connect ( m_Timer , SIGNAL ( timeout ( ) ) , this , SLOT ( updateRender ( ) ) ) ;
connect ( m_Timer , SIGNAL ( timeout ( ) ) , this , SLOT ( updateRender ( ) ) ) ;
// timer->start(); // <- timeout 0
// it's heavy on cpu, though, when no 3d driver initialized :)
m_Timer - > start ( 40 ) ; // 25fps
m_Timer - > start ( 40 ) ; // 25fps
m_IsGraphicsEnabled = m_GraphicsConfig - > getGraphicsEnabled ( ) ;
m_IsGraphicsEnabled = m_GraphicsConfig - > getGraphicsEnabled ( ) ;
@ -104,6 +102,14 @@ CMainWindow::~CMainWindow()
m_Configuration . release ( ) ;
m_Configuration . release ( ) ;
}
}
void CMainWindow : : closeEvent ( QCloseEvent * e )
{
m_Timer - > stop ( ) ;
updateInitialization ( false ) ;
QMainWindow : : closeEvent ( e ) ;
}
void CMainWindow : : setVisible ( bool visible )
void CMainWindow : : setVisible ( bool visible )
{
{
// called by show()
// called by show()