Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Get absoluto position of a widget in the framebuffer
QtWS25 Last Chance

Get absoluto position of a widget in the framebuffer

Scheduled Pinned Locked Moved Mobile and Embedded
17 Posts 2 Posters 7.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    meem
    wrote on last edited by
    #8

    Yes, i think it has fixed size. But I think in qt it's configurable if it's vivible or not, so I would have to write a lot of code to solve this issue. Isn't the kind of elegant way to do this?

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #9

      I'm confused. Are you saying that Qt itself provides this system menu? The last time I used Qt Embedded all I had was a bare framebuffer. I can't recall seeing a menu. Hmmm, then again we ran our application as fullscreen. Do you have an image of the menu? What process is responsible for drawing it?

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • M Offline
        M Offline
        meem
        wrote on last edited by
        #10

        The menubar is also a widget, i started off with the ui template "main window" in qt designer.

        Currently the application is a standalone app which is started with "-qws" option. So itself draws everything to the framebuffer, except of the videooutput which is done in a seperate thread.

        But in general also in qt-emebedded you can run also applications in windows and not only as fullscreen.

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #11

          Ah sorry I misunderstood. I thought you had some other application drawing a system menu like on a phone. Hmmm, in this case as you say the mapToGlobal() function should just work and take the menu bar and window decoration into account.

          Which version of Qt are you using? Can you reproduce this on your host machine running your application via qvfb? Can you post a small compilable example that reproduces it please?

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • M Offline
            M Offline
            meem
            wrote on last edited by
            #12

            With mapToGlobal i experienced the same problems. Doesn't it use also the QScreen instance?

            I will have to wait to next week to provide some example code and reproduce it, but i will keep you informed. Thanks so far.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on last edited by
              #13

              No worries. It should just work but if not then we'll see if we can squash the bug.

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              1 Reply Last reply
              0
              • M Offline
                M Offline
                meem
                wrote on last edited by
                #14

                Finally i found my failure. I didn't realize maptoglobal returns the position in framebuffer in bytes and not in pixels. So when calculating it to pixel address in bytes must be divided by the depth in bytes.

                So the problem can be considered as solved. Thanks.

                1 Reply Last reply
                0
                • Z Offline
                  Z Offline
                  ZapB
                  wrote on last edited by
                  #15

                  Hmmm, that is not clear from the docs at all. It reads as if it should be in pixels and I'm pretty sure that's what it is on the desktop. Maybe something is forgetting to do the byte->pixel conversion when using the framebuffer driver in Qt Embedded?

                  Might be worth testing on the desktop and comparing. It is either a bug in Qt Embedded or a documentation bug (if it is intended to be bytes it should say so).

                  Nokia Certified Qt Specialist
                  Interested in hearing about Qt related work

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    meem
                    wrote on last edited by
                    #16

                    So i did some further investigation and could bring up the core problem with the coordinates.

                    If mapToGlobal is called from the top-level widget the coordinates are mapped correctly.
                    If mapToGlobal is called from within the class it does strange things.

                    How can i upload some file, wrote a little test to reproduce this problem?

                    1 Reply Last reply
                    0
                    • Z Offline
                      Z Offline
                      ZapB
                      wrote on last edited by
                      #17

                      Please open a bug report in JIRA (http://bugreports.qt.nokia.com/) and attach a tarball/zip file of your test case.

                      Nokia Certified Qt Specialist
                      Interested in hearing about Qt related work

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved