Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. With header QTreeView::mapToGlobal returns an unexpected value
Qt 6.11 is out! See what's new in the release blog

With header QTreeView::mapToGlobal returns an unexpected value

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 682 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.
  • jronaldJ Offline
    jronaldJ Offline
    jronald
    wrote on last edited by jronald
    #1

    Env

    • OS: Linux
    • Qt: 6.2.0

    Problem

    If QtreeView has no header, QTreeView::mapToGlobal returns the expected value.
    If QtreeView has a header, QTreeView::mapToGlobal returns an unexpected value, if plus it with the height of the header, it'll be as expected.

    More Info

    Post with the same issue in 2011: https://forum.qt.io/topic/3747/qtreeview-maptoglobal-is-this-considered-a-bug

    eyllanescE 1 Reply Last reply
    0
    • jronaldJ jronald

      Env

      • OS: Linux
      • Qt: 6.2.0

      Problem

      If QtreeView has no header, QTreeView::mapToGlobal returns the expected value.
      If QtreeView has a header, QTreeView::mapToGlobal returns an unexpected value, if plus it with the height of the header, it'll be as expected.

      More Info

      Post with the same issue in 2011: https://forum.qt.io/topic/3747/qtreeview-maptoglobal-is-this-considered-a-bug

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @jronald try with: view.viewport()->mapToGlobal(...).

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      jronaldJ 1 Reply Last reply
      3
      • eyllanescE eyllanesc

        @jronald try with: view.viewport()->mapToGlobal(...).

        jronaldJ Offline
        jronaldJ Offline
        jronald
        wrote on last edited by
        #3

        @eyllanesc said in With header QTreeView::mapToGlobal returns an unexpected value:

        try with: view.viewport()->mapToGlobal(...).

        It works, but why?

        Thanks

        eyllanescE 1 Reply Last reply
        0
        • jronaldJ jronald

          @eyllanesc said in With header QTreeView::mapToGlobal returns an unexpected value:

          try with: view.viewport()->mapToGlobal(...).

          It works, but why?

          Thanks

          eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by
          #4

          @jronald The positions of the mouseXEvent methods of the classes that inherit from QAbstractScrollArea such as QTreeView are relative to the viewport.

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          1 Reply Last reply
          1

          • Login

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