Runtime notification regarding stylesheet
-
During runtime as my application starts up I get "RED" notices in the application output window that says
"cannot parse stylesheet for widget 0x0nnnnn" I could probably track this down but the id for the widget is what looks like a hex address. There are 48 of these "cannot parse" notices. Oddly enough, all of the functionality of all the widgets seems to be normal. I think but am not sure, that the widgets are qradiobuttons. Any help would be appreciated. Is there a way to decode this hex value to help me identify the widget? -
Hi
You can install a custom message handler
https://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler
and use a string check to stop on a break point when msg contains
"cannot parse stylesheet"You can then inspect the call stack to see where it came from and in that way
pinpoint which widget that triggers the message. -
Hi,
The style sheet parsing error will have no influence on your widget functionality as it's cosmetic changes they act on.
As for identifying the widget, I'd start by checking where in the code the style sheet is applied.
-
If you think about be the message handler, it was already available in Qt 4.
-
@qt_emp
Hi
Yes it will work.
https://doc.qt.io/archives/qt-4.8/qtglobal.html#qInstallMsgHandler
(name is slightly different. works the same as far as i know)