Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-28668

Add ability to retrieve global coordinates for Item

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P5: Not important
    • None
    • 5.0.0 RC 2
    • None
    • 08327da795ee8c4b26441cc0de1a5c49bd5f2b39

    Description

      Item's coordinates (x, y) are relative to it's parent. It would be very useful to retrieve global coordinates (on desktop). We can find coordinates relative to root item using mapToItem() and pass null as item, but there is no simple way to find coordinates of root item's window.
      So there is several ways Qt can be improved to solve this problem:
      1. Add global coordinates as properties to Item (globalX, globalY)
      2. Add Window as a property to Item (it's x and y coordinates are global).
      3. Made root item's coordinates to be global (now it is 0,0).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            martinj Martin Jones
            krnekit Nikita Krupenko
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes