Results 1 to 4 of 4

Thread: setResizeMode for Splitter

  1. #1
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question setResizeMode for Splitter

    Hi,

    I'm trying to create a splitter between a QTabWidget and a QDockWidget.
    I want the QDockWidget to keep a fixed height while resizing, but the splitter should of course remain functional.

    I found that I should use setResizeMode, so I put:

    Qt Code:
    1. this->UI->setResizeMode(this->UI->dockWidget, QSplitter::KeepSize);
    To copy to clipboard, switch view to plain text mode 

    However I get the error that QSplitter::KeepSize is not a member of QSplitter.

    (QT + CMake setup, using QTDesigner)

    Anyone have a solution?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setResizeMode for Splitter

    Post your CMakeLists.txt
    Probably you have to add this
    Qt Code:
    1. SET(QT_USE_QT3SUPPORT TRUE)
    To copy to clipboard, switch view to plain text mode 
    before
    Qt Code:
    1. USE(${QT_USE_FILE})
    To copy to clipboard, switch view to plain text mode 

    If you don't want use Q3Support library you can use
    Qt Code:
    1. this->UI->setStretchFactor(this->UI->indexOf(this->UI->dockWidget), 0);
    To copy to clipboard, switch view to plain text mode 
    instead of
    Qt Code:
    1. this->UI->setResizeMode(this->UI->dockWidget, QSplitter::KeepSize);
    To copy to clipboard, switch view to plain text mode 
    Last edited by mcosta; 27th June 2008 at 16:07. Reason: updated contents
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setResizeMode for Splitter

    Ok, I'll try that soon.

    So I guess this has been changed moving from QT3 to QT4. Yet the code completion still finds setResizeMode, probably from the backward compatibility libraries.

    Thanks

  4. #4
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setResizeMode for Splitter

    Ok, setStretchMode indeed helps, and can also be set from the Designer.

    However, the listView or tableView widget keep a fixed height, without setting a minimumHeight. I would like to have it smaller, what can I do?

    Situation is

    QSplitter
    >> QTabWidget
    >> QDockWidget
    >> > QTableWidget or QListWidget

    Regards,

    Roy
    Last edited by ropel; 1st July 2008 at 09:24.

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.