Results 1 to 4 of 4

Thread: ActiveWindow changes after closing QFileDialog

  1. #1

    Default ActiveWindow changes after closing QFileDialog

    Hello,

    my program uses QWorkspace and adds new windows to this workspace.

    Qt Code:
    1. Child *child = new Child(this,0);
    2. workspace->addWindow(child);
    To copy to clipboard, switch view to plain text mode 

    When closing the QFileDialog of one of the windows, the active window is resetted to window nr.1 of the windowlist (creation order).

    Qt Code:
    1. QString fileName = QFileDialog::getOpenFileName(
    2. this,
    3. tr("Open"),
    4. "/path",
    5. tr("Textfile (*.txt)"));
    To copy to clipboard, switch view to plain text mode 

    I've got no clue why the active window changes... need help, please!

  2. #2
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ActiveWindow changes after closing QFileDialog

    Which widget do you parent the QFileDialog to?

    It should be the QMainWindow.
    Save yourself some pain. Learn C++ before learning Qt.

  3. #3

    Default Re: ActiveWindow changes after closing QFileDialog

    it doesn't matter which parent is setted...
    (i tried 0,this and your suggestion)

    focusing just works with my self-made dialogs, not with the file dialog.

  4. #4

    Default Re: ActiveWindow changes after closing QFileDialog

    i've read the documentation again and it seems to be an unmanged qt problem:

    Under Windows and Mac OS X, this static function will use the native file dialog and not a QFileDialog.
    Returning to application after native file dialog call ends up with focusing the "wrong" window.

    Not using the static method works perfectly.

Similar Threads

  1. copy file/s from QFileDialog
    By raphaelf in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 14:26

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.