Results 1 to 2 of 2

Thread: Focus or update problem in modal QDialog

  1. #1
    Join Date
    Nov 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Focus or update problem in modal QDialog

    I have a QDialog class with several child widgets, such as radio buttons, line edits etc. I create the dialog from a QMainWindow by calling its exec function. However, most of the time the dialog does not seem to be updated correctly. The child widgets does not behave as expected, in particular I am not able to tab switch between the child widgets and when I type something in a line edit, the text does not show until the line edit loses focus. When I create and close the dialog multiple times in a row, the strange behavior happens maybe about half the time, the rest of the time it behaves completely normally. There seems to be no predictable order when it behaves ok and when it does not.

    I initially thought it was a focus problem, but now I rather believe it is a problem of updating/redrawing the dialog. It seems to me that the dialog behaves functionally as it should, but that the widgets are only updated visually when they lose focus. Is there a way to control this in Qt? Any ideas on what could be the problem? I am particularly confused because of the irregular occurrence of the problem.

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Focus or update problem in modal QDialog

    What plattform are you using? From your header I see that you are using both X11 and Windows. Does this behaviour happen on both plattforms?
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. Modal QDialog inside QMdiArea
    By Nesbitt in forum Qt Programming
    Replies: 1
    Last Post: 17th March 2009, 09:21
  2. Problem with modal QProgressDialog
    By esterbonmati in forum Qt Programming
    Replies: 1
    Last Post: 15th January 2009, 11:59
  3. QDialog derived and focus problem
    By elm66 in forum Qt Programming
    Replies: 1
    Last Post: 4th April 2008, 21:52
  4. Replies: 5
    Last Post: 18th April 2007, 10:29
  5. QDialog::exec() cereates no modal dialog
    By sboesch in forum Qt Programming
    Replies: 8
    Last Post: 27th March 2006, 17:03

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.