PDA

View Full Version : Weird problem while porting from Qt3 to Qt4



vermarajeev
7th August 2007, 16:11
Hello,
I'm porting an application from qt3 to qt4 and in fact I'm almost done. The application works fine. I have unit tested each and every functionality and works fine for me.

Problem:
I want to send this application's exe to my friend to test. So I have sent these files to my friend:
1) application.exe
2) Qt3Support4.dll
3) QtCore4.dll
4) QtGui4.dll
5) QtNetwork4.dll
6) QtSql4.dll
7) QtXml4.dll

Now he reports me this:
His words:
START
-----------
I'm able to run the application but when I try to load any file in the pop up file dialog, the application crashes. I dont know why?
I followed these steps:
a) Click File->open
b) A dialog appears.
c) Then select a file and click 'Ok'.
d) Application crashes

Also, In step c), if I dont select any file and just click 'Cancel', still the application crashes.
I think the file dialog what appears doesnt work.
Are u sure you did unit testing?
-----------
END

Then I tried to check if I missed something. I ran the same exe with above mentioned dll. I t worked fine for me.

I'm unable to understand why the application crashes on my friends machine.
NOTE: My friend dont have Qt installed.

How can I solve the above problem? Is there any dll that is missing on my friends machine?

Thanks in advance

marcel
7th August 2007, 16:14
I don't know.
Maybe your friend has an older version of the libraries?

Could you post that code?. The one that handles the file dialog.
Maybe you have something in there that depends on something on your machine.

Anyway, QFileDialog falls back to the platform file dialog(s). Shouldn't be any problem exactly in the Qt file dialog implementation.

Regards

vermarajeev
8th August 2007, 04:20
Could you post that code?. The one that handles the file dialog.
Maybe you have something in there that depends on something on your machine.
Regards

Here is the code

void MainWindow::fileOpen()
{
saveBeforeOpening();
QTextCodec *codec = QTextCodec::codecForLocale();
QString fileName = codec->fromUnicode( QFileDialog::getOpenFileName(
this, QString::null, "*.syn;;*.r" ) );
if( fileName.isEmpty() )
{
emit explain( tr("Open file dialog cancelled") );
}
else
{
openFile( fileName );
}
}

marcel
8th August 2007, 05:19
Well:
1) Text what codecForLocale returns ( although it should never be NULL, maybe for some weird encoding ).

2) Double-check the slot connected to explain signal.

3).Double-check the openFile slot.

Regards

vermarajeev
8th August 2007, 07:51
Well:
1) Text what codecForLocale returns ( although it should never be NULL, maybe for some weird encoding ).

2) Double-check the slot connected to explain signal.

3).Double-check the openFile slot.

Regards
Solved, I didnt ship the translation files with the exe. My mistake.
Anyway,
Thanks for your help, Marcel