Results 1 to 3 of 3

Thread: QT3-getOpenFileName() "Look in:" Dropdown dialog not staying down + TempWmicBatchFile

  1. #1
    Join Date
    Jul 2010
    Posts
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default QT3-getOpenFileName() "Look in:" Dropdown dialog not staying down + TempWmicBatchFile

    I have a piece of QT3 Software.
    All of the Open File dialogs are affected by this bug/behavior. All other SW on the machine does not have this behavior.

    When I call "QFileDialog::getOpenFileName()" it brings up the native windows file dialog as expected. Notice the dropdown at the top labeled "Look in:" that shows the directory tree. Once I navigate to "Desktop" or "My Documents" I can not keep this dropdown to stay open. It closes on me within 2-3 seconds, repeatably -- rendering it useless and annoying.
    I've also noticed that a empty file named "TempWmicBatchFile.bat" gets left behind in each directory I navigate to. While in a directory, this "TempWmicBatchFile.bat" is updated with a new timestamp (or deleted newly generated?) every few seconds.

    I have no idea how to go about fixing this. Any thoughts?
    Using the windows system calls and the "OPENFILENAME ofn" struct instead of the Qt call results in the same problem. Qt3's own QFileDialog works just fine and will be used if I can't find a solution, I just don't like the look/feel of it.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QT3-getOpenFileName() "Look in:" Dropdown dialog not staying down + TempWmicBatch

    TempWmicBatchFile.bat is created by WMIC (Windows Management Instrumentation Command-line). You should be able to delete such files without problems.

    "Desktop" and "My Documents" require OLE typically and function strangely if it isn't already initialised. Maybe a call to "::OleInitialize(NULL);" in your main code will help?

  3. #3
    Join Date
    Jul 2010
    Posts
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QT3-getOpenFileName() "Look in:" Dropdown dialog not staying down + TempWmicBatch

    So I went ahead and tried adding the "::OleInitialize(NULL)" as well as "::OleUninitialize()", once to the main portion of code, and then right before the dialog. None of the combinations I tried seemed to have an effect.

    I did notice that once the "TempWmicBatchFile.bat" is created, if I set it to ReadOnly permissions, it solves the problem -- the dropdown stays down. So I think it has something to do with the fact the batch file is being updated. Maybe the drop down wants to refresh when it notices changes? Is there someway to suppress or solve the creation/deletion of this file?
    Note that if I delete the file, it is created again if I'm still browsing that directory.

Similar Threads

  1. Replies: 1
    Last Post: 7th April 2010, 22:46
  2. Replies: 3
    Last Post: 15th February 2010, 18:27
  3. Replies: 3
    Last Post: 8th July 2008, 20:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 16:58

Tags for this Thread

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.