Results 1 to 2 of 2

Thread: Canceling the getOpenFileName native dialog

  1. #1
    Join Date
    Aug 2006
    Location
    Madison, WI USA
    Posts
    153
    Thanks
    35
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Question Canceling the getOpenFileName native dialog

    I have an app that was using 4.4.2 that I just moved to 4.5.2. I now have a problem using the QFileDialog::getOpenFileName() static method when canceling the dialog.

    On my QMainWindow, my app has a QTabWidget. A tab contains 2 QGroupBox objects. Each QGroupBox contains a QTableWidget object.

    Using the Windows native dialog version:
    Qt Code:
    1. sFilePath = QFileDialog::getOpenFileName( m_parent,
    2. “Open File”,
    3. m_parent->m_sCurrDir,
    4. “Filter (*.*)” );
    To copy to clipboard, switch view to plain text mode 
    When the dialog is closed using the close button the contents of each QTableWidget goes away. Clicking on an area which previously contained a table row entry or header will cause a portion of the table contents to be redrawn. Minimizing and then bring the app back up will redraw everything as it should be.

    Using the Qt dialog version:
    Qt Code:
    1. sFilePath = QFileDialog::getOpenFileName( m_parent,
    2. “Open File”,
    3. m_parent->m_sCurrDir,
    4. “Filter (*.*)”,
    5. 0, QFileDialog::DontUseNativeDialog );
    To copy to clipboard, switch view to plain text mode 
    This causes a similar result except the tables are redraw automatically. By that, I mean that I can see the contents go away as the dialog is going away but the table contents are immediately redrawn (unlike the Windows native dialog which never automatically redraws). I would just use the Qt native version except it takes longer than a second to fill the dialog with files from a 75 entry directory. This seems way too long.

    Has anyone else seen this (I haven’t been able to find mention of this on the Troll's Task Tracker)?

    If so, has anyone found a way to fix this (I've tried update() and repaint() and neither change the result)?

  2. #2
    Join Date
    Aug 2006
    Location
    Madison, WI USA
    Posts
    153
    Thanks
    35
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Canceling the getOpenFileName native dialog

    From the Trolls TaskTracker (entered on 26.Jun.09):

    257004 - [REG] Painting issues when a modal dialog, which has a dialog as its parent which is parented to another window, is shown

    Description: When a modal dialog is shown which has a dialog as its parent which is parented to another window then it has painting issues. This happens when a QTabWidget in the main window (which the first dialog is parented to) has a QTableWidget in it. If the tabs have been changed and then the dialog shown, the table widget is not painted until the dialogs are closed.

    This is a regression from Qt 4.4.3.

Similar Threads

  1. Issue with Modelless dialog on Mac
    By Satyanarayana Chebrolu in forum Qt Programming
    Replies: 0
    Last Post: 24th February 2009, 10:10
  2. Replies: 2
    Last Post: 4th February 2008, 11:00
  3. Open/Save dialog with images preview
    By mchara in forum Qt Programming
    Replies: 8
    Last Post: 5th November 2007, 07:25
  4. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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.