From 29130ab6170e8f215afe789ca138216094499dd4 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 28 Jul 2008 13:42:32 +0000 Subject: [PATCH] Fix combo box model problems --- src/Qtx/QtxComboBox.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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() ); } -- 2.39.2