Results 1 to 8 of 8

Thread: i want to lose the focus...

  1. #1
    Join Date
    Jul 2007
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default i want to lose the focus...

    Hello everybody.

    Excuse my poor english, i´m a spanish qt4 user. my boss order my to do a simple thing, I need, when i click or use the alt-tab key in order to change the active window, that this window never get the focus. i repeat it: i need that 1 window never get the focus, though click on it.

    i hope to explain it correctly...

    thanks all in advance..

    Javier Rodway.

  2. #2
    Join Date
    Jul 2007
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: i want to lose the focus...

    plis..... i need a little help.... please...

  3. #3
    Join Date
    Aug 2006
    Posts
    44
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: i want to lose the focus...

    You should call QWidget::setFocusPolicy(Qt::NoFocus) on the widget when you create it..

  4. #4
    Join Date
    Jul 2007
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: i want to lose the focus...

    this doesn't works ok. it must be something related to control the events or similar...

    but i can't find the solution....

    (thanks anyway...)

    please, help me.....

  5. #5
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: i want to lose the focus...

    Why isn't it ok ?

    You want your widget to always stay behing every other window, that's it ?
    You should detail a little more what you want to achieve..

    A sample would be ideal too

  6. #6
    Join Date
    Jul 2007
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: i want to lose the focus...

    I've just achieved the window is always at bottom but the ALT+TAB key is pressed.

    How can I disable that function (ALT-TAB) for a single window?

    thanks!!

  7. #7
    Join Date
    Aug 2006
    Posts
    44
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: i want to lose the focus...

    Quote Originally Posted by jrodway View Post
    I've just achieved the window is always at bottom but the ALT+TAB key is pressed.

    How can I disable that function (ALT-TAB) for a single window?

    thanks!!
    You don't. While I haven't done *exactly* this kind of thing, I've got experience with similar kinds of z-plane manipulation using OS APIs directly (not Qt).

    In Windows, what you're wanting to do is manipulate where the window shows up in the Z-plane. Down in the guts of all of this, there is a message called WM_WINODWPOSCHANGING. By intercepting that message and modifying its data, you can try to manipulate what's happening, but you're in for a difficult fight with the operating system. The user has indicated, by ALT+TABbing to your window (or, if possible, choosing it from the taskbar), that they want your window to come to the front. You might be able to manipulate the data structure in that message to keep your window behind another window, but you may need some heavy-duty logic to figure out what that window is.

  8. #8
    Join Date
    Jul 2007
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: i want to lose the focus...

    i don't know how to continue testing the application.... i don't achieve to control the alt+tab...

    maybe under linux was impossible.....

Similar Threads

  1. Focus issues / Setting multiple focus
    By ComputerPhreak in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2007, 06:09
  2. QCanvas automatically lose its focus.
    By Cutey in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2007, 11:29
  3. MenuBar grabs focus on ALT pressed.
    By Cutey in forum Qt Programming
    Replies: 2
    Last Post: 9th January 2007, 11:45
  4. Tab/Enter focus problem
    By b1 in forum Qt Programming
    Replies: 4
    Last Post: 23rd October 2006, 23:34
  5. Replies: 3
    Last Post: 26th September 2006, 12:16

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.