PDA

View Full Version : width and height of QTabWidget



chikkireddi
29th October 2007, 06:22
Hi

I have created tabwidget using QTabWidget. I have added two tabs. TabBar width and height came with default size.
my question is:
1) How do I increase width and height of the TabBar

marcel
29th October 2007, 08:05
QTabBar inherits QWidget so you can use all dimensioning support in QWidget, such as QWiget::setMinimumHeight or QWidget::setFixedHeight.

chikkireddi
29th October 2007, 10:30
QWidget::setFixedHeight or QWidget::setFixedWidth sets the widget size , which i donot want.

I want to set the Tab bar size. not the whole widget size.

wysota
29th October 2007, 10:44
tab bar or a single tab? If the former, you can access the tab bar and change its dimensions. I doubt it will work the way you want, but you can try it anyway.

marcel
29th October 2007, 10:45
Yes, I know. Subclass QTabWidget and you will have access to the protected function QTabWidget::tabBar(), which returns the tabbar. You can then use the functions mentioned earlier to set its height.

chikkireddi
29th October 2007, 13:47
QTabWidget::tabBar() returns const QTabBar(). So I canot call setFixedSize() on QTabWidget::tabBar()

jpn
29th October 2007, 14:53
QTabWidget::tabBar() returns const QTabBar(). So I canot call setFixedSize() on QTabWidget::tabBar()
Actually it returns a non-const pointer to QTabBar, whereas the method is a const-method:

QTabBar* QTabWidget::tabBar() const