|
|
@ -642,7 +642,7 @@ bool RenderWidget::eventFilter(TQObject* /*o*/, TQEvent* e)
|
|
|
|
|
|
|
|
|
|
|
|
// Don't count popup as a valid reason for losing the focus
|
|
|
|
// Don't count popup as a valid reason for losing the focus
|
|
|
|
// (example: opening the options of a select combobox shouldn't emit onblur)
|
|
|
|
// (example: opening the options of a select combobox shouldn't emit onblur)
|
|
|
|
if ( TQT_TQFOCUSEVENT(e)->reason() != TQFocusEvent::Popup )
|
|
|
|
if ( static_cast<TQFocusEvent*>(e)->reason() != TQFocusEvent::Popup )
|
|
|
|
handleFocusOut();
|
|
|
|
handleFocusOut();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::FocusIn:
|
|
|
|
case TQEvent::FocusIn:
|
|
|
@ -663,7 +663,7 @@ bool RenderWidget::eventFilter(TQObject* /*o*/, TQEvent* e)
|
|
|
|
case TQEvent::KeyRelease:
|
|
|
|
case TQEvent::KeyRelease:
|
|
|
|
// TODO this seems wrong - Qt events are not correctly translated to DOM ones,
|
|
|
|
// TODO this seems wrong - Qt events are not correctly translated to DOM ones,
|
|
|
|
// like in TDEHTMLView::dispatchKeyEvent()
|
|
|
|
// like in TDEHTMLView::dispatchKeyEvent()
|
|
|
|
if (element()->dispatchKeyEvent(TQT_TQKEYEVENT(e),false))
|
|
|
|
if (element()->dispatchKeyEvent(static_cast<TQKeyEvent*>(e),false))
|
|
|
|
filtered = true;
|
|
|
|
filtered = true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -674,7 +674,7 @@ bool RenderWidget::eventFilter(TQObject* /*o*/, TQEvent* e)
|
|
|
|
// or something while wheeling a webpage.
|
|
|
|
// or something while wheeling a webpage.
|
|
|
|
if (tqApp->focusWidget() != widget() &&
|
|
|
|
if (tqApp->focusWidget() != widget() &&
|
|
|
|
widget()->focusPolicy() <= TQWidget::StrongFocus) {
|
|
|
|
widget()->focusPolicy() <= TQWidget::StrongFocus) {
|
|
|
|
TQT_TQWHEELEVENT(e)->ignore();
|
|
|
|
static_cast<TQWheelEvent*>(e)->ignore();
|
|
|
|
TQApplication::sendEvent(view(), e);
|
|
|
|
TQApplication::sendEvent(view(), e);
|
|
|
|
filtered = true;
|
|
|
|
filtered = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -697,22 +697,22 @@ bool RenderWidget::eventFilter(TQObject* /*o*/, TQEvent* e)
|
|
|
|
void RenderWidget::EventPropagator::sendEvent(TQEvent *e) {
|
|
|
|
void RenderWidget::EventPropagator::sendEvent(TQEvent *e) {
|
|
|
|
switch(e->type()) {
|
|
|
|
switch(e->type()) {
|
|
|
|
case TQEvent::MouseButtonPress:
|
|
|
|
case TQEvent::MouseButtonPress:
|
|
|
|
mousePressEvent(TQT_TQMOUSEEVENT(e));
|
|
|
|
mousePressEvent(static_cast<TQMouseEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::MouseButtonRelease:
|
|
|
|
case TQEvent::MouseButtonRelease:
|
|
|
|
mouseReleaseEvent(TQT_TQMOUSEEVENT(e));
|
|
|
|
mouseReleaseEvent(static_cast<TQMouseEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::MouseButtonDblClick:
|
|
|
|
case TQEvent::MouseButtonDblClick:
|
|
|
|
mouseDoubleClickEvent(TQT_TQMOUSEEVENT(e));
|
|
|
|
mouseDoubleClickEvent(static_cast<TQMouseEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::MouseMove:
|
|
|
|
case TQEvent::MouseMove:
|
|
|
|
mouseMoveEvent(TQT_TQMOUSEEVENT(e));
|
|
|
|
mouseMoveEvent(static_cast<TQMouseEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::KeyPress:
|
|
|
|
case TQEvent::KeyPress:
|
|
|
|
keyPressEvent(TQT_TQKEYEVENT(e));
|
|
|
|
keyPressEvent(static_cast<TQKeyEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::KeyRelease:
|
|
|
|
case TQEvent::KeyRelease:
|
|
|
|
keyReleaseEvent(TQT_TQKEYEVENT(e));
|
|
|
|
keyReleaseEvent(static_cast<TQKeyEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -722,22 +722,22 @@ void RenderWidget::EventPropagator::sendEvent(TQEvent *e) {
|
|
|
|
void RenderWidget::ScrollViewEventPropagator::sendEvent(TQEvent *e) {
|
|
|
|
void RenderWidget::ScrollViewEventPropagator::sendEvent(TQEvent *e) {
|
|
|
|
switch(e->type()) {
|
|
|
|
switch(e->type()) {
|
|
|
|
case TQEvent::MouseButtonPress:
|
|
|
|
case TQEvent::MouseButtonPress:
|
|
|
|
viewportMousePressEvent(TQT_TQMOUSEEVENT(e));
|
|
|
|
viewportMousePressEvent(static_cast<TQMouseEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::MouseButtonRelease:
|
|
|
|
case TQEvent::MouseButtonRelease:
|
|
|
|
viewportMouseReleaseEvent(TQT_TQMOUSEEVENT(e));
|
|
|
|
viewportMouseReleaseEvent(static_cast<TQMouseEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::MouseButtonDblClick:
|
|
|
|
case TQEvent::MouseButtonDblClick:
|
|
|
|
viewportMouseDoubleClickEvent(TQT_TQMOUSEEVENT(e));
|
|
|
|
viewportMouseDoubleClickEvent(static_cast<TQMouseEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::MouseMove:
|
|
|
|
case TQEvent::MouseMove:
|
|
|
|
viewportMouseMoveEvent(TQT_TQMOUSEEVENT(e));
|
|
|
|
viewportMouseMoveEvent(static_cast<TQMouseEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::KeyPress:
|
|
|
|
case TQEvent::KeyPress:
|
|
|
|
keyPressEvent(TQT_TQKEYEVENT(e));
|
|
|
|
keyPressEvent(static_cast<TQKeyEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::KeyRelease:
|
|
|
|
case TQEvent::KeyRelease:
|
|
|
|
keyReleaseEvent(TQT_TQKEYEVENT(e));
|
|
|
|
keyReleaseEvent(static_cast<TQKeyEvent*>(e));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -811,9 +811,9 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev)
|
|
|
|
TQMouseEvent e(type, p, button, state);
|
|
|
|
TQMouseEvent e(type, p, button, state);
|
|
|
|
TQScrollView * sc = ::tqt_cast<TQScrollView*>(m_widget);
|
|
|
|
TQScrollView * sc = ::tqt_cast<TQScrollView*>(m_widget);
|
|
|
|
if (sc && !::tqt_cast<TQListBox*>(m_widget))
|
|
|
|
if (sc && !::tqt_cast<TQListBox*>(m_widget))
|
|
|
|
static_cast<ScrollViewEventPropagator *>(sc)->sendEvent(TQT_TQEVENT(&e));
|
|
|
|
static_cast<ScrollViewEventPropagator *>(sc)->sendEvent(static_cast<TQEvent*>(&e));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
static_cast<EventPropagator *>(m_widget)->sendEvent(TQT_TQEVENT(&e));
|
|
|
|
static_cast<EventPropagator *>(m_widget)->sendEvent(static_cast<TQEvent*>(&e));
|
|
|
|
ret = e.isAccepted();
|
|
|
|
ret = e.isAccepted();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -827,7 +827,7 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev)
|
|
|
|
if (domKeyEv.isSynthetic() && !acceptsSyntheticEvents()) break;
|
|
|
|
if (domKeyEv.isSynthetic() && !acceptsSyntheticEvents()) break;
|
|
|
|
|
|
|
|
|
|
|
|
TQKeyEvent* const ke = domKeyEv.qKeyEvent();
|
|
|
|
TQKeyEvent* const ke = domKeyEv.qKeyEvent();
|
|
|
|
static_cast<EventPropagator *>(m_widget)->sendEvent(TQT_TQEVENT(ke));
|
|
|
|
static_cast<EventPropagator *>(m_widget)->sendEvent(static_cast<TQEvent*>(ke));
|
|
|
|
ret = ke->isAccepted();
|
|
|
|
ret = ke->isAccepted();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -854,9 +854,9 @@ bool RenderWidget::handleEvent(const DOM::EventImpl& ev)
|
|
|
|
if (ke->isAutoRepeat()) {
|
|
|
|
if (ke->isAutoRepeat()) {
|
|
|
|
TQKeyEvent releaseEv( TQEvent::KeyRelease, ke->key(), ke->ascii(), ke->state(),
|
|
|
|
TQKeyEvent releaseEv( TQEvent::KeyRelease, ke->key(), ke->ascii(), ke->state(),
|
|
|
|
ke->text(), ke->isAutoRepeat(), ke->count() );
|
|
|
|
ke->text(), ke->isAutoRepeat(), ke->count() );
|
|
|
|
static_cast<EventPropagator *>(m_widget)->sendEvent(TQT_TQEVENT(&releaseEv));
|
|
|
|
static_cast<EventPropagator *>(m_widget)->sendEvent(static_cast<TQEvent*>(&releaseEv));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
static_cast<EventPropagator *>(m_widget)->sendEvent(TQT_TQEVENT(ke));
|
|
|
|
static_cast<EventPropagator *>(m_widget)->sendEvent(static_cast<TQEvent*>(ke));
|
|
|
|
ret = ke->isAccepted();
|
|
|
|
ret = ke->isAccepted();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|