简体   繁体   English

Primitive、Control 和 Complex Control 小部件有什么区别?

[英]What is the difference between a Primitive, Control and Complex Control widget?

Qt supports custom paint events for drawing of widgets through QStyle . Qt 支持通过QStyle绘制小部件的自定义绘制事件。 However when using the QStyle you need to specify what type of element you're trying to draw, ie, if you want a control element you need to paint it by using QStyle.drawControl(CE_Example, style) .但是,当使用QStyle时,您需要指定要绘制的元素类型,即,如果您想要控制元素,则需要使用QStyle.drawControl(CE_Example, style)来绘制它。

My question is, how is someone who is relatively new meant to understand which method to correctly call, or find which element to paint when I want to perform the actions myself, say for example I want to draw my SpinButton with purple up and down arrows.我的问题是,一个相对较新的人如何理解正确调用哪种方法,或者当我想自己执行操作时找到要绘制的元素,例如我想用紫色上下箭头绘制我的 SpinButton . I tried to google and see if I could find an explanation but could not, so I was wondering if this is common terminology or if it was some jargon used by the Qt community.我试图用谷歌搜索,看看是否能找到解释,但找不到,所以我想知道这是常见的术语还是 Qt 社区使用的一些行话。

Any advice for correctly traversing documentation or anything like that appreciated, maybe I have an incorrect approach.任何关于正确遍历文档的建议或任何类似的东西都值得赞赏,也许我的方法不正确。

I eventually found my answer traversing https://doc.qt.io/qt-5/qstyle.html#details我最终找到了遍历https://doc.qt.io/qt-5/qstyle.html#details的答案

  • Primitive Element : A primitive element is a common GUI element, such as a checkbox indicator or button bevel.原始元素:原始元素是常见的 GUI 元素,例如复选框指示器或按钮斜面。

  • Control Element : A control element is a part of a widget that performs some action or displays information to the user.控制元素:控制元素是小部件的一部分,它执行某些操作或向用户显示信息。

  • Complex Control : Complex controls have different behavior depending upon where the user clicks on them or which keys are pressed.复杂控件:复杂控件具有不同的行为,具体取决于用户单击它们的位置或按下的键。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM