PDA

View Full Version : setResizeMode for Splitter



ropel
27th June 2008, 16:56
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:


this->UI->setResizeMode(this->UI->dockWidget, QSplitter::KeepSize);

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

(QT + CMake setup, using QTDesigner)

Anyone have a solution?

Thanks.

mcosta
27th June 2008, 17:05
Post your CMakeLists.txt
Probably you have to add this


SET(QT_USE_QT3SUPPORT TRUE)

before


USE(${QT_USE_FILE})


If you don't want use Q3Support library you can use


this->UI->setStretchFactor(this->UI->indexOf(this->UI->dockWidget), 0);

instead of


this->UI->setResizeMode(this->UI->dockWidget, QSplitter::KeepSize);

ropel
30th June 2008, 13:19
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

ropel
1st July 2008, 09:56
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