I have to get an IP address so I have four QLineEdit input box like this:

Qt Code:
  1. [ ] . [ ] . [ ] . [ ]
To copy to clipboard, switch view to plain text mode 

I can insert the first number in hte first QLineEdit (mylineEditGetAddressIP_A) and I can go to the second by pressing the tab key. My goal is to skip to the next lineedit also when I press the "." key.

This is my not working code:

(dialog object header):
Qt Code:
  1. [...]
  2. private:
  3. bool eventFilter ( QObject * , QEvent * );
  4. [...]
To copy to clipboard, switch view to plain text mode 

(dialog object c++ code):
Qt Code:
  1. [...]
  2. mylineEditGetAddressIP_A->installEventFilter(this);
  3. [...]
  4. bool dialogGetAddressObject::eventFilter ( QObject *object , QEvent *event )
  5. {
  6. if (event->type() == QEvent::KeyPress)
  7. {
  8. QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
  9. if ( keyEvent->key() == Qt::Key_Period )
  10. {
  11. qDebug () << "Event: Qt::Key_Period - Insert Qt::Key_Tab event...";
  12. QKeyEvent * myKeyEvent = new QKeyEvent ( QEvent::KeyPress , Qt::Key_Tab , Qt::NoModifier, 0);
  13. QWidget::keyPressEvent ( myKeyEvent );
  14. return true;
  15. }
  16. }
  17. return false;
  18. }
  19. [...]
To copy to clipboard, switch view to plain text mode 

where is my mistake?
thanks,
the_bis