#14 InputBinding patch

Next Minor Release
closed
5
2009-01-01
2008-12-07
No

In my context, when i redefine Event, i make this :
void keyPressEvent( QKeyEvent * event ) {
........
if( ..... )
return ;
.............
QTextEdit:::keyPressEvent( event );
.............
}

For QCodeEdit, i think to add an out method in InputBinding :

void XinxCodeEdit::mousePressEvent( QMouseEvent *event, QEditor * editor ) {
Q_UNUSED( editor );
...
}

void XinxCodeEdit::mousePressEventOut( QMouseEvent *event, QEditor * editor ) {
Q_UNUSED( editor );
if( ( event->type() == QEvent::MouseButtonPress ) && ( dynamic_cast<QMouseEvent*>( event )->button() == Qt::LeftButton ) && ( event->modifiers() == Qt::ControlModifier ) ) {
QMetaObject::invokeMethod( this, "searchWord", Qt::QueuedConnection, Q_ARG( QString, textUnderCursor( textCursor(), false ) ) );
}
}

What do you think of that ( see patch ) ?

Discussion

  • Patch for InputBinding

     
    Attachments
  • fullmetalcoder
    fullmetalcoder
    2008-12-08

    Makes a lot of sense, thanks for the remark.
    Instead of postfixing the event handler names with "Out" I prefer prefixing them with "post" but apart from that the changes I will soon commit to the trunk won't be different from what you requested.

     
  • fullmetalcoder
    fullmetalcoder
    2008-12-08

    • milestone: --> Next Minor Release
    • assigned_to: nobody --> fullmetalcoder
     
  • thanks

     
  • fullmetalcoder
    fullmetalcoder
    2009-01-01

    • status: open --> closed