summaryrefslogtreecommitdiffstats
path: root/quanta/parts/kafka/kafkahtmlpart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/parts/kafka/kafkahtmlpart.cpp')
-rw-r--r--quanta/parts/kafka/kafkahtmlpart.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/quanta/parts/kafka/kafkahtmlpart.cpp b/quanta/parts/kafka/kafkahtmlpart.cpp
index a1e78aa5..fc0460ad 100644
--- a/quanta/parts/kafka/kafkahtmlpart.cpp
+++ b/quanta/parts/kafka/kafkahtmlpart.cpp
@@ -85,7 +85,7 @@ public:
KafkaWidget::KafkaWidget(TQWidget *parent, TQWidget *widgetParent, KafkaDocument *part,
const char *name)
- : TDEHTMLPart(widgetParent, name, TQT_TQOBJECT(parent), name),
+ : TDEHTMLPart(widgetParent, name, parent, name),
w(part)
{
m_contextPopupMenu = new TQPopupMenu();
@@ -99,15 +99,17 @@ KafkaWidget::KafkaWidget(TQWidget *parent, TQWidget *widgetParent, KafkaDocument
m_modifs = 0L;
+ view()->setInputMethodEnabled(true);
+
// With the mix of Leo Savernik's caret Mode and the current editing
// functions, it will be kind of VERY messy
setCaretMode(true);
- connect(this, TQT_SIGNAL(caretPositionChanged(const DOM::Node &, long)),
- this, TQT_SLOT(slotNewCursorPos(const DOM::Node &, long)));
+ connect(this, TQ_SIGNAL(caretPositionChanged(const DOM::Node &, long)),
+ this, TQ_SLOT(slotNewCursorPos(const DOM::Node &, long)));
setCaretDisplayPolicyNonFocused(TDEHTMLPart::CaretVisible);
- connect(this, TQT_SIGNAL(popupMenu(const TQString&, const TQPoint&)),
- this, TQT_SLOT(slotContextMenuRequested(const TQString&, const TQPoint&)));
+ connect(this, TQ_SIGNAL(popupMenu(const TQString&, const TQPoint&)),
+ this, TQ_SLOT(slotContextMenuRequested(const TQString&, const TQPoint&)));
view()->setMouseTracking(true);
view()->installEventFilter(this);
@@ -184,7 +186,7 @@ void KafkaWidget::insertText(DOM::Node node, const TQString &text, int position)
kdDebug(25001) << "KafkaWidget::insertText() - added text - 1" << endl;
#endif
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
return;
}
}
@@ -261,7 +263,7 @@ void KafkaWidget::insertText(DOM::Node node, const TQString &text, int position)
}
//document().updateRendering();
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
}
void KafkaWidget::slotDelayedSetCaretPosition()
@@ -465,7 +467,7 @@ void KafkaWidget::keyReturn(bool specialPressed)
kdDebug(25001)<< "CURNODE : " << m_currentNode.nodeName().string() << ":"
<< m_currentNode.nodeValue().string() << " : " << d->m_cursorOffset << endl;
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
kdDebug(25001)<< "CURNODE : " << m_currentNode.nodeName().string() << ":"
<< m_currentNode.nodeValue().string() << " : " << d->m_cursorOffset << endl;
//emit domNodeNewCursorPos(m_currentNode, d->m_cursorOffset);
@@ -476,7 +478,7 @@ void KafkaWidget::keyReturn(bool specialPressed)
<< m_currentNode.nodeValue().string() << " : " << d->m_cursorOffset << endl;
#endif
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
}
bool KafkaWidget::eventFilter(TQObject *, TQEvent *event)
@@ -504,9 +506,9 @@ bool KafkaWidget::eventFilter(TQObject *, TQEvent *event)
emit hasFocus(false);
}
- if(event->type() == TQEvent::KeyPress)
+ if(event->type() == TQEvent::KeyPress || event->type() == TQEvent::IMEnd)
{
- TQKeyEvent *keyevent = TQT_TQKEYEVENT(event);
+ TQKeyEvent *keyevent = static_cast<TQKeyEvent*>(event);
//Create a new NodeModifsSet where the changes will be logged.
m_modifs = new NodeModifsSet();
@@ -655,13 +657,13 @@ bool KafkaWidget::eventFilter(TQObject *, TQEvent *event)
kdDebug(25001) << "KafkaWidget::eventFilter() Text - " <<
keyevent->text() << endl;
#endif
- //if(( keyevent->state() & TQt::ShiftButton) || ( keyevent->state() == Qt::NoButton))
+ //if(( keyevent->state() & TQt::ShiftButton) || ( keyevent->state() == TQt::NoButton))
if( keyevent->text().length() &&
( !( keyevent->state() & ControlButton ) &&
!( keyevent->state() & AltButton ) &&
!( keyevent->state() & MetaButton ) ||
( ( (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())
removeSelection();
@@ -1531,7 +1533,7 @@ void KafkaWidget::keyBackspace()
emit domNodeModified(temp, m_modifs);
if(boolTmp)
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
}
}
@@ -1597,7 +1599,7 @@ void KafkaWidget::keyBackspace()
{
m_currentNode = _nodePrev;
d->m_cursorOffset += (static_cast<DOM::CharacterData>(_nodePrev)).length();
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
}
_nodePrev.setNodeValue(_nodePrev.nodeValue() + _node.nodeValue());
emit domNodeModified(_nodePrev, m_modifs);
@@ -1618,7 +1620,7 @@ void KafkaWidget::keyBackspace()
m_currentNode = m_currentNode.previousSibling();
d->m_cursorOffset = 0;
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
}
else if(!m_currentNode.nextSibling().isNull())
{
@@ -2088,7 +2090,7 @@ void KafkaWidget::setCurrentNode(DOM::Node node, int offset)
d->m_cursorOffset = offset;
makeCursorVisible();
if(!m_currentNode.isNull() && m_currentNode.nodeName().string() != "#document")
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
//setCaretPosition(m_currentNode, (long)d->m_cursorOffset);
}
@@ -2139,7 +2141,7 @@ void KafkaWidget::putCursorAtFirstAvailableLocation()
}
m_currentNode = node;
d->m_cursorOffset = 0;
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
#ifdef LIGHT_DEBUG
@@ -2236,7 +2238,7 @@ void KafkaWidget::removeSelection()
setCurrentNode(m_currentNode, domNodeCursorOffset);
- TQTimer::singleShot(0, this, TQT_SLOT(slotDelayedSetCaretPosition()));
+ TQTimer::singleShot(0, this, TQ_SLOT(slotDelayedSetCaretPosition()));
NodeSelection* cursorPos = new NodeSelection();
cursorPos->setCursorNode(cursorNode);
@@ -2261,7 +2263,7 @@ void KafkaWidget::applyQueuedToggableTagActions()
{
if(tag_action->name() == *it)
{
- tag_action->slotActionActivated(TDEAction::EmulatedActivation, Qt::NoButton);
+ tag_action->slotActionActivated(TDEAction::EmulatedActivation, TQt::NoButton);
break;
}
}