Results 1 to 2 of 2

Thread: focus issue

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default focus issue

    Dear folks,

    I have several threads running in sequence, each thread creates new QDialog object, and
    closes/hides this dialog object when thread finishes.

    Each time a QDialog object is created and displayed by thread, this dialog object takes away editing 'focus' from me/user.

    e.g., 10 threads are running, and at same time I am editing a document. It interrupts me 9
    times. I have to grab focus back from QDialog 9 times while I am editing, and it is very annoying. I don't want QDialog to take away focus from me while I am editing.

    I looked at some previous discussions and tried to set focusPolicy as
    setFocusPolicy(qt.QWidget.ClickFocus)

    such that, QDialog widow/widget should grab focus only when I click this widget otherwise not. However, it does not work. I don't know why.

    regards,

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: focus issue

    First of all, you must not create widgets from other threads. There are other ways to do this - have the worker threads tell the GUI thread create them.

    Second of all, if the dialogs are not modal, you can create an event filter for them and when they become visible, you transfer the focus to your widget.

Similar Threads

  1. Focus issues / Setting multiple focus
    By ComputerPhreak in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2007, 06:09
  2. Tab/Enter focus problem
    By b1 in forum Qt Programming
    Replies: 4
    Last Post: 23rd October 2006, 23:34
  3. Replies: 3
    Last Post: 26th September 2006, 12:16
  4. Replies: 2
    Last Post: 24th July 2006, 18:36
  5. focusOut- event issue
    By gunhelstr in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2006, 08:02

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
  •  
Qt is a trademark of The Qt Company.