<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[QCss::Parser -- how to reproduce behavior?]]></title><description><![CDATA[<p dir="auto">The QCss::Parser class could be incredibly useful for the average Qt user if they want to test the sanity of stylesheets themselves.<br />
This could be in a situation where the program's stylesheets are user-definable, and they want to spare the application of having an erroneous style applied to it, even though the program will still run. I know that the invalid selectors will not be applied to, but I want this to be recognizable on the basis in which I'm setting the stylesheet.</p>
<p dir="auto">Judging by the fact that the actual code for this is not provided, and only acknowledgable through the includes, I've assumed behavior is different depending on the platform/version of Qt. Why is this?</p>
<p dir="auto">More importantly, how can I reproduce this behavior without adding <code>gui-private</code> and jeopardizing my stability and ability to run on differing modules (not to mention the errors)? Is there an underlying class/framework that this parser uses? I'm talking specifically about the <code>QCss::Parser::parse()</code> method.</p>
]]></description><link>https://forum.qt.io/topic/130386/qcss-parser-how-to-reproduce-behavior</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 05:51:33 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/130386.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Sep 2021 01:48:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QCss::Parser -- how to reproduce behavior? on Sat, 18 Sep 2021 21:13:38 GMT]]></title><description><![CDATA[<p dir="auto">Thank you.</p>
]]></description><link>https://forum.qt.io/post/681175</link><guid isPermaLink="true">https://forum.qt.io/post/681175</guid><dc:creator><![CDATA[Ewan Green]]></dc:creator><pubDate>Sat, 18 Sep 2021 21:13:38 GMT</pubDate></item><item><title><![CDATA[Reply to QCss::Parser -- how to reproduce behavior? on Sat, 18 Sep 2021 21:05:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ewan-green">@<bdi>Ewan-Green</bdi></a><br />
Hi<br />
well the use of _p private headers is to keep as much as possible as<br />
implementation details as Qt promise backward compatibility so<br />
they are careful what makes it to public interfaces.</p>
<p dir="auto">If they allowed access to parse it would have to return its internal data structures<br />
and hence it would have become public.<br />
However, I agree. They could at least return parse status with err number and line<br />
if it had errors.</p>
<p dir="auto">It has been asked on forums a few times and solutions range from copy the parser files and make own version to using external lib like <a href="http://www.netsurf-browser.org/projects/libcss/" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.netsurf-browser.org/projects/libcss/</a></p>
]]></description><link>https://forum.qt.io/post/681173</link><guid isPermaLink="true">https://forum.qt.io/post/681173</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sat, 18 Sep 2021 21:05:32 GMT</pubDate></item><item><title><![CDATA[Reply to QCss::Parser -- how to reproduce behavior? on Sat, 18 Sep 2021 16:38:35 GMT]]></title><description><![CDATA[<p dir="auto">I did end up looking at the source file between now and when I posted initially.<br />
I see how they did the parsing, and it isn't very flexible for re-implementation. Seeing as how it already exists in the source, and is undeniably being used somewhere down the line when stylesheets are used, I just think it's so ridiculous they don't allow public access to this method or something similar. Even if it were the easiest thing to re-implement, doing so is not my favorite idea if the code is already "available" to me (so to speak).</p>
<p dir="auto">Do you know of anyone who has faced this issue &amp; the solution they came up with?</p>
]]></description><link>https://forum.qt.io/post/681118</link><guid isPermaLink="true">https://forum.qt.io/post/681118</guid><dc:creator><![CDATA[Ewan Green]]></dc:creator><pubDate>Sat, 18 Sep 2021 16:38:35 GMT</pubDate></item><item><title><![CDATA[Reply to QCss::Parser -- how to reproduce behavior? on Sat, 18 Sep 2021 13:07:58 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
The parser seems handwritten.</p>
<p dir="auto"><a href="https://code.woboq.org/qt5/qtbase/src/gui/text/qcssparser_p.h.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://code.woboq.org/qt5/qtbase/src/gui/text/qcssparser_p.h.html</a></p>
<p dir="auto"><a href="https://code.woboq.org/qt5/qtbase/src/gui/text/qcssparser.cpp.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://code.woboq.org/qt5/qtbase/src/gui/text/qcssparser.cpp.html</a></p>
]]></description><link>https://forum.qt.io/post/681100</link><guid isPermaLink="true">https://forum.qt.io/post/681100</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Sat, 18 Sep 2021 13:07:58 GMT</pubDate></item></channel></rss>