Commit 2f970956 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX #263] colormapper does not cause a crash anymore when changing the name...

[FIX #263] colormapper does not cause a crash anymore when changing the name property directly. It also now allows editing the colormap name directly.
parent 44f71816
......@@ -151,10 +151,12 @@ WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGET
QHBoxLayout* labelContainerLayout = new QHBoxLayout();
labelContainer->setLayout( labelContainerLayout );
WScaleLabel* l = new WScaleLabel( QString::fromStdString( m_texture->name()->get() ), 5, labelContainer );
l->setTextInteractionFlags( Qt::NoTextInteraction );
l->setToolTip( "The name of this texture. This usually is the name of the file it was loaded from." );
labelContainerLayout->addWidget( l );
WPropertyStringWidget* nameLabel = new WPropertyStringWidget( m_texture->name(), NULL, m_itemWidget );
//WScaleLabel* l = new WScaleLabel( QString::fromStdString( m_texture->name()->get() ), 5, labelContainer );
//l->setTextInteractionFlags( Qt::NoTextInteraction );
nameLabel->setToolTip( "The name of this texture. This usually is the name of the file it was loaded from." );
labelContainerLayout->addWidget( nameLabel );
// alpha property
WPropertyDoubleWidget* alpha = new WPropertyDoubleWidget( m_texture->alpha(), NULL, m_itemWidget );
......@@ -207,7 +209,7 @@ WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGET
propActionBtn->setStyleSheet( "background-color:" + propertyCol.name() + ";" );
active->setStyleSheet( "background-color:" + labelCol.name() + ";" );
alpha->setStyleSheet( "#ControlPanelPropertyWidget{ background-color:" + propertyCol.name() + ";}" );
l->setStyleSheet( "background-color:" + labelCol.name() + ";" );
nameLabel->setStyleSheet( "background-color:" + labelCol.name() + ";border:none;" );
labelContainer->setStyleSheet( "background-color:" + labelCol.name() + ";" );
// fill layout
......@@ -232,16 +234,11 @@ WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGET
// widget size constraints and policies
m_itemWidget->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
// we need to know the name of the texture
m_nameConnection = m_texture->name()->getUpdateCondition()->subscribeSignal(
boost::bind( &WQtColormapper::pushUpdateEvent, cmapper )
);
}
WQtColormapper::WQtTextureListItem::~WQtTextureListItem()
{
m_nameConnection.disconnect();
// cleanup
}
const osg::ref_ptr< WGETexture3D > WQtColormapper::WQtTextureListItem::getTexture() const
......@@ -257,7 +254,7 @@ QWidget* WQtColormapper::WQtTextureListItem::getWidget() const
void WQtColormapper::pushUpdateEvent()
{
// create a new event for this and insert it into event queue
QCoreApplication::postEvent( this, new WUpdateTextureSorterEvent() );
QCoreApplication::postEvent( this, new WUpdateTextureSorterEvent() );
}
bool WQtColormapper::event( QEvent* event )
......
......@@ -164,11 +164,6 @@ private:
*/
const osg::ref_ptr< WGETexture3D > m_texture;
/**
* Connection for the texture's name property
*/
boost::signals2::connection m_nameConnection;
/**
* Parent list.
*/
......
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