Quanta: Enable and use TQt input methods in Kafka (VPL) part.

This resolves issue #14.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
(cherry picked from commit b303e4d39b)
r14.0.x
Mavridis Philippe 3 years ago committed by Michele Calgaro
parent 164dd76d6c
commit 13cafe2fdc
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -99,6 +99,8 @@ KafkaWidget::KafkaWidget(TQWidget *parent, TQWidget *widgetParent, KafkaDocument
m_modifs = 0L; m_modifs = 0L;
view()->setInputMethodEnabled(true);
// With the mix of Leo Savernik's caret Mode and the current editing // With the mix of Leo Savernik's caret Mode and the current editing
// functions, it will be kind of VERY messy // functions, it will be kind of VERY messy
setCaretMode(true); setCaretMode(true);
@ -504,7 +506,7 @@ bool KafkaWidget::eventFilter(TQObject *, TQEvent *event)
emit hasFocus(false); emit hasFocus(false);
} }
if(event->type() == TQEvent::KeyPress) if(event->type() == TQEvent::KeyPress || event->type() == TQEvent::IMEnd)
{ {
TQKeyEvent *keyevent = TQT_TQKEYEVENT(event); TQKeyEvent *keyevent = TQT_TQKEYEVENT(event);
@ -661,7 +663,7 @@ bool KafkaWidget::eventFilter(TQObject *, TQEvent *event)
!( keyevent->state() & AltButton ) && !( keyevent->state() & AltButton ) &&
!( keyevent->state() & MetaButton ) || !( keyevent->state() & MetaButton ) ||
( ( (keyevent->state()&ControlButton) | AltButton ) == (ControlButton|AltButton) ) ) && ( ( (keyevent->state()&ControlButton) | AltButton ) == (ControlButton|AltButton) ) ) &&
( !keyevent->ascii() || keyevent->ascii() >= 32 || keyevent->text() == "\t" ) ) ( !keyevent->ascii() || keyevent->ascii() >= 32 || keyevent->text() == "\t" ) || event->type() == TQEvent::IMEnd )
{ {
if(hasSelection()) if(hasSelection())
removeSelection(); removeSelection();

Loading…
Cancel
Save