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. Align two QGraphicView widgets vertically
Qt 6.11 is out! See what's new in the release blog

Align two QGraphicView widgets vertically

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 565 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
    MS_GX
    wrote on last edited by MS_GX
    #1

    Sounds pretty simple but I am struggling:

    I would like to align two QGraphicView widgets vertically. Or in case my description is not using accurate Qt nomenclature: I want to align the y-position of the visible part of two QGraphicsScene widgets.

    QGraphicsView number two triggers an event as soon as the vertical scrollbar is shifted. In the function called by the event I would like to align the y position of view one with the shifted view 2.

    JonBJ 1 Reply Last reply
    0
    • M MS_GX

      Sounds pretty simple but I am struggling:

      I would like to align two QGraphicView widgets vertically. Or in case my description is not using accurate Qt nomenclature: I want to align the y-position of the visible part of two QGraphicsScene widgets.

      QGraphicsView number two triggers an event as soon as the vertical scrollbar is shifted. In the function called by the event I would like to align the y position of view one with the shifted view 2.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @MS_GX
      So isn't this just a question of using https://doc.qt.io/qt-5/qabstractslider.html#value-prop, or similar scrolling property/function, to scroll one view to match the value of the other?

      M 1 Reply Last reply
      3
      • JonBJ JonB

        @MS_GX
        So isn't this just a question of using https://doc.qt.io/qt-5/qabstractslider.html#value-prop, or similar scrolling property/function, to scroll one view to match the value of the other?

        M Offline
        M Offline
        MS_GX
        wrote on last edited by
        #3

        @JonB Oh, that was easy using your suggestion. Was hunting much more complex solutions :(

        Thanks much!!

        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