summaryrefslogtreecommitdiff
path: root/inputmethods/handwriting/qimpensetup.cpp
Side-by-side diff
Diffstat (limited to 'inputmethods/handwriting/qimpensetup.cpp') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/handwriting/qimpensetup.cpp17
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
@@ -317,25 +317,25 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent,
currentCode = 0;
inputChar = new QIMPenChar();
QVBoxLayout *tvb = new QVBoxLayout( this, 5 );
QGridLayout *gl = new QGridLayout( tvb, 4, 2 );
gl->setRowStretch( 1, 1 );
gl->addRowSpacing( 2, 35 );
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() );
}
charList = new QListBox( this );
charList->setMinimumHeight( charList->sizeHint().height() );
connect( charList, SIGNAL(highlighted(int)), SLOT(selectChar(int)) );
gl->addWidget( charList, 1, 0 );
pw = new QIMPenWidget( this );
pw->setFixedHeight( 75 );
@@ -379,41 +379,41 @@ QIMPenEdit::QIMPenEdit( QIMPenProfile *p, QWidget *parent,
//--
#if !defined(Q_WS_QWS)
hb = new QHBoxLayout( tvb );
pb = new QPushButton( tr("OK"), this );
connect( pb, SIGNAL(clicked()), SLOT(accept()) );
hb->addWidget( pb );
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();
}
void QIMPenEdit::setProfile( QIMPenProfile *p )
{
profile = p;
charSetCombo->clear();
QIMPenCharSetIterator it( profile->charSets() );
for ( ; it.current(); ++it ) {
if ( ! it.current()->hidden() )
charSetCombo->insertItem( it.current()->description() );
}
- selectCharSet( 0 );
+ selectCharSetVisible( 0 );
charList->setFocus();
enableButtons();
}
void QIMPenEdit::selectCharSet( QIMPenCharSet *c )
{
int i = 0;
QIMPenCharSetIterator it( profile->charSets() );
for ( ; it.current(); ++it, i++ ) {
if ( it.current() == c ) {
charSetCombo->setCurrentItem( i );
selectCharSet( i );
@@ -540,24 +540,35 @@ void QIMPenEdit::selectChar( int i )
for ( ; it.current(); ++it ) {
if ( it.current()->character() == currentCode &&
!it.current()->testFlag( QIMPenChar::Deleted ) ) {
setCurrentChar( it.current() );
break;
}
}
if ( !it.current() )
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 );
currentSet = profile->charSets().at( i );
fillCharList();
pw->insertCharSet( currentSet );
inputChar->clear();
if ( charList->count() ) {
charList->setSelected( 0, TRUE );
selectChar(0);
}