File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ void CharacterWidget::setColumns( int columns )
111
111
112
112
void CharacterWidget::setCharacter ( QChar character )
113
113
{
114
+ const bool changed = character != mLastKey ;
114
115
mLastKey = character.unicode ();
115
116
QWidget *widget = parentWidget ();
116
117
if ( widget )
@@ -119,6 +120,9 @@ void CharacterWidget::setCharacter( QChar character )
119
120
if ( scrollArea && mLastKey < 65536 )
120
121
scrollArea->verticalScrollBar ()->setValue ( mLastKey / mColumns * mSquareSize );
121
122
}
123
+ if ( changed )
124
+ emit characterSelected ( mLastKey );
125
+
122
126
update ();
123
127
}
124
128
@@ -141,7 +145,6 @@ void CharacterWidget::keyPressEvent( QKeyEvent *event )
141
145
if ( chr.unicode () != mLastKey )
142
146
{
143
147
setCharacter ( chr );
144
- emit characterSelected ( chr );
145
148
}
146
149
}
147
150
}
You can’t perform that action at this time.
0 commit comments