Forum > QT
Embedded qss stylesheets & fonts, a quick little guide
jns:
Hello pascal friends :)
I just figured I'd share my experiences so far getting embedded cross-platorm font resources and qss stylesheets to work - for any one looking to dig deeper into qt with Lazarus.
I posted this on my gopher site here: gopher://gopher.linkerror.com:70/1/pascal
You can view it over regular http via a proxy here: https://gopher.floodgap.com/gopher/gw?=gopher.linkerror.com+70+312f70617363616c
I happened the notice that the wiki pages on qt usage are rather outdated, with one page about qt4, another about qt5, but no mention of qt6 just yet - and I didn't see much in terms of basic instructions like these, such as common conventions to access underlying qt components of lcl widgets. Unless I looked in the wrong place :)
That said, I'm not even sure if creating such pages is even appropriate, as it's all a bit hacky - it would be nicer to have a formalized interface to load stylesheets instead.
As noted on the stylesheets page, at this time you even have to manually set control names, as the LCL implementation doesn't do so automatically - so this kind of thing is probably outside of the scope of what was intended usage.
I tried to include a basic mapping list between LCL widgets and Qt widgets -- it might not be 100% accurate, so let me know if there's corrections to be made!
cdbc:
Hi
The gopher-link is saying "No reverse proxy....", i.e.: It doesn't work!
Please upload the material here on this forum as something we can read... :D
Regards Benny
marcov:
I'm not really a QT expert, but aren't QT and QTquick (the latter with stylesheet) two different things?
big_M:
Wow, lots of very useful information here. Thanks! :) Maybe this could be integrated into the wiki, or linked to it?
So far I'm using only external qss files, but since they can be embedded into the code, do you know if you can change the stylesheet on the fly? I have an idea for some effects, but for that I think I would have to switch between stylesheets.
Ah, and would you by any chance have a solution for my problem on my topic below? I'm looking for an alternative to a stylized speedbutton (some kind of a stylized toggle button with support for icons)
jns:
--- Quote from: marcov on January 14, 2026, 10:34:57 am ---I'm not really a QT expert, but aren't QT and QTquick (the latter with stylesheet) two different things?
--- End quote ---
You are almost correct:
Qt is the widget library.
The widgets can be styled with stylesheets (QSS)
QtQuick is a scripting language that can be used in addition to, or in replacement of, the normal code, and it is distinctly separate from stylesheets.
You can combine QtQuick and Stylesheets, but you don't have to use QtQuick to use stylesheets.
Navigation
[0] Message Index
[#] Next page