Results 1 to 2 of 2

Thread: QSplitter and re-arranging widgets within

  1. #1
    Join Date
    Oct 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QSplitter and re-arranging widgets within

    Hiho!

    I want to be able to drag a widget from one position inside a splitter to another position in the same splitter.

    For example: i have a vertical splitter and if i dragged a widget up (or down) wards the space that this widget occupied should be taken by the widget above (or below) it thus giving room to drop the dragged widget there. also i should not be able to drag a widget outside of the splitters boundaries.
    What do i have to do to accomplish this?

    I am rather new to Qt and using verision 4.7.

    Best regards

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplitter and re-arranging widgets within

    1. reimplement mousePressEvent and mouseMoveEvent in your splitter to initiate the drag operation (refer to the various drag and drop examples in the docs for more details)
    2. use QWidget::childAt to determine which child to move
    3. use QSplitter::insertWidget to do the actual move
    Use the docs Luke
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. Size proportions of widgets in QSplitter
    By Boron in forum Qt Programming
    Replies: 2
    Last Post: 9th October 2009, 18:25
  2. How to remove widgets from QSplitter?
    By mcb in forum Qt Programming
    Replies: 2
    Last Post: 23rd July 2009, 06:10
  3. How to set Widgets sizes with in QSplitter
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2007, 07:38
  4. QSplitter - Remove Widgets?
    By durbrak in forum Qt Programming
    Replies: 1
    Last Post: 10th December 2006, 12:17
  5. Remove widgets from a QSplitter
    By blukske in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2006, 10:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.