Results 1 to 9 of 9

Thread: QMessageBox misbehaves after QFileDialog call

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    15
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Angry QMessageBox misbehaves after QFileDialog call

    OS: Ubuntu 8.10 w/ partial upgrade to 9.04
    Qt Version: 4.5.1 Qt Creator: 1.1.0

    When calling fDialog.getOpenFileName, QMessageBox no longer obeys where you tell it to move to. For instance, being a parent of the Terminal window, it will not center. Calling msgBox.move(x,y) does not move the QMessageBox. It always starts in the same awkward place. If fDialog.getOpenFileName is not called, the QMessageBox moves whereever is needed.

    Qt Code:
    1. void Terminal::on_actionOpen_triggered()
    2. {
    3. QFileDialog fDialog;
    4. QString fileName = fDialog.getOpenFileName(this, tr("Open File"), "app/", tr("All Files (*)"), 0, 0);
    5. if (fileName == "") {
    6. QMessageBox msgBox(QMessageBox::Information, QApplication::applicationName(), tr("Open operation canceled."), QMessageBox::Close, this, 0);
    7. msgBox.exec();
    8. return;
    9. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by MikeG; 29th May 2009 at 15:39.

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.