Pop-out widget into a separate window with Qt

Have you ever felt that your application needs an extra window? When the user has 2 screens available how great would it be to separate the widgets you had to push into a tab widget!

I have good news for you: this can be done simply with Qt.

Let’s say we have a window with two widgets. They are quite important so we’d like the user to see both of them if possible. What can we do about it?

first
First, red and green

Let’s create an other window and use Qt’s slot&signal mechanism to send messages between them.

Second, the red widget is moved to the other window

I had the red widget removed just to let you see that this is no fake so after putting back the red widget they will switch places compared with the original window.

Third, the red widget is returned to the original window.

The source code is available here on github

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.