[mythtv] MythPopupBox losing focus
Tako Schotanus
quintesse at palacio-cristal.com
Tue Oct 7 16:50:46 EDT 2003
Just to re-iterate part of the reply I sent to this question earlier
when he first sent this message to me personally:
"I know the problem you are talking about and I have experienced this
behaviour myself. I saw some code somewhere that fixed it by grabbing
the keyboard input exclusively for itself, but I have no idea if that
will work in your situation. The problem is that although I made some
changes to the MythPopupBox (like adding the addLabel() and addButton()
functions) the original code is not mine and I still don't know enough
about MythTV yet to know why the MythPopupBox does this is some
situations and works okay in others."
And to add a little bit more info: I encountered the same problem in
some screens when I tried to implement menus for all possible actions in
all the screens. I know that the code in Myth2ButtonPopup for example
just grabs the keyboard for itself and does its own focus handling to
prevent this problem from occurring.
I did look into it for a while, but I have no idea why this happens (I
hardly know anything about Qt).
Cheers,
-Tako
> -----Original Message-----
> From: mythtv-dev-bounces at mythtv.org
> [mailto:mythtv-dev-bounces at mythtv.org] On Behalf Of Philippe C.Cattin
> Sent: dinsdag 7 oktober 2003 15:31
> To: mythtv-dev at mythtv.org
> Subject: [mythtv] MythPopupBox losing focus
>
>
> Hi,
>
> I'm planing to use MythPopupBox for a popupmenu in mythbrowser to add
> functionality (Back, NextTab, Mouse Emulation Mode, Save Link in
> Bookmarks...) to the browser without wasting additional keys.
> However, I
> noticed that the popupbox sometimes loses focus and returns it to its
> parent! Below you find a short example to explain the problem in more
> detail:
>
> menu = new MythPopupBox(this,"Menu");
> menu->addLabel("MythBrowser Menu");
>
> QButton *temp =
> menu->addButton(tr(" Next Tab "), this, SLOT(actionNextTab()));
> menu->addButton(tr(" Back "), this, SLOT(actionBack()));
> temp->setFocus();
> menu->ShowPopup(this,SLOT(cancelMenu()));
>
> this code shows a popupbox with two buttons whereas the first
> one (Next
> Tab) is already highlighted. however, if I press 'cursor up' while
> on 'NextTab' and 'cursor down' while on 'Back' respectively the
> selection bar vanishes from the popupmenu (and focus goes back to the
> browser behind the menu).
>
> I checked-out MythPopupBox source code but couldn't find the problem.
> any hints?
>
> regards, Philippe
>
> --
> Philippe C. Cattin
> cattin at vision.ee.ethz.ch
> Swiss Federal Institute of Technology, ETHZ Tel:
> +41-1-632 25 29
> Computer Vision Laboratory, CH-8092 Zuerich Fax:
> +41-1-632 11 99
>
>
>
More information about the mythtv-dev
mailing list