PDA

View Full Version : Native QFileDialog block



Darktib
6th November 2008, 22:02
Hello,

In the software I'm developping i need to open and save files. The problem is that when i use native QFileDialog (with static functions like QFileDialog::getOpenFileName() ) i can only specify a file that is in the directory in which the dialog was opened... If i want to change current folder (double-clicking on a directory, other buttons, etc...) the dialog become blocked and the only way to close the app is to use the task manager:(...

I don't know how to fix this bug because it's apparently in the static functions of QFileDialog.

Please note that i use QT 4.4.0

Could someone help me ?

Thank you in advance.

Darktib
7th November 2008, 18:21
Anybody has an idea?

Here is some informations i found:

the module which crashes is named 'hungapp'. The crash is present on all computers i have tested - and apparently not because of a virus.
I cannot use debugger because de native file dialog get stuck when in this dialog i want to change current folder...

I have searched the forum but haven't found a solution...

Darktib
8th November 2008, 15:00
I've searched again, and now i think there is a problem with the hook qt makes.
But always no solutions...

Please help it's very important

Darktib
10th November 2008, 22:13
Up.

I retested with Qt Creator (and Qt 4.4.3) and when i try to change folder it works but a half-second later i have a lot of
warnig : QFile::seek: QIODevice is not open

in the output zone...

I really don't understand anything...

pastor
11th November 2008, 09:39
I think, you should report to Trolltech about that issue:

http://trolltech.com/bugreport-form

Darktib
11th November 2008, 16:32
I send the bug.

But if anyone has an idea it would be very useful. I have tested many things - but always without results...

kyosold
23rd December 2008, 10:52
I was appear it, but I found that my code include some pic , it not resource , it is seem as:

QMovie *movie = new QMovie("images/flower.gif");

and then I use: QFileDialog::getOpenFileName and appear :

QFile::seek: IODevice is not open
QFile::seek: IODevice is not open
QFile::seek: IODevice is not open
QFile::seek: IODevice is not open

and program is dead;


so I changed it as resource:

QMovie *movie = new QMovie(":/images/flower.gif");

it succ

mail to me: kyosold@qq.com

Darktib
27th December 2008, 17:07
Thank you very much !

I will test this (I think that it could be the right solution because I use QMovie too...)

Darktib
28th December 2008, 19:26
OK, I have tested, and I found why there was this bug. In fact, QMovie loads a frame everytime the current frame change, because by default QMovie does not cache the data.

By setting setCacheMode(QMovie::CacheAll) the bug disappear.

kyosold
30th December 2008, 02:56
OK, I had learn it, thanks :)