[Qt-interest] Margins in QTabWidget

Stan Warford Stan.Warford at pepperdine.edu
Sat May 2 17:14:00 CEST 2009


That did it. It is not obvious that you have to click in the Object  
Inspector. I usually shift click in the Gui window to cycle up the  
various parent widgets. Not only do you have to use the Object  
Inspector to select tab, if you shift click in the Gui window, Qt  
Designer will _skip_ the tab. It would be nice if future releases did  
not skip parent widgets on shift clicking.

This is a great list. Thanks!

> Hi Stan,
>
> You can do it both in designer as in code. I assume that every item  
> has a
> layout. Then you can select one of the tabs (This is not possible by
> clicking on a tab. You'll have to use the Object Inspector). At the  
> bottom
> of the Property Editor will be entries concerning the layout.  
> Changing these
> numbers will have the desired effect.
> If you want to do it in code, you'll have to use  
> QLayout::setContentsMargins
> on the layout for each tab.
>
> Hope it helps.
> Greets,
>
>
> 	Ben
>
>> Hello all,
>>
>> I cannot figure out how to change the margins for the children of a
>> QTabWidget. For example, in Qt Creator I have:
>>
>> MainWindow (QMainWindow)
>>     centralWidget (QWidget)
>>         tabWidget (QTabWidget)
>>             tab (QWidget)
>>                 textEdit (QTextEdit)
>>             tab_2 (QWidget)
>>
>> I want to shrink the space around textEdit inside the tab pane. There
>> appear to be no margin settings in ui designer that will do this. I
>> have tried manipulating all sorts of bounding rectangles within
>>
>> ui->tabWidget->childrenRect()
>> ui->tabWidget->childrenRegion()
>> ui->tab->childrenRect()
>> ui->tab->childrenRegion()
>> etc., etc.
>>
>> with a bunch of QRect move methods, but nothing seems to have any
>> effect on the margins.
>>
>> Thanks for any help.
>>
>> Stan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090502/5ddbe05f/attachment.html 


More information about the Qt-interest-old mailing list