Diffstat (limited to 'inputmethods/handwriting/qimpensetup.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | inputmethods/handwriting/qimpensetup.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/inputmethods/handwriting/qimpensetup.cpp b/inputmethods/handwriting/qimpensetup.cpp index d1297a9..3f4841d 100644 --- a/inputmethods/handwriting/qimpensetup.cpp +++ b/inputmethods/handwriting/qimpensetup.cpp @@ -325,9 +325,9 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent, gl->addRowSpacing( 3, 35 ); charSetCombo = new QComboBox( this ); gl->addMultiCellWidget( charSetCombo, 0, 0, 0, 1 ); - connect( charSetCombo, SIGNAL(activated(int)), SLOT(selectCharSet(int))); + connect( charSetCombo, SIGNAL(activated(int)), SLOT(selectCharSetVisible(int))); QIMPenCharSetIterator it( profile->charSets() ); for ( ; it.current(); ++it ) { charSetCombo->insertItem( it.current()->description() ); } @@ -387,9 +387,9 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent, pb = new QPushButton( tr("Cancel"), this ); connect( pb, SIGNAL(clicked()), SLOT(reject()) ); hb->addWidget( pb ); #endif - selectCharSet( 0 ); + selectCharSetVisible( 0 ); charList->setFocus(); resize( minimumSize() ); enableButtons(); @@ -403,9 +403,9 @@ void QIMPenEdit::setProfile( QIMPenProfile *p ) for ( ; it.current(); ++it ) { if ( ! it.current()->hidden() ) charSetCombo->insertItem( it.current()->description() ); } - selectCharSet( 0 ); + selectCharSetVisible( 0 ); charList->setFocus(); enableButtons(); } @@ -548,8 +548,19 @@ void QIMPenEdit::selectChar( int i ) setCurrentChar( 0 ); inputChar->clear(); } +void QIMPenEdit::selectCharSetVisible( int c ) +{ + int i = 0; + QIMPenCharSetIterator it( profile->charSets() ); + for ( ; it.current(); ++it, i++ ) { + if ( charSetCombo->text( c ) == it.current()->description() ) { + selectCharSet( i ); + } + } +} + void QIMPenEdit::selectCharSet( int i ) { if ( currentSet ) pw->removeCharSet( 0 ); |