PDA

View Full Version : QFileDialog::getOpenFileName() gets stucked



elcuco
26th March 2006, 23:11
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:



QString s = "Images (*.png *.jpg *.jpeg *.bmp *.gif *.pnm *.xpm)";
QString s1 = QFileDialog::getOpenFileName(
NULL,
"Choose a scanned (300dpi) image",
"",
s );

if (s1.isEmpty())
return;


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?

jacek
26th March 2006, 23:25
Maybe it's this problem (http://www.trolltech.com/developer/tasktracker.html?method=entry&id=97304)?

elcuco
27th March 2006, 08:22
could be, but i get the same problem even when i search for "*". i will upgrade to qt4.1.1 (or 2?) and retest.

elcuco
28th March 2006, 18:21
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:


QString s = QFileDialog::getOpenFileName(
NULL,
tr("Choose a scanned (300dpi) image"),
QDir::home().path(),
tr("Images (*.png *.jpg *.jpeg *.bmp *.gif *.pnm *.xpm)"),
NULL,
QFileDialog::DontUseNativeDialog
);


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

jpn
28th March 2006, 18:50
Just to mention, the code in the first post works fine on my WinXP+SP2 with Qt 4.1.1..

elcuco
28th March 2006, 23:09
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).