Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved QGraphicsWidget sizing and expand direction in QGraphicsLinearLayout

    General and Desktop
    qgraphicsview q qgraphicswidget qgraphicsitem
    2
    6
    1745
    Loading More Posts
    • 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.
    • sngqt
      sngqt last edited by sngqt

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • sngqt
          sngqt last edited by

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • sngqt
              sngqt last edited by sngqt

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

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 0
                • First post
                  Last post