Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Stylesheets and QML - widget application being changed to QML, what is the best way to reuse stylesheets?

$
0
0
So, if my option is to style in the QML what is my best bet for custom styling? The app is very simple but needs to allow the user to change colour/font/font style/font size and retain those settings. With widgets I was starting with a stylesheet and updating it with a custom block of css added to the bottom of the file so there was no need to write code to create a new file just have the existing one but let the code at the bottom overwrite what came before. So if the stylesheet said background should be white but user wanted it to be blue ‘original stylesheet+set background to blue’ would be loaded. The ‘zoom’ setting also needs to be retained PER SCREEN. It is such a simple application for non technical elderly/visually impaired users that ‘zoom’ is really just the font size but they need to have the ‘zoom’ setting per screen – again, in the widget version it was just reloading the stylesheet and applying an font size change each time a new screen was display so minimal data to retain. PS I am using the word screen to cover the case of a menu change (which is really someone clicking on a Listview causing the data on the Listview to be updated (click on “Letters and documents” and the Lisview is updated to give options “Write a letter”, “Find a document” etc) but at the same time the ‘zoom’ setting is updated for that ‘menu page’ (i.e. set of Listview data)…… and also the case that the user has gone into a new application (they might want email to be big and letter writing to be small based on the layout of the screen or whatever other preference might apply to them).

Viewing all articles
Browse latest Browse all 4972

Trending Articles