用于属性窗口的最佳 Qt 小部件? [英] Best Qt Widget to use for properties window?

查看:53
本文介绍了用于属性窗口的最佳 Qt 小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个小部件,如 Visual Studio 或 NetBeans 中的属性窗口.它基本上有两列:左侧的属性名称和右侧的值.该值需要能够被限制为某些类型,例如 'bool' 或 'float'(具有有效范围),但还应该支持更复杂的类型(可能需要在单击时弹出对话框,然后它可以只显示一个窗口中的 toString() 版本.我确定我可以自己添加其中的大部分功能,但是最好的基础小部件是什么?

I want a widget like the properties window in Visual Studio or NetBeans. It basically has two columns: the name of the property on the left, and the value on the right. The value needs to be able to be restricted to certain types, like 'bool' or 'float' (with valid ranges), but should also support more complex types (perhaps requiring a popup dialog when clicked, and then it can just display a toString() version in the window. I'm sure I can add most of those features myself, but what's the best base widget to start with?

哦...属性分组也很好(我猜就像一棵树).并且属性编辑应该调用回调(发送信号).

Oh... grouping of properties is good too (like a tree I guess). And property editing should invoke a callback (send a signal).

推荐答案

Qt 设计器拥有您想要的属性.它们很可能是用 QTreeView 实现的.您可以随时查看源代码.

Qt designer has properties exactly like you want. They are most likely implemented with QTreeView. You can always look at the source code.

这篇关于用于属性窗口的最佳 Qt 小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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