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

QToolBar return global coordinates instead relative to parent window

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.9.7
    • None
    • Kubuntu 18.04 mostly update, Qt 5.9.7
    • Linux/X11

      I try to implement intelligent tab bar on tool bar. My intention is tab bar with tabs oriented west when tool bar is on the left of the window, oriented east when it is on the right, and north oriented when tool bar is on the top or on the bottom.

      In order to do this I need to know x() tool bar coordinate relative to it's parent (main window). But I it seems that

      parentWidget()->pos().x()

      always return global (relate to screen) coordinate. Confirm of this bug is:

      parentWidget()->mapFromGlobal(parentWidget()->pos()).x()

      Which always returns 0 (as expected for globals).

      I attach full working example to proof this bug. I also attach meaning full screenshot in order to visualize this bug.

      Such values as x() == 1450 is simple impossible in relative to main window - it makes sense only as global coordination.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            szykcech Szyk Cech
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes