I was wondering (if possible) how to make my tabs look like this attachment.
It looks like the left side is rounded and right side is triangular - what the heck?
Please, help.
I was wondering (if possible) how to make my tabs look like this attachment.
It looks like the left side is rounded and right side is triangular - what the heck?
Please, help.
simple subclass QTabBarand do the painting yourself!
Thanks for that recommendation. Is there any examples or tutorials online for painting?
Qt Assistant is always a good point to start: http://doc.trolltech.com/4.6/examples-painting.html.
FoleyX90 (3rd May 2010)
Having trouble performing: TabNavigator->setTabBar(myTabBar);
You have to derive from QTabWidget and QTabBar to do what you are trying to do.
It works if, in qtabwidget.h, i move settabbar from protected to public.
Yea, but then you are breaking your license agreement. So if you extend QTabWidget, then you can call setTabBar in the constructor. Problem solved.
This is probably horribly wrong (seeing as it doesn't work) but this is what i've put:
Qt Code:
#ifndef MYTABWIDGET_H #define MYTABWIDGET_H #include <QTabWidget> #include <QTabBar> { public: }; #endif // MYTABWIDGET_HTo copy to clipboard, switch view to plain text mode
The cpp file:
Qt Code:
#include "mytabwidget.h" #include <QTabWidget> { }To copy to clipboard, switch view to plain text mode
That should work, but i would do it more along these lines
Qt Code:
{ setTabBar(new MyTabBar(this)); }To copy to clipboard, switch view to plain text mode
Bookmarks