From: vsr Date: Mon, 28 Jul 2008 13:42:32 +0000 (+0000) Subject: Fix combo box model problems X-Git-Tag: TG_TRIPOLI_qt4_porting~42 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=29130ab6170e8f215afe789ca138216094499dd4;p=modules%2Fgui.git Fix combo box model problems --- diff --git a/src/Qtx/QtxComboBox.cxx b/src/Qtx/QtxComboBox.cxx index 656579d8b..25ac78cf7 100755 --- a/src/Qtx/QtxComboBox.cxx +++ b/src/Qtx/QtxComboBox.cxx @@ -130,7 +130,6 @@ QtxComboBox::QtxComboBox( QWidget* parent ) myCleared( false ) { connect( this, SIGNAL( activated( int ) ), this, SLOT( onActivated( int ) ) ); - connect( this, SIGNAL( activated( const QString& ) ), this, SLOT( onActivated( const QString& ) ) ); connect( this, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onCurrentChanged( int ) ) ); setModel( new Model( this ) ); } @@ -205,9 +204,11 @@ void QtxComboBox::setId( const int index, const int id ) void QtxComboBox::paintEvent( QPaintEvent* e ) { Model* m = dynamic_cast( model() ); - m->setCleared( myCleared ); + if ( m ) + m->setCleared( myCleared ); QComboBox::paintEvent( e ); - m->setCleared( false ); + if ( m ) + m->setCleared( false ); } /*! @@ -216,7 +217,7 @@ void QtxComboBox::paintEvent( QPaintEvent* e ) */ void QtxComboBox::childEvent( QChildEvent* e ) { - if ( e->added() || e->polished() && qobject_cast( e->child() ) ) + if ( ( e->added() || e->polished() ) && qobject_cast( e->child() ) ) QApplication::postEvent( this, new ClearEvent() ); }