Results 1 to 6 of 6

Thread: Clickable no focus window

  1. #1
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Clickable no focus window

    I am trying to implement a virtual remote control for my embedded arm 9 application. Focus on widgets can be changed using arrow keys on remote control, hence it seems best idea to post key events on qApp->focusWidget() but focus shifts to remote control as soon as I click on it.

    (1) I have made virtual remote control Ui with NoFocus policy but no help.
    (2) I tried activating the selected window first before posting key events from virtual remote control, but it always puts focus on first widget on that window.

    Is there anyway in Qt, I have virtual remote control window such a way that I can click on it, but focus/activation never shifts to it?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Clickable no focus window


  3. #3
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Clickable no focus window

    I tried, but no Help.

  4. #4
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Clickable no focus window

    I found a workaround for this by overriding event() for every UI screen in my application and resetting the focus to last focus widget on Activate event. This works, but is not a good design and a kind of hack. This also produces problems in case of controls like combo boxes, I can not select any value in combo box because it closes as soon as the focus is shifted to other window.
    The best solution to my prblem seems to have a clickable but no focus window, but I don't know how to do that with Qt. Any pointers are welcome.

  5. #5
    Join Date
    Feb 2011
    Posts
    4
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Clickable no focus window

    I know it's an old thread, but for people who come here via google in the future:

    To show a widget without stealing input focus from another do this:

    widget->setAttribute(Qt::WA_ShowWithoutActivating);

    I created a date editor lineedit descendant which created a frameless calendar widget next to it (setWindowFlags(Qt::FramelessWindowHint)). This works nicely.

  6. #6
    Join Date
    Sep 2013
    Location
    Yogyakarta, Indonesia
    Posts
    3
    Thanks
    6
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Clickable no focus window

    I have solution for this, in the case of creating chrome like tab in titlebar. Have a look at this SO page: http://stackoverflow.com/questions/2...in-window?lq=1

Similar Threads

  1. Window Focus Problem
    By waynew in forum Qt Programming
    Replies: 1
    Last Post: 6th May 2010, 14:34
  2. Window focus question
    By waynew in forum Newbie
    Replies: 3
    Last Post: 1st November 2009, 00:11
  3. How to show window without stealing focus?
    By piotr.dobrogost in forum Qt Programming
    Replies: 2
    Last Post: 9th June 2009, 07:26
  4. Window focus issues (How to force focus to a window?)
    By montylee in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2009, 02:00
  5. correct event for lose focus in a QGLWidget window
    By john_god in forum Qt Programming
    Replies: 4
    Last Post: 16th February 2009, 02:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.