Results 1 to 5 of 5

Thread: Weird problem while porting from Qt3 to Qt4

  1. #1
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Weird problem while porting from Qt3 to Qt4

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird problem while porting from Qt3 to Qt4

    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

  3. #3
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird problem while porting from Qt3 to Qt4

    Quote Originally Posted by marcel View Post
    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
    Qt Code:
    1. void MainWindow::fileOpen()
    2. {
    3. saveBeforeOpening();
    4. QTextCodec *codec = QTextCodec::codecForLocale();
    5. QString fileName = codec->fromUnicode( QFileDialog::getOpenFileName(
    6. this, QString::null, "*.syn;;*.r" ) );
    7. if( fileName.isEmpty() )
    8. {
    9. emit explain( tr("Open file dialog cancelled") );
    10. }
    11. else
    12. {
    13. openFile( fileName );
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by vermarajeev; 8th August 2007 at 04:31.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird problem while porting from Qt3 to Qt4

    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

  5. #5
    Join Date
    Sep 2006
    Posts
    339
    Thanks
    15
    Thanked 21 Times in 16 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird problem while porting from Qt3 to Qt4

    Quote Originally Posted by marcel View Post
    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

Similar Threads

  1. Font Problem Porting from Windows to Linux
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2007, 10:25
  2. Problem related to porting from QT3 to QT4 in list items
    By rohitjun in forum Qt Programming
    Replies: 5
    Last Post: 1st June 2007, 09:05
  3. Problem porting Kivio MP on win32 from Qt 3 to Qt 4
    By Amanda in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 19:40
  4. Problem in porting Main window on linux
    By jyoti kumar in forum Qt Tools
    Replies: 2
    Last Post: 2nd June 2006, 08:35
  5. Porting problem from Qt3 to Qt4
    By Krishnacins in forum Qt Programming
    Replies: 2
    Last Post: 19th May 2006, 14:29

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.