Results 1 to 3 of 3

Thread: getSaveFileName and getOpenFileName Crash

  1. #1
    Join Date
    Feb 2007
    Posts
    4
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default getSaveFileName and getOpenFileName Crash

    Hello all,
    I am developing an application on Qt-4.6.2 on window platform.
    I am using windows XP professional version 2002 with SP3.

    Qt Code:
    1. struct {
    2. char Dir[_MAX_PATH];
    3. char Filter[128];
    4. } Param;
    5.  
    6. strcpy (Param.Dir, ".");
    7. strcpy (Param.Filter, "*");
    8.  
    9. QString f = Q3FileDialog::getSaveFileName (Param.Dir, Param.Filter, 0, 0, Title); // crash
    To copy to clipboard, switch view to plain text mode 

    Here the application is crashing on the last line of code.

    Here are some of my observations:

    1) QString f = Q3FileDialog::getSaveFileName ("", Param.Filter, 0, 0, Title);
    -- OK Works fine

    2) QString f = Q3FileDialog::getSaveFileName (" ", Param.Filter, 0, 0, Title);
    -- Crash

    3) QString f = Q3FileDialog::getSaveFileName ("C:\\", Param.Filter, 0, 0, Title);
    -- Crash

    Interestingly when I tried the same application with same dlls on my colleague's machine, it is working fine with all options(mentioned above 1,2,3) .

    The similar situation arise with Q3FileDialog::getOpenFileName() function also.

    Please provide me any help regarding this issue.









    it works fine.

  2. #2
    Join Date
    Feb 2010
    Location
    Pennsylvania, USA
    Posts
    36
    Thanks
    9
    Thanked 3 Times in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: getSaveFileName and getOpenFileName Crash

    Is your entire application in Qt 4.6.2? If so, please consider using QFileDialog instead of Q3FileDialog, which is only provided to keep old Qt3 code working.

  3. #3
    Join Date
    Feb 2007
    Posts
    4
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: getSaveFileName and getOpenFileName Crash

    Quote Originally Posted by TheJim01 View Post
    Is your entire application in Qt 4.6.2? If so, please consider using QFileDialog instead of Q3FileDialog, which is only provided to keep old Qt3 code working.
    Thanks TheJim01,
    After replacing Q3FileDialog with QFileDialog, it is working fine.
    Thanks once again for prompt reply.

Similar Threads

  1. Replies: 2
    Last Post: 22nd June 2009, 05:22
  2. the problem of getOpenFileName
    By AD in forum Qt Programming
    Replies: 4
    Last Post: 30th July 2008, 11:59
  3. Qt 4.4 getOpenFileName error
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 10th May 2008, 01:09
  4. Problem with QFileDialog::getOpenFileName()
    By spud in forum Qt Programming
    Replies: 4
    Last Post: 1st November 2007, 22:31
  5. Replies: 1
    Last Post: 14th October 2007, 23:10

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.