Results 1 to 2 of 2

Thread: Separator in box layout

  1. #1
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Separator in box layout

    Is there an easy way to get a thin line between two widgets in a box layout?
    (such as the one between the menu bar and the central widget in a QMainWindow)

  2. #2
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Separator in box layout

    Why not use a QFrame in the shape of a line?

    Qt Code:
    1. QFrame* line = new QFrame();
    2. line->setFrameShape(QFrame::HLine);
    3. line->setFrameShadow(QFrame::Sunken);
    4. boxLayout->addWidget(line);
    To copy to clipboard, switch view to plain text mode 

    You can put that into the layout.

  3. The following 4 users say thank you to ntp for this useful post:

    drhex (30th September 2009), FelixB (16th May 2013), mattc (1st October 2009), nilot (9th December 2016)

Similar Threads

  1. Resizing dialog with form layout
    By elizabeth.h1 in forum Qt Programming
    Replies: 2
    Last Post: 30th August 2009, 19:58
  2. changing layout of a widget
    By mikro in forum Qt Programming
    Replies: 10
    Last Post: 4th August 2009, 20:21
  3. Qt like Layout Manager available for .NET platform
    By vkhaitan in forum Qt Programming
    Replies: 0
    Last Post: 5th November 2008, 13:36
  4. Qt layout memory issue
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 25th August 2007, 17:11
  5. Resizing problems when applying a layout
    By JimBrown in forum Newbie
    Replies: 1
    Last Post: 21st February 2007, 22:54

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.