PDA

View Full Version : Firefox-like tabs



sdfisher
7th March 2007, 21:33
I'm trying to build Firefox/Mac OS X-type tabs: Basically, icons along the top of the window with textual labels.

I used the ConfigDialog example as a starting point. I was unable to find a way to have the icons run across instead of up and down. I changed to a QTableWidget, and was able to get this working. However, I have not been able to figure out how to make the icon in a cell appear above the cell's text instead of to the left of it. I don't want to use two rows because I'm concerned I won't be able to maintain the illusion that only one cell is selected.

Is QTableWidget the right approach?

wysota
7th March 2007, 21:44
How about using QTabWidget (or QTabBar) instead?

sdfisher
8th March 2007, 01:05
I don't think I can hide the tabs and just leave the icon and title bare using Qt's tab controls. I want the icon bar look rather than a tab look. Is that possible? It would sure be a lot less work!

rajesh
8th March 2007, 08:12
Hi,
what is different in Firefox tabs?
I made tab bar with close button using QTabWidget.
if you think that code will help you then I can send you that code.

Thanks & Regards
Rajesh

wysota
8th March 2007, 11:52
Are we talking about the tabs that are present in firefox which you add by using "Ctrl+T" shortcut? Or maybe you mean some other tabs which we're not aware of... What do you mean by "icon bar look"? A QToolBar maybe?

sdfisher
8th March 2007, 15:20
You're right, I'm not explaining myself properly. I forgot about Firefox's tabbed browsing! Stupid, because I use that all the time. Although come to think of it, I think Firefox might do different things on different platforms...

This is what I was talking about:
http://indiehig.com/wiki/Image:Finder_prefs.png

wysota
8th March 2007, 17:25
The simplest way is to go for QToolBar or a QButtonGroup.

The latter in its basic form will look like in the attachment.

sdfisher
10th March 2007, 06:51
It took me until today to be sure, but it looks like a QToolbar tied to a QActionGroup will do almost exactly what I need.