- Each widget is set to style
- Setting Qstyle for Qapplication is for all
- Qapplication::setstyle (Qstylefactory::create ("Fusion"));
- If other widgets have not been set Qstyle, the default is to use Qapplication
- Qstyle Main Overridable interface
- Drawing complex controls
- virtual void Drawcomplexcontrol (Complexcontrol control, const QSTYLEOPTIONCOMPLEX * option, qpainter * painter, const Q Widget * Widget = 0) Const = 0
- Drawing general Controls
- virtual void Drawcontrol (controlelement element, const qstyleoption * option, qpainter * painter, const qwidget * Widge t = 0) Const = 0
- Draw the most basic controls (small arrows or something)
- virtual void DrawPrimitive (primitiveelement element, const qstyleoption * option, qpainter * painter, const qwidget * W Idget = 0) Const = 0
- All of these interfaces have similar parameters
- The first is the enumeration value defined in the Qstyle class, with a specific reference to the QT document that represents the type of control you want to modify
- A few of the following are the name.
- Get the original Qstyle supported by the current platform
- You can also customize the style for each widget
- Modify the display effect of a custom widget
- Qwidget has a style () interface to get the current Qstyle
- Custom Qstyle
- Can rewrite existing Qstyle slightly modified under
- can also inherit one, generally inherit from Qproxystyle, or Qcommonstyle.
- Make a custom style plug-in for other people to use
- The use of Qt style sheet QSS
- Using the. qss file
- If a QT style sheet is activated, it encapsulates the style of the widget
- This is a CSS-like thing
- Child widgets are also modified
- You can apply a style to the entire app, and then assign a style to a control
- This is a top-priority style configuration that overrides Qstyle, or packaging Qstyle
- The difference between Qstyle and QSS
- Qstyle is able to rewrite the drawing controls, you can re-set the brush to draw lines, and of course you can just set the background color. For example, the checkbox, which turns out to be a hook, is now turned into a dark
- QSS change the relative surface point, modify the background color background image or something
- One change the bone, one skin.
- Style sheet can be changed in Qtdesigner
From for notes (Wiz)
Qt Interface style settings