Commit 549ab145 authored by Sylvain Thery's avatar Sylvain Thery

bugs in QGLViewer usage with stream

parent cb6f8bf3
......@@ -133,29 +133,35 @@ public:
#ifdef WITH_QT
void toStatusBar(void* ptr);
/**
* remove output to status bars
*/
void noStatusBar();
void toConsole(void* ptr);
/**
* remove output to consoles
*/
void noConsole();
/**
* set output to status bar of Qt interface
*/
void toStatusBar(Utils::QT::SimpleQT* sqt);
void toStatusBar(Utils::QT::SimpleQT* sqt = NULL);
/**
* set output to console of Qt interface
*/
void toConsole(Utils::QT::SimpleQT* sqt);
void toConsole(Utils::QT::SimpleQT* sqt = NULL);
/**
* set output to status bar of Qt interface
*/
void toStatusBar(Utils::QT::SimpleQGLV* sqglv);
void toStatusBar(Utils::QT::SimpleQGLV* sqglv = NULL);
/**
* set output to console of Qt interface
*/
void toConsole(Utils::QT::SimpleQGLV* sqglv);
void toConsole(Utils::QT::SimpleQGLV* sqglv = NULL);
#endif
......
......@@ -130,19 +130,13 @@ void QGLView::resizeGL(int w, int h)
void QGLView::keyPressEvent(QKeyEvent* event)
{
if (event->key() == Qt::Key_Escape)
{
close();
m_sqgl->close();
return;
}
m_state_modifier = event->modifiers();
QGLViewer::keyPressEvent(event);
if (m_sqgl)
{
m_state_modifier = event->modifiers();
int k = event->key();
if ( (k >= 65) && (k <= 91) && !(event->modifiers() & Qt::ShiftModifier) )
if ( (k >= 65) && (k <= 91) && !(m_state_modifier & Qt::ShiftModifier) )
k += 32;
m_sqgl->cb_keyPress(k);
}
......@@ -150,12 +144,12 @@ void QGLView::keyPressEvent(QKeyEvent* event)
void QGLView::keyReleaseEvent(QKeyEvent* event)
{
m_state_modifier = event->modifiers();
QGLViewer::keyReleaseEvent(event);
if (m_sqgl)
{
m_state_modifier = event->modifiers();
int k = event->key();
if ( (k >= 65) && (k <= 91) && !(event->modifiers() & Qt::ShiftModifier) )
if ( (k >= 65) && (k <= 91) && !(m_state_modifier & Qt::ShiftModifier) )
k += 32;
m_sqgl->cb_keyRelease(k);
}
......
......@@ -162,18 +162,22 @@ void Out::toFile(const std::string& filename )
}
#ifdef WITH_QT
void Out::toStatusBar(void* ptr)
void Out::noStatusBar()
{
if (ptr == NULL)
m_out_mode &= ~QTSTATUSBAR;
m_out_mode &= ~QTSTATUSBAR;
m_sqt_bar = NULL;
m_sqglv_bar = NULL;
}
void Out::toConsole(void* ptr)
void Out::noConsole()
{
if (ptr == NULL)
m_out_mode &= ~QTCONSOLE;
m_out_mode &= ~QTCONSOLE;
m_sqt_console = NULL;
m_sqglv_console = NULL;
}
void Out::toStatusBar(Utils::QT::SimpleQT* sqt)
{
if (sqt != NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment