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

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


Ok. I understand your point of view, but I have 2 question.
1. Why if focusNextChild doesn't take care of scaling on parent widget? 
If I press Tab on the last element of a widget, the focus is normally 
recalculated scaling up to parent.
2. focusNextChild() is protected, so the only solutions seems to be the 
parent subclassing. If the initiative is of Q(Simple)TextEdit, how can 
set focus in general way indipendently from parent?

Stefano Rosellini
Informatica Valdinievole


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

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

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





More information about the Qt-interest-old mailing list