如何在Qt中具有可拆卸的工具窗口 [英] How to have detachable tool windows in Qt

查看:156
本文介绍了如何在Qt中具有可拆卸的工具窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个具有一些可变大小窗口的工具.我可以使用QSplitter水平&垂直的.请参阅附件图片.

I am developing a tool which will have some variable sized windows. I am able to achieve this using the QSplitter horizontal & vertical. Please see attached image.

现在,如何使这些单独的窗口可分离/最大化/关闭?如何在每个窗口的右上角添加十字标记,以便可以最大程度地将其关闭或从此处分离?就像这个链接:-

Now, how to make these individual windows detachable/maximize/close? How can I add cross markers at the top-right-corner of each window so that they can be closed maximized or detached from there? Just like this link :--

http://vector.com/portal/medien/ecu_testing/tae/test_automation_editor.png

推荐答案

您正在寻找

You're looking for the QDockWidget class:

QDockWidget类提供了一个可以停靠在窗口内部的窗口小部件. QMainWindow或作为桌面上的顶级窗口浮动. QDockWidget提供了停靠小部件的概念,也称为工具 调色板或实用程序窗口.停靠窗口是放置的辅助窗口 在QMainWindow中中央小部件周围的停靠小部件区域中.

The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-level window on the desktop. QDockWidget provides the concept of dock widgets, also know as tool palettes or utility windows. Dock windows are secondary windows placed in the dock widget area around the central widget in a QMainWindow.

查看此示例

这篇关于如何在Qt中具有可拆卸的工具窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆