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.
  • sngqtS Offline
    sngqtS Offline
    sngqt
    wrote on 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      • sngqtS Offline
        sngqtS Offline
        sngqt
        wrote on 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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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
          • sngqtS Offline
            sngqtS Offline
            sngqt
            wrote on last edited by sngqt
            #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
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on 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

              • Login

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