-rw-r--r-- | libopie2/qt3/opieui/ocombobox.cpp | 5 | ||||
-rw-r--r-- | libopie2/qt3/opieui/oeditlistbox.cpp | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libopie2/qt3/opieui/ocombobox.cpp b/libopie2/qt3/opieui/ocombobox.cpp index a1dd5f5..8dbda8f 100644 --- a/libopie2/qt3/opieui/ocombobox.cpp +++ b/libopie2/qt3/opieui/ocombobox.cpp @@ -307,33 +307,36 @@ OCompletionBox * OComboBox::completionBox( bool create ) if ( d->olineEdit ) return d->olineEdit->completionBox( create ); return 0; } // QWidget::create() turns off mouse-Tracking which would break auto-hiding void OComboBox::create( WId id, bool initializeWindow, bool destroyOldWindow ) { QComboBox::create( id, initializeWindow, destroyOldWindow ); //OCursor::setAutoHideCursor( lineEdit(), true, true ); } void OComboBox::setLineEdit( OLineEdit *edit ) { #if QT_VERSION > 290 QComboBox::setLineEdit( edit ); - d->olineEdit = dynamic_cast<OLineEdit*>( edit ); + if ( !edit->inherits( "OLineEdit" ) ) + d->olineEdit = 0; + else + d->olineEdit = static_cast<OLineEdit*>( edit ); setDelegate( d->olineEdit ); // forward some signals. We only emit returnPressed() ourselves. if ( d->olineEdit ) { connect( d->olineEdit, SIGNAL( completion( const QString& )), SIGNAL( completion( const QString& )) ); connect( d->olineEdit, SIGNAL( substringCompletion( const QString& )), SIGNAL( substringCompletion( const QString& )) ); connect( d->olineEdit, SIGNAL( textRotation( OCompletionBase::KeyBindingType )), SIGNAL( textRotation( OCompletionBase::KeyBindingType )) ); connect( d->olineEdit, SIGNAL( completionModeChanged( OGlobalSettings::Completion )), SIGNAL( completionModeChanged( OGlobalSettings::Completion))); connect( d->olineEdit, diff --git a/libopie2/qt3/opieui/oeditlistbox.cpp b/libopie2/qt3/opieui/oeditlistbox.cpp index 3c53552..0e95274 100644 --- a/libopie2/qt3/opieui/oeditlistbox.cpp +++ b/libopie2/qt3/opieui/oeditlistbox.cpp @@ -398,19 +398,20 @@ QStringList OEditListBox::items() const list.append( m_listBox->text( i )); return list; } void OEditListBox::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } /*====================================================================================== * CustomEditor *======================================================================================*/ OEditListBox::CustomEditor::CustomEditor( OComboBox *combo ) { m_representationWidget = combo; - m_lineEdit = dynamic_cast<OLineEdit*>( combo->lineEdit() ); - assert( m_lineEdit ); + assert( combo->lineEdit()->inherits( "OLineEdit" ) ); + m_lineEdit = static_cast<OLineEdit*>( combo->lineEdit() ); + } |