Results 1 to 17 of 17

Thread: Application stops working unexpectedly

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Posts
    137
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Application stops working unexpectedly

    Hi,

    in my app I am reading a file name by opening a QFileDialog and save the filename to a string variable. And then I check for the variable in question of filename returned. I am doing this with an If statement and showing message box if the variable is empty. But when I get to the If statement my program showing a message that "example.exe has stopped working unexpectedly". here is my code

    Qt Code:
    1. void MainWindow::getFilename()
    2. {
    3. QMessageBox msgbox;
    4. msgbox.setText("Please select the file");
    5. filepath = QFileDialog::getOpenFileName(this, tr("Open File"),"/home",tr("Text files(*.txt)"));
    6. if(filepath.isEmpty())
    7. msgbox.exec();
    8. }
    To copy to clipboard, switch view to plain text mode 

    I would be grateful for any solution.

    Thank You,
    Baluk
    Last edited by baluk; 19th November 2010 at 09:20.

Similar Threads

  1. Replies: 1
    Last Post: 7th November 2012, 22:28
  2. Program has unexpectedly finished
    By Maluko_Da_Tola in forum Newbie
    Replies: 5
    Last Post: 1st December 2010, 09:54
  3. Thread stops after a while in release mode
    By huba in forum Qt Programming
    Replies: 4
    Last Post: 21st July 2010, 04:29
  4. Replies: 2
    Last Post: 14th July 2009, 14:25
  5. tab stops ?
    By ixM in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2009, 13:11

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.