Results 1 to 2 of 2

Thread: strange behavior with QFileDialog::getExistingDirectory

  1. #1
    Join Date
    Jan 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: strange behavior with QFileDialog::getExistingDirectory

    Hi,

    i just was updating a Qt Application of our company and during testing i found some strange behaviour with QFileDialog::getExistingDirectory. This always worked correct but now i get an empty dialog containing only the title message and the buttons. The folder selection list has gone and i have no clue why. We are using Qt 4.7.4 and the application (as also Qt) is x64. I attached a screenshot of the dialog that opens and here the code. Normally i would say that you cannot make any mistakes using this function. As it has worked before and i did not changed anything in this class i'm wondering whats the problem.

    Qt Code:
    1. if (qsFolder.isEmpty())
    2. qsFolder = pValue->getDefault().toString();
    3. qsFolder = QDir::fromNativeSeparators(qsFolder);
    4. qsFolder = QFileDialog::getExistingDirectory(this, "Select capture folder", qsFolder);
    5. qsFolder = QDir::toNativeSeparators(qsFolder);
    To copy to clipboard, switch view to plain text mode 

    Any help is appreciated.
    Bye


    SOLVED:
    Well i found the reason in the msdn:
    If COM is initialized using CoInitializeEx with the COINIT_MULTITHREADED flag, SHBrowseForFolder fails if the calling application uses the BIF_USENEWUI or BIF_NEWDIALOGSTYLE flag in the BROWSEINFO structure.
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    Sorry for bothering you
    Thx
    Attached Images Attached Images
    Last edited by cemoktra; 19th January 2012 at 12:13.

  2. #2
    Join Date
    May 2013
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: strange behavior with QFileDialog::getExistingDirectory

    I have exactly the same problem. How ca I fix it woithout changuing the qt sourcecode?

Similar Threads

  1. Replies: 2
    Last Post: 28th December 2010, 06:20
  2. Replies: 0
    Last Post: 31st March 2010, 12:40
  3. Replies: 2
    Last Post: 16th April 2009, 07:51
  4. QComboBox strange behavior
    By Antebios in forum Newbie
    Replies: 2
    Last Post: 31st March 2009, 23:50
  5. scrollbars strange behavior
    By siniy in forum Qt Programming
    Replies: 6
    Last Post: 29th December 2006, 10:27

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.