Commit 7f5f1476 by Sebastian Eichelbaum

[CHANGE] - several small fixes.

parent 99368c43
......@@ -243,17 +243,6 @@ void WMainWindow::setupGUI()
}
}
// we do not need the dummy widget if there are no other widgets.
if( m_navAxial || m_navCoronal || m_navSagittal )
{
m_dummyWidget = new QDockWidget( "Spacer", this );
QWidget* tmp = new QWidget( m_dummyWidget );
m_dummyWidget->setTitleBarWidget( tmp );
m_dummyWidget->setFeatures( QDockWidget::DockWidgetClosable );
m_dummyWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Ignored );
addDockWidget( Qt::LeftDockWidgetArea, m_dummyWidget );
}
// Default background color from config file
WColor bgColor( 1.0, 1.0, 1.0, 1.0 );
double r;
......
......@@ -58,7 +58,7 @@ WQtNavGLWidget::WQtNavGLWidget( QString title, QWidget* parent, std::string slid
#endif
setMinimumSize( 160, 240 );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum );
//setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Maximum );
m_scene = new WGEScene();
m_scene->setDataVariance( osg::Object::DYNAMIC );
......@@ -70,6 +70,9 @@ WQtNavGLWidget::WQtNavGLWidget( QString title, QWidget* parent, std::string slid
panel->setLayout( m_layout );
setWidget( panel );
// we need to know whether the dock is visible or not
connect( this, SIGNAL( visibilityChanged ( bool ) ), this, SLOT( handleVisibilityChange( bool ) ) );
}
WQtNavGLWidget::~WQtNavGLWidget()
......@@ -113,3 +116,9 @@ void WQtNavGLWidget::removeSliderProperty( boost::shared_ptr< WPropertyBase > pr
propertyWidgetMap.erase( prop );
}
void WQtNavGLWidget::handleVisibilityChange( bool visible )
{
// this canhelp to reduce CPU load. Especially if multithreading viewers are used with cull thread per context.
m_glWidget->getViewer()->getView()->getScene()->getSceneData()->setNodeMask( visible * 0xFFFFFFFF );
}
......@@ -89,6 +89,15 @@ public:
void removeSliderProperty( boost::shared_ptr< WPropertyBase > prop );
protected:
private slots:
/**
* If the dock widget changes its visibility.
*
* \param visible if true, the dock is visible
*/
void handleVisibilityChange( bool visible );
private:
/**
......
......@@ -31,7 +31,7 @@
// The minimum width and heigh of items inside the scene
#define WNETWORKITEM_MINIMUM_WIDTH 100
#define WNETWORKITEM_MINIMUM_HEIGHT 150
#define WNETWORKITEM_MINIMUM_HEIGHT 50
#endif // WQTNETWORKEDITORGLOBALS_H
......@@ -120,15 +120,6 @@ boost::shared_ptr< WGEViewer > WQtGLWidgetAll::getViewer() const
void WQtGLWidgetAll::paintEvent( QPaintEvent* /*event*/ )
{
// maybe this helps finding the startup segfaults. This will be removed after the problem has been found.
if ( !m_firstPaint )
{
WLogger::getLogger()->addLogMessage( "Painted the first time.",
"WQtGLWidget(" + m_Viewer->getName() + ")",
LL_DEBUG );
m_firstPaint = true;
}
// m_Viewer->paint();
}
......
......@@ -229,11 +229,6 @@ private:
* Holds the recommended size for the widget
*/
QSize m_recommendedSize;
/**
* True when the widget got drawn the very first time.
*/
bool m_firstPaint;
};
#endif // WQTGLWIDGETALL_H
......@@ -120,15 +120,6 @@ boost::shared_ptr< WGEViewer > WQtGLWidgetWin::getViewer() const
void WQtGLWidgetWin::paintEvent( QPaintEvent* /*event*/ )
{
// maybe this helps finding the startup segfaults. This will be removed after the problem has been found.
if ( !m_firstPaint )
{
WLogger::getLogger()->addLogMessage( "Painted the first time.",
"WQtGLWidget(" + m_Viewer->getName() + ")",
LL_DEBUG );
m_firstPaint = true;
}
// m_Viewer->paint();
}
......
......@@ -215,11 +215,6 @@ private:
* Holds the recommended size for the widget
*/
QSize m_recommendedSize;
/**
* True when the widget got drawn the very first time.
*/
bool m_firstPaint;
};
#endif // WQTGLWIDGETWIN_H
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