Results 1 to 2 of 2

Thread: How to keep a floating dock visible?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default How to keep a floating dock visible?

    I have an application with multiple toplevel windows besides the main window.
    I have floating docks.
    These docks disappear when I activate a secondary window. They are only shown when the main window has focus.
    (How) can I change this behavior, keeping the docks visible whenever any application window has focus?

    Qt Code:
    1. #include <QMainWindow>
    2. #include <QDockWidget>
    3. #include <QApplication>
    4.  
    5. int main(int argc, char ** argv )
    6. {
    7. QApplication a( argc, argv );
    8. QMainWindow* mw = new QMainWindow();
    9. mw->setWindowTitle("The main window");
    10.  
    11. QDockWidget* dock = new QDockWidget(mw);
    12. dock->setFloating(true);
    13. dock->setWindowTitle("The disappearing dock");
    14. dock->show();
    15.  
    16. QWidget* w = new QWidget(mw);
    17. w->setWindowTitle("The second window");
    18. w->setWindowFlags(Qt::Window);
    19. w->setVisible(true);
    20.  
    21. mw->show();
    22. return a.exec();
    23. }
    To copy to clipboard, switch view to plain text mode 

    Reproduction:
    - place the attached source file in a directory.
    - execute qmake -project; qmake;make
    - execute the application
    - click on "The second window"
    Now the dock has disappeared...
    Attached Files Attached Files

Similar Threads

  1. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10:23

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
  •  
Qt is a trademark of The Qt Company.