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. QGraphicsWidget sizing and expand direction in QGraphicsLinearLayout

QGraphicsWidget sizing and expand direction in QGraphicsLinearLayout

Scheduled Pinned Locked Moved Unsolved General and Desktop
qgraphicsview qqgraphicswidgetqgraphicsitem
6 Posts 2 Posters 2.4k 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.
  • S Offline
    S Offline
    sngqt
    wrote on 30 Oct 2015, 15:21 last edited by sngqt
    #1

    I had a QGraphicsWidget with QGraphicsLinearLayout assigned to it. The layout contains many QGraphicsWidget items. I want to re-size each individual QGraphicWidget by dragging either its left edge or its right edge.

    -When I drag the right edge, I want QGraphicsWidget expand its size to the right and shift other widgets (from the right side of current adjusting widget). This can be achieved easily because of the default behavior of QGraphicsLinearLayout.

    -When I drag the left edge, I want QGraphicsWidget expand its size to the left and shift other widgets (from the left side of current adjusting widget).

    Illustration diagram

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 30 Oct 2015, 22:50 last edited by
      #2

      Hi and welcome to devnet,

      That sounds rather like a QSplitter behavior, one between each widget

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sngqt
        wrote on 2 Nov 2015, 16:56 last edited by
        #3

        Hi SGaist,
        Does GraphicsView / GraphicsScene have that built-in behavior?
        Think I can subclass QGraphicsLayout .
        In the worst case , i have to manually keep track of item's coordinates by myself.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 2 Nov 2015, 21:29 last edited by
          #4

          AFAIK, no

          Wouldn't using QSplitter and only one QGraphicsWidget with be simpler ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sngqt
            wrote on 2 Nov 2015, 22:35 last edited by sngqt 11 Feb 2015, 22:35
            #5

            Thanks for response.
            Can you please go a bit more detail?
            How would you add QSplitter (QWidget based) into QGraphicsLinearLayout?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 2 Nov 2015, 22:37 last edited by
              #6

              No, my idea was to build your set of resizable widgets with QSplitter and then add that QSplitter to your scene

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              6/6

              2 Nov 2015, 22:37

              • Login

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