[Qt-interest] [Fwd: AW: [Fwd: [Fwd: Problem with focusNextChild andQPlainTextEdit]]]

Stefano Rosellini s.rosellini at iv-srl.it
Fri Mar 27 11:53:40 CET 2009


Private message reported to mailing list.

-------- Messaggio Originale --------

Hello.

You are calling the focusNextChild() method of QPlainTextEdit. Shouldn't it be the focusNextChild() from the text edit's parent (the window)? Because the text edit doesn't have any child widgets I suppose and that's why focus changing fails. Although that doesn't explain why it works with QLineEdit :)

Hope it helps.
 Andreas

-----Ursprüngliche Nachricht-----
Von: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] Im Auftrag von Stefano Rosellini
Gesendet: Freitag, 27. März 2009 10:58
An: QT Mailing LIST
Betreff: [Qt-interest] [Fwd: [Fwd: Problem with focusNextChild andQPlainTextEdit]]

Last call for help... Really no one?!?

I suspect that problem is about the tab key but I haven't found any simple solution.


--- Original message ---

No one?

--- Original message ---

If I use focusNextChild on a QLineEdit, it works, but on QPlainTextEdit the focus remain on this widget. Does someone know why?

I used this overload for keyPressEvent (that works perfectly for QLineEdit).

void PEditorWidget::keyPressEvent(QKeyEvent *event) {
  if (event->key()==Qt::Key_F8) {
    focusNextChild();
    return;
  }
  QPlainTextEdit::keyPressEvent(event);
}


Thanks.

Stefano Rosellini
Informatica Valdinievole

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



--
Stefano Rosellini
Informatica Valdinievole

_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
--
Mit freundlichen Grüßen
Andreas Diehl 
 
-------------------------- ABS -------------------------
ABS Systemberatung OHG          Tel: +49 (0)7053/9290-03
Hauffstr. 9                     Fax: +49 (0)7053/9290-
D-75385 Bad Teinach-Zavelstein        http://www.abs.org
Registergericht Calw HRA 1031
[mailto:Andreas_Diehl at abs.org]
 
----- Loesungen fuer den Maschinen- und Anlagenbau -----




-- 
Stefano Rosellini
Informatica Valdinievole




More information about the Qt-interest-old mailing list