Results 1 to 6 of 6

Thread: QFileDialog::getOpenFileName() gets stucked

  1. #1
    Join Date
    Jan 2006
    Posts
    369
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QFileDialog::getOpenFileName() gets stucked

    Ok, this is wierd, but some application which works PERFECTLY on Linux, does not run on win32. The linux system is OpenSUSE 10 qt-rsync, and on Windows it's mingw4 on XP Qt 4.1.0 (from the released binaries).

    The code which gets stucked is:

    Qt Code:
    1. QString s = "Images (*.png *.jpg *.jpeg *.bmp *.gif *.pnm *.xpm)";
    2. QString s1 = QFileDialog::getOpenFileName(
    3. NULL,
    4. "Choose a scanned (300dpi) image",
    5. "",
    6. s );
    7.  
    8. if (s1.isEmpty())
    9. return;
    To copy to clipboard, switch view to plain text mode 

    When I choose a file in the getOpenFileName, the application gets stucked. If I cancel, it works. The same code on a save functions works. Copying the code from the save routine gets the same effect (applicatino gets stucked).

    Any ideas how to debug such thing?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog::getOpenFileName() gets stucked

    Maybe it's this problem?

  3. #3
    Join Date
    Jan 2006
    Posts
    369
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog::getOpenFileName() gets stucked

    could be, but i get the same problem even when i search for "*". i will upgrade to qt4.1.1 (or 2?) and retest.

  4. #4
    Join Date
    Jan 2006
    Posts
    369
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog::getOpenFileName() gets stucked

    Jusi to bump this up, still no go. The code works perfectly on Linux but gets killed on Win32.

    Eventuall I have this code, which seems to work:
    Qt Code:
    1. QString s = QFileDialog::getOpenFileName(
    2. NULL,
    3. tr("Choose a scanned (300dpi) image"),
    4. QDir::home().path(),
    5. tr("Images (*.png *.jpg *.jpeg *.bmp *.gif *.pnm *.xpm)"),
    6. NULL,
    7. QFileDialog::DontUseNativeDialog
    8. );
    To copy to clipboard, switch view to plain text mode 

    Not optimal, but what the hell... I think I will report this to the trolls, as it seems a bug in win32's version of Qt 4.1.1

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QFileDialog::getOpenFileName() gets stucked

    Just to mention, the code in the first post works fine on my WinXP+SP2 with Qt 4.1.1..

  6. #6
    Join Date
    Jan 2006
    Posts
    369
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog::getOpenFileName() gets stucked

    also for me in other projects... this why it's so wierd.

    I will post a link to the full code when I release it, maybe more eyes will be able to see the problem (the applicaiton is an GUI for a hebrew OCR library, google for hocr if you want more info).

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.