Results 1 to 2 of 2

Thread: QSS - determine element position

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2019
    Posts
    1

    Lightbulb QSS - determine element position

    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(). 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

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QSS - determine element position

    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,
    _

Similar Threads

  1. Replies: 1
    Last Post: 29th July 2015, 19:10
  2. view position of mouse position in GraphicsScene
    By Raghaw in forum Qt Programming
    Replies: 2
    Last Post: 23rd August 2012, 05:46
  3. Replies: 9
    Last Post: 23rd April 2012, 14:53
  4. Determine the Process ID
    By Jimmy2775 in forum General Programming
    Replies: 5
    Last Post: 7th October 2011, 10:16
  5. Replies: 0
    Last Post: 22nd May 2011, 23:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.