QDockWidgets,从 UIDesigner 设置嵌套状态
我使用 GuiCreator 创建了一个 QtGui 并添加了一些 DockWidget。我只能允许属性编辑器中的嵌套状态,但如何将其设置为 DockWidgets 的活动状态?
在运行时,用户可以移动 DockWidget,如果一个 DockWidget 移动到另一个 DockWidget 上,它就会进入嵌套状态,从而生成 TabView。
现在我想启动应用程序,其中 DockWidgets 处于嵌套状态并关闭。当用户切换 DockWidget 可见时,它将被添加为选项卡(嵌套),并且在切换它时,选项卡将被删除。
我知道我可以为此使用 TabWidget,但我希望能够选择取消 DockWidget 并将其作为单个窗口打开,因此我需要 DockWidgets。
此外,GUICreator 将所有小部件处理为可见,并且它们显示在创建器中,从而导致主窗口的大小调整,当我手动设置固定大小和值时,这会导致奇怪的行为。
从源代码中创建这些 DockWidget 是否更好? GuiCreator 似乎缺少一些我需要的功能。
我不喜欢我不能完全与创建者一起构建一个独立的 Gui。我总是需要调整大小并向我的源代码添加与 UI 相关的内容。我做错了什么吗?
I created a QtGui with the GuiCreator and added some DockWidgets. I can only allow the nested state from the property editor but how can I set it active for the DockWidgets?
At runtime the user can move the DockWidgets and if one DockWidget is moved over another it goes into the nested state resulting in a TabView.
Now I want to Launch the Application with the DockWidgets in nested state and closed. When the user toggles a DockWidget visible it shall be added as a Tab (nested) and on toggling off it the tab shall be removed.
I know I could use a TabWidget for this, but I want to have the option to undock the DockWidget and have it open as a single Window, so I need the DockWidgets.
Furhter the GUICreator handles all the Widgets as visible and they are shown in the creator resulting in a resize of my MainWindow and this results in strange behavior when I manually set fixed size and values.
Is it better to create those DockWidgets from within the Source Code? It seems that the GuiCreator lacks some of the features I need.
I don't like the fact that I cannot completely build a independent Gui with the creator. I always have to do resizing and adding UI-related stuff to my source code. Am I doing something wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为你做错了什么。这些 QDockWidgets 使用起来很痛苦。 (但它们对用户来说真的很酷。)
I don't think you are doing anything wrong. Those QDockWidgets are a pain to work with. (But they are really cool for the user.)