Results 1 to 2 of 2

Thread: my Function gone wild

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default my Function gone wild

    I have a method called open function which has the following code
    Qt Code:
    1. QFileDialog fdFile;
    2. QString strFile = fdFile.getOpenFileName(this,
    3. "Select Stream File to Open","",
    4. "Stream File (*.*)");
    5. if (strFile.isEmpty())
    6. return; /***********interesting part****************
    7.   //did some file processing
    To copy to clipboard, switch view to plain text mode 

    when i cancel my open file dialog box, for some reason my app will freeze for a while, when I trace it it will freeze at the return ( the part where i will exit on this method) line

    What could be holding my app that it will take some time after exit of this method to respond to my command ( input) .. i am thinking that at the return line of my code this method is trying to cleanup the out of scope stuff, but what makes it freeze for a while is the million dollar question that i've been trying to answer today . since i can't figure it out I want to use my lifeline which is "ask the best forum" so here i am ...

    baray98

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: my Function gone wild

    getOpenFileName() is a static method. You should call it like this:
    Qt Code:
    1. QString str = QFileDialog::getOpenFileName(...);
    2. if(!str.isEmpty()){
    3. //...
    4. }
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to wysota for this useful post:

    baray98 (1st October 2007)

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  2. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04
  3. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  4. Qt 4.1.4 plugin QPSQL
    By jcr in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd June 2006, 22:55
  5. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52

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.