the "Qt way"?
Loading of stylesheets and external images at run-time is supported by QT... so I'm not sure I understand where you are coming from using this term.
My goal was to allow my end-users to create/modify their own themes for the application.
Anyways - as I mentioned above my themeing system now works fine with my pre-processor. This even allowed me to add support for some CSS3 features unsupported by QT such as @variables....
actually, no spaces existed in the original stylesheet - if there were spaces between "url" and the first parenthesis it would have given a parsing error.
The CSS sample code I posted above was just me paraphrasing the original code.
This wasn't the bug I was seeing with derived classes & relative paths.
I never said it "threw/raised" the parsing errors. It just fails ungracefully.
There are bugs in QT's current CSS parsing.... lots of them.
here's just one example:
/*
QSlider::vertical
{
/* background-image: url(images/mixer/mixer_slider_back.png); */
border-width: 1;
width : 50px;
height : 170px;
}
*/
A CSS parser should ignore the above script (because the outer /* */ comment marker pair defines everything inside as a comment... regardless if there is another comment block within.
QT fails to parse this correctly. It sees the first comment marker (/*) and matches it with the first comment close marker... instead of the second comment close marker.
QT's parser obviously uses a simple internal flag to look for the matching comment close marker , instead of using a stack like system to match markers.
QT also seems to have issues with properly cascading styles in certain cases. Such as the one I indicated in the original post.
they mean to use Qt Resource System. You can then get rid of the relative paths, as it allows you to compile your resources into the exec file. Read about it in Assistant.the "Qt way"?
Actually this code should not work in general, and for me it is quite normal that the first "/*" is matched with first "*/". That's the way it works./*
QSlider::vertical
{
/* background-image: url(images/mixer/mixer_slider_back.png); */
border-width: 1;
width : 50px;
height : 170px;
}
*/
I would like to be a "Guru"
Useful hints (try them before asking):
- Use Qt Assistant
- Search the forum
If you haven't found solution yet then create new topic with smart question.
I know about the resource compiler. It's useless for a situation where I want my customers to be able to edit and create their own stylesheets/themes for loading as runtime....
hence my use of external stylesheets that are loaded at runtime - not pre-compiled into the app.
you're right. I just checked the CSS design specs. strange that nested comments are not supported in the spec, especially after so many years and several revisions.
Bookmarks