Results 1 to 5 of 5

Thread: Setting width of widgets from QSplitter?

  1. #1
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Setting width of widgets from QSplitter?

    I am using QSplitter to set a sliding menu on android, but I cannot hide the widget from left screen.
    Tried using QSplitter::setSizes and setStretchFactor but nothing. Any help?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Setting width of widgets from QSplitter?

    Can you give a bit more substance on what you are seeing, what your code looks like and what you want to see?

    Cheers,
    _

  3. #3
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Setting width of widgets from QSplitter?

    So I want, when the application starts, the left widget to be hidden until the user drags the spliiter handle.
    Attached Files Attached Files
    Last edited by adutzu89; 22nd May 2014 at 09:23.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Setting width of widgets from QSplitter?

    I don't see where you cal setSizes() in there.

    So I added one, using 0 for the first size, and, as expected, the left widget is collapsed.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    adutzu89 (24th May 2014)

  6. #5
    Join Date
    Oct 2013
    Posts
    142
    Thanks
    36
    Thanked 3 Times in 3 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Setting width of widgets from QSplitter?

    Can't remember what I've done wrong, but it works.......thank you.

Similar Threads

  1. Arrange Widgets in QSplitter
    By vinodpaul in forum Newbie
    Replies: 3
    Last Post: 7th September 2012, 10:17
  2. QSplitter and re-arranging widgets within
    By poppenspeler in forum Newbie
    Replies: 1
    Last Post: 19th October 2011, 21:48
  3. why the QSplitter cannot show the width as I specified?
    By superwave in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2011, 05:50
  4. How to set Widgets sizes with in QSplitter
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2007, 07:38
  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.