set correct value for model when selecting an item whose strings occurs multiple times in the combobox

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@894 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-04-07 21:24:31 +00:00
parent 2856928bf9
commit 4851df0cf7
2 changed files with 10 additions and 2 deletions

View File

@@ -127,10 +127,12 @@ void comboBox::mousePressEvent( QMouseEvent * _me )
m_menu.clear();
for( int i = 0; i < model()->size(); ++i )
{
m_menu.addAction( model()->itemPixmap( i ) ?
QAction * a = m_menu.addAction(
model()->itemPixmap( i ) ?
*model()->itemPixmap( i ) :
QPixmap(),
model()->itemText( i ) );
a->setData( i );
}
QPoint gpos = mapToGlobal( QPoint( 0, height() ) );
@@ -245,7 +247,7 @@ void comboBox::deletePixmap( QPixmap * _pixmap )
void comboBox::setItem( QAction * _item )
{
model()->setInitValue( model()->findText( _item->text() ) );
model()->setInitValue( _item->data().toInt() );
}