0

I have a custom QTabWidget and a custom QTabBar. Everything is working fine and I can go through the tabs and stuff. But the thing is, I wanna put the QTabBar in a different layout than the QTabWidget. This way I can make a Menu Bar type of layout where I have the tabs and a couple differnt QPushButtons next to it all going left to right in the same row aligned.

So, basically can I move the QTabBar into a separate QHBoxLayout or QGridLayout away from the tab widget, but keep the functionality?

David Ludwig
  • 967
  • 2
  • 12
  • 26
  • You can treat `QTabBar` as a widget and place it in any layout you want. Its functionality does not depend on where it is placed. – vahancho Apr 23 '14 at 07:01
  • Ok well I guess I should've mentioned this in the question as well. I have already placed it in a separate layout but once I click a tab, the tab bar moves back to position and I don't know why. – David Ludwig Apr 23 '14 at 07:10
  • Ok nevermind I got it to stop moving now. Thanks allot! – David Ludwig Apr 23 '14 at 07:15
  • One more thing I have a HUGE margin above the tab widget now. You know how I can get rid of that? – David Ludwig Apr 23 '14 at 07:20
  • I do not see the layout, but you can try to play with `QLayout::setContentsMargins()` and `QWidget::setContentsMargins()`. – vahancho Apr 23 '14 at 07:27
  • That was the first thing I tried and then I tried some css but nope. – David Ludwig Apr 23 '14 at 07:35

0 Answers0