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. Best practice: resize Widgets with mouse

Best practice: resize Widgets with mouse

Scheduled Pinned Locked Moved Solved General and Desktop
framelessresize
4 Posts 2 Posters 14.0k 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.
  • T Offline
    T Offline
    the_
    wrote on 13 May 2016, 10:42 last edited by
    #1

    Hi all,

    what is the best/easiest way to resize a (frameless) QWidget (any, but in a special case a QListWidget, that is not part of a layout) by mouse? (snap for example the lower right corner, click and move)

    -- No support in PM --

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 13 May 2016, 10:50 last edited by
      #2

      Hi
      Best is hard to define. :)
      easist, find some code and reuse :)

      This one did it with
      https://forum.qt.io/topic/66586/make-a-frameless-qwidget-resizable-with-qrubberband/18

      alternativ
      http://stackoverflow.com/questions/26281192/qt-resizing-a-ui-element-with-the-mouse
      Which is dead simple but dont fit all use cases.

      T 1 Reply Last reply 13 May 2016, 11:23
      1
      • M mrjj
        13 May 2016, 10:50

        Hi
        Best is hard to define. :)
        easist, find some code and reuse :)

        This one did it with
        https://forum.qt.io/topic/66586/make-a-frameless-qwidget-resizable-with-qrubberband/18

        alternativ
        http://stackoverflow.com/questions/26281192/qt-resizing-a-ui-element-with-the-mouse
        Which is dead simple but dont fit all use cases.

        T Offline
        T Offline
        the_
        wrote on 13 May 2016, 11:23 last edited by
        #3

        @mrjj

        Thanks for this fast answer.
        QSizeGrip looks pretty simple and is a quick (but not dirty) solution :)

        -- No support in PM --

        M 1 Reply Last reply 13 May 2016, 11:28
        1
        • T the_
          13 May 2016, 11:23

          @mrjj

          Thanks for this fast answer.
          QSizeGrip looks pretty simple and is a quick (but not dirty) solution :)

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 13 May 2016, 11:28 last edited by
          #4

          @the_
          Yep its a nice few liners and not really dirty as sizegrip is made for such task so
          its not abuse or anything :)
          But sometimes having the grip there can be issue.

          1 Reply Last reply
          0

          2/4

          13 May 2016, 10:50

          • Login

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