PDA

View Full Version : QSS - determine element position



jpomp
8th July 2019, 21:12
Hello,

Brand new to QT but looking to see if there's is a specific function available (or perhaps a different solution to a problem). The problem is, once a page is rendered, relative to the top/left corner of the page (x/y to the page), can I take a QSS element and determine it's absolute position?

For CSS/Javascript, there's a function called; element.getBoundingClientRect() (https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect). Is there something similar for QSS/Qt?

After that I need to determine what the element width and height is. With this all combined, I can inspect/test elements after they have been rendered to the page to make sure they are done so correctly and in the correct position.

Thank you in advance

anda_skoa
9th July 2019, 09:36
QSS, similar to CSS, is just styling rules. There is no scripting involved.

Also not sure what you mean with "page" in this context. As in "widget in a tab widget" or something like that?

Cheers,
_