Results 1 to 3 of 3

Thread: QSplitter::setChildrenCollapsible doesn't work

  1. #1
    Join Date
    Nov 2009
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default QSplitter::setChildrenCollapsible doesn't work

    Even if I set in my splitter the property "childrenCollapsible" to false the user can resize the child-widgets to zero. Does anybody know why? Do i need to set other properties too?
    (I'm using QT4.5.3 with MSVC2008 in WindowVista)

  2. #2
    Join Date
    Nov 2007
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSplitter::setChildrenCollapsible doesn't work

    It should work if you call it manually:
    Qt Code:
    1. ui.setupUi();
    2. ui.splitter->setChildrenCollapsible(false);
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Nov 2009
    Posts
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSplitter::setChildrenCollapsible doesn't work

    Well, actually, I've tried it but it isn't the solution to the problem (the "setupUi" function already calls the "setChidlrenCollapsible"... so, there is no need to call it again").

    Anyway, I found the problem. It was my fault (of course... hehe). In my program I'm using the functions "readSettings" and "writeSeetings" to save some info into the registry and reload them at the next use:

    setupUi(this);
    readSettings();

    In details, I save/load the splitter-sizes too. The problem is that I use the functions "saveState"/"restoreState" to do that. The "saveState" function saves not only the sizes of the splitter (the Qt-documentation doesn't explain the meaning of "state" of a QSplitter). I suppose it saves the property "ChildrenCollapsible" too.
    So, even if I changed (using the designer) the initial value of that property, I was always using the value stored in the registry (at the begin of the project the value of that property was TRUE).

    So the solution is not to use the functions "saveState"/"restoreState" (I only need to load/save the sizes, so I wrote two function to save/restore only the sizes).

    Thanks, anyway
    bye bye...

Similar Threads

  1. Making MySQL plugin work on a windows x86 enviroment
    By Baasie in forum Installation and Deployment
    Replies: 1
    Last Post: 2nd September 2009, 15:15
  2. getting MySQL to work with Qt
    By Ashish in forum Installation and Deployment
    Replies: 7
    Last Post: 19th May 2009, 08:57
  3. Qt4 : QPainter::setRedirected doesn't work
    By Ankitha Varsha in forum Qt Programming
    Replies: 2
    Last Post: 20th June 2008, 17:52
  4. QActions don't work with menubar hidden
    By Pepe in forum Qt Programming
    Replies: 1
    Last Post: 16th August 2007, 01:04
  5. Change work area OS
    By pakulo in forum Qt Programming
    Replies: 15
    Last Post: 15th May 2007, 07:20

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.