[mythtv] MythPopupBox losing focus
cattin at vision.ee.ethz.ch
Thu Oct 9 16:40:55 EDT 2003
> The best thing to do would be to have MythPopupBox (or MythDialog, really)
> make its own focusNextPrevChild() method to override the default QWidget one.
> That way, it can restrict focus to the popup box's own children, and not pass
> the decision of what to move focus to up the widget tree. I'll look into
> doing this if no one else manages to get to it by the weekend.
okay, I have a solution that does the job for MythPopupBox. It
dynamically generates a QPtrList with the QButton widgets we possible
want to cycle through (thus ignoring QLabels and stuff).
However, in case of MythDialog there are more widgets that can have
user interaction. But what widgets should I check for??? Or should I
cycle through all the widgets exept QLabel,...???
Is there a better solution than the dynamic_cast hack to find out
what kind of widget I'm dealing with?
### ### ###
bool MythPopupBox::focusNextPrevChild(bool next)
// Recursively generate list of all children
QObjectList *l = queryList(NULL,NULL,false,true);
QObjectListIt it(*l); // iterate over all the children
// Generate list of all widgets we want to cycle through
widgetList = new QPtrList<QWidget>();
while ((objs = it.current()) != 0)
QWidget *widget = (QWidget *)objs;
delete l; // delete the list, not the objects
More information about the mythtv-dev