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. Mixing absolute positionning with VBoxLayout

Mixing absolute positionning with VBoxLayout

Scheduled Pinned Locked Moved General and Desktop
10 Posts 2 Posters 2.2k Views 1 Watching
  • 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.
  • B Offline
    B Offline
    b62303411
    wrote on last edited by
    #1

    -------------------------Main Window -------------------------------

    @
    ---------- VBoxLayout------------------
    ------Resizable Widget----- <<< Handle to resize by drag up and down.
    -----------------------------------
    ------Resizable Widget-----
    -----------------------------------

    |

    @

    Hope my drawing is clear,, I need to be able to resize by dragging up and down different widget.

    The widgets are stack within a QVerticalLayout, .. this is basically a stack of resizable and dockable widget.

    I have many stack of QWidget, I need to be able to drag them off their current stack to other and also be able to drag up and down to change their individual size.

    The drag from one stack to an other is well covered. I just fail to resize folowing the mouse having the layout still active.

    @void ResizeGrip::mouseMoveEvent(QMouseEvent *event)
    {
    if (event->buttons() & Qt::LeftButton) {
    move(event->globalPos() - dragPosition);
    topPos=event->globalPos() - dragPosition;
    event->accept();
    resizeToFit();
    }
    }@

    When i work with the move alone and force geometry of the widget it folow perfectly the only problem is that the Layout stop working after, and if i do update gemoetry all my manual changes are discarted.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Wouldn't a "QSplitter":http://qt-project.org/doc/qt-5/qsplitter.html more suited for your design ?

      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
      • B Offline
        B Offline
        b62303411
        wrote on last edited by
        #3

        Well I thought about it, but a spliter is made to divide space, like between windows.. in this case if the bottom widget is push up .. the other need to float above not be resized. It would work well with Spring Layout.. but the entire code is with QWidget and Achor layout .. is only with QGraphics objects..

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          In that case you should probably either create your own layout manager or manage the widgets yourself. The current layouts available for widgets are all handling the resizing of their content.

          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
          • B Offline
            B Offline
            b62303411
            wrote on last edited by
            #5

            yea i was really affraid of that.. I whant it to only manage position.. vertically.. and size horizontally.. the crazy thing is that this is the 3rd time in 3 language different for 3 company different that i had to implement that type of behavior you would think that something common like that would have more support but every time its allot if gymnastic to get it to work.. thanks for the help.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Can you give me an example of a widget based software that uses this kind of functionality ?

              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
              • B Offline
                B Offline
                b62303411
                wrote on last edited by
                #7

                Grammar editor.. for voice recognition system.. where all the alternatives are some sort of Form(edition and display widget).. are listed on top of each other.. ore just imagine that you have a Blog application where you whant to be able to reorder and resize all the posts..

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Isn't it more like an mdi application ?

                  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
                  • B Offline
                    B Offline
                    b62303411
                    wrote on last edited by
                    #9

                    Yes and no... very similar in many way every item in the list can indeed be seen as a document.. but the whanted display behavior is a bit complex.. My first try was to put the elements into a QList.. to give you an idea of how they should appear, The order of the elements have meaning, and they really should appear in a list.. its even possible to move elements from one list to an other with drag and drop operation.. the various list are themself within similar list layout.. and can them self be moved from one stack to an other by drag and drop and be resized as well..

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      I see what you mean.

                      You should also have a look at the Model/View Framework

                      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