G
G
gense2019-11-03 11:02:20
Qt
gense, 2019-11-03 11:02:20

Is there any overhead when using CSS in Qt?

I hope he does not connect any HTML engine for GUI rendering? Or he just translates it all into standard QPalettes, etc. and sets widget display properties via standard APIs? How does it even work? I have not googled detailed information about this.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
ittakir, 2019-11-03
@ittakir

Qt themselves recommend styling controls through setStyleSheet().
Under the hood, I think that values ​​are simply set to a set of widget parameters, and then the widget simply uses these values ​​when drawing, i.e. style parsing does not happen every frame.
Of course, it takes time to parse the style text, but it is scanty, in real work I did not notice any problems with rendering.
Through the stylesheet, you can also set the value of your parameters, you just need to declare them in a certain way.

J
Jacob E, 2019-11-04
@Zifix

>I hope he doesn't use some HTML engine to render the GUI?
No, it does not connect, but for non-standard interfaces in 2019 it is worth taking QML, not QSS. Widgets are not friendly with HiDPI screens, there are bugs that have not been fixed for 10 years, and in general - QML is much more flexible and beautiful.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question