Results 1 to 3 of 3

Thread: Resizable widgets using mouse

  1. #1
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Resizable widgets using mouse

    hello, I want to add possibility to resize width of widgets in layout using mouse.
    I mean... to put mouse between this two widgets, drag and move left/right changing the width of widgets. How can I do that?
    Attached Images Attached Images

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Resizable widgets using mouse

    read about QSplitter

  3. #3
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Resizable widgets using mouse

    It looks good, but I have a problem with width of this objects. I want to have widths for example: 200px (first widget), 200px (last widget) and the rest of width to the second object. I wrote:

    Qt Code:
    1. MainSplitter = new QSplitter(Qt::Horizontal, ui->centralWidget);
    2. MainSplitter->insertWidget(0, ui->projectsTab);
    3. MainSplitter->insertWidget(1, ui->filesTab);
    4. MainSplitter->insertWidget(2, ui->detailsTab);
    5.  
    6. ui->projectsTab->setGeometry(0,0, 500, 100);
    To copy to clipboard, switch view to plain text mode 

    but I get the window does not look like I want to look
    Attached Images Attached Images

Similar Threads

  1. movable and resizable label
    By mind_freak in forum Qt Programming
    Replies: 0
    Last Post: 11th December 2010, 07:29
  2. Widget Resizable Border
    By ale6111 in forum Qt Programming
    Replies: 3
    Last Post: 22nd July 2010, 17:20
  3. Replies: 2
    Last Post: 10th June 2010, 05:58
  4. I need help designing a resizable widget
    By aarelovich in forum Qt Tools
    Replies: 2
    Last Post: 17th February 2009, 18:01
  5. Resizable Frames/Layouts
    By VireX in forum Newbie
    Replies: 19
    Last Post: 19th March 2007, 00:59

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
  •  
Qt is a trademark of The Qt Company.