[yast-commit] r43222 - /trunk/qt/src/YQComboBox.cc
Author: coolo Date: Fri Dec 21 13:35:17 2007 New Revision: 43222 URL: http://svn.opensuse.org/viewcvs/yast?rev=43222&view=rev Log: fixing qcombobox semantic Modified: trunk/qt/src/YQComboBox.cc Modified: trunk/qt/src/YQComboBox.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQComboBox.cc?rev=43222&r1=43221&r2=43222&view=diff ============================================================================== --- trunk/qt/src/YQComboBox.cc (original) +++ trunk/qt/src/YQComboBox.cc Fri Dec 21 13:35:17 2007 @@ -35,7 +35,7 @@ #include "YQSignalBlocker.h" #include "YQWidgetCaption.h" #include <QVBoxLayout> - +#include <QDebug> YQComboBox::YQComboBox( YWidget * parent, const string & label, @@ -94,7 +94,14 @@ if ( isValidText( text ) ) { YQSignalBlocker sigBlocker( _qt_comboBox ); - _qt_comboBox->setItemText(_qt_comboBox->currentIndex(), text ); + int index = _qt_comboBox->findText( text ); + YItem *item = findItem( newValue ); + if ( index < 0 ) + _qt_comboBox->setItemText(_qt_comboBox->currentIndex(), text ); + else { + _qt_comboBox->setCurrentIndex( index ); + _qt_comboBox->setItemText(index, text ); + } } else { @@ -119,9 +126,9 @@ } if ( icon.isNull() ) - _qt_comboBox->insertItem( -1, fromUTF8( item->label() ) ); + _qt_comboBox->addItem( fromUTF8( item->label() ) ); else - _qt_comboBox->insertItem( -1, icon, fromUTF8( item->label() ) ); + _qt_comboBox->addItem( icon, fromUTF8( item->label() ) ); if ( item->selected() ) { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
coolo@svn.opensuse.org