GammaRay icon indicating copy to clipboard operation
GammaRay copied to clipboard

QSS debugger?

Open rolivav opened this issue 2 years ago • 2 comments

Hello, I am trying to check where and how QSS is painted in Qt and it seems Gammaray is not able to tell me where this happens. I see my own painting code from my C++ style, but when it comes to QSS it is a black box. It would be very nice to know how this happens to be able to override this QSS in C++ code directly with the same inputs.

In this image you can see I am painting this image from QSS, but it does not tell me how... for some reason I only see QDirModel and QOpenGLFunctions_4_2 here, but I think this part of the stack trace comes from Gammaray doing the debug painting.

Am I missing something here? Maybe a way to tell Gammaray where the Qt source code is so it can symbolicate the painting code? image

rolivav avatar Dec 14 '23 16:12 rolivav

@rolivav AIUI (and, I'm just a fellow user, so treat everything I say with suspicion until verified) QSS very much is a black box. Widget styling is also (in modern Qt) a complex interplay between Qt and native-platform code, so it's completely absent from the Qt Meta-Object system instrumentation that GammaRay uses to inspect applications.

I think you'd need a real source debugger (which GammaRay is not), and probably also debug builds of the Qt libraries as well (which you'd have to compile yourself), in order to examine the QSS codepaths.

As far as overriding, though... you may not have much luck there, anyway: It's possible to create custom QStyle subclasses that override standard Qt widget-styling behavior, but custom subclasses lose support for Qt Style Sheets1 in the process.

Notes

  1. (See the admonition box at the very end of the linked section.)

ferdnyc avatar Dec 16 '23 15:12 ferdnyc

debug builds of the Qt libraries as well (which you'd have to compile yourself)

Sorry, that part's not right, I forgot Qt's update/install tool now offers downloads of debuginfo files.

ferdnyc avatar Dec 16 '23 19:12 ferdnyc