MDI 模型还是 Dock Windows?

发布于 2024-09-04 05:11:52 字数 439 浏览 4 评论 0原文

在我们开发的 QT 应用程序中,我们需要显示几个“查看器窗口”(以 XY 平面、YX 平面、XZ 平面和 3D 形式显示数据)。

我们本来希望使用MDI应用程序模型,但后来客户要求在多个桌面(使用多个显示器)中拖动并查看“查看器窗口”。 使用 MDI 窗口模型无法完成此操作,因为我们无法将 MDI 窗口移至主应用程序窗口之外。

唯一可能的方法是使用 Dock 窗口,因为它们可以从主应用程序窗口取消停靠并移至其他桌面,但 Dock 窗口主要用于工具选项板或实用程序窗口。

(http://doc.qt.nokia.com/4.6/qdockwidget.html#详细信息

使用 Dock 窗口来满足我们的要求是一个好习惯吗?

In the QT application we develop we need to display several 'Viewer windows' (to display data in XY plane, YX plane, XZ plane and in 3D).

We were hoping to use MDI application model, but later the client asked for a requirement to drag and view 'Viewer windows' in multiple desktops (using multiple monitors).
This can not be done using MDI window model, because we cannot move MDI window outside the Main Application Window.

Only possible way is to use Dock windows because they can be undocked from Main Application Window and move into other desktops, but Dock windows primary used for tool-palettes or utility windows.

(http://doc.qt.nokia.com/4.6/qdockwidget.html#details)

Is it a good practice to use Dock window for our requirement?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

上课铃就是安魂曲 2024-09-11 05:11:52

我不会使用 QDockWindow 因为看起来你不会使用客户区。此外,您不想停靠到主窗口边框,而只是将小部件添加到主窗口。

我认为你可以尝试将多个 QWidget 与 QGridLayout 一起使用。当将 QWidget 拖到主窗口之外时,只需从布局中删除 QWidget 即可。在 MainWindow 内拖动时,将 QWidget 添加到 QGridLayout 中的正确位置。通过这种方法,您也可以将小部件的位置切换到主窗口中。

我不知道它是否足够清晰,但我正在思考将新元素拖到布局中时在 QtDesigner 中完成的相同方式。拖动小部件时,释放鼠标按钮时您可以看到它将添加到的位置。

在我看来,这种方法可能就是您正在寻找的方法。

希望有帮助

I would not use the QDockWindow since it seems you will not use the client area. In addition, you don't want docking to the MainWindow borders but just added the widget to the MainWindow.

I think you can try to use multiple QWidget with a QGridLayout. When dragging QWidget outside of the MainWindow, just remove QWidget from the layout. When dragging inside the MainWindow add the QWidget to the right place in the QGridLayout. With this method you can too switch widget's places into the Main Window.

I don't know if it is clear enough but I'm thinking to the same way it is done in QtDesigner when dragging new elements into a layout. When dragging widgets you can see the place where it will be added when releasing the mouse button.

In my mind this method can be the one you are searching for.

Hope that helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文