[Qt-interest] Making a table in a form the same width as the tab within which the form is placed

Robert Wood robert.wood at apostrophe.co.uk
Sat Mar 13 18:06:10 CET 2010


I have an application where, in the main window, I have a dock widget 
which is anchored to the the left of the window, then I have placed a 
QTabWidget and made that expand to the size the user makes the main 
window by using setCentralWidget.

I am then allowing the user to open different tabs and have different 
forms I have created put within each new tab. Now, in some of the forms 
that are placed within the tabs, I have tables which can have many 
columns. What I would like to do is have the width of the table expand 
and contract to the width of its containing tab as the user expands and 
contracts the width of the main window, therefore expanding and 
contracting the QTabWidget. I guess I am looking for the equivalent of 
setCentralWidget within the form (which is really a QWidget isn't it?) 
which is placed within the QTabWidget. Would that be right?

I've tried Googling, but I'm not really sure how to word it and a 
verbose description like this is a bit much for Google. ;~)

Many thanks,

Rob



More information about the Qt-interest-old mailing list