简体   繁体   中英

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

Qt supports custom paint events for drawing of widgets through 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) .

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. 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.

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

  • Primitive Element : A primitive element is a common GUI element, such as a checkbox indicator or button bevel.

  • 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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