PDA

View Full Version : GUI design opinion



agarny
29th July 2011, 10:51
Hi, I am currently trying to come up with a GUI solution for my application. Basically, my application can open one or several files. My application works in three different modes and then, within each mode, I can have one or several ways of interacting with a particular file (I call those ways: views).

So, the way I am currently thinking of it is by having a QGridLayout with has two rows and two columns:
- r0c0: a QTabWidget used to select the mode in which I want to operate;
- r0c1: a QTabWidget which is used to display different files depending on the mode and view selected;
- r1c0: nothing; and
- r1c1: a QTabWidget which tabs depend on the selected mode (see row 1, column 1), and which is used to select a particular view for the file.

Though I am happy with the overall GUI design (opinions on it are still welcome though!), I have two issues related to the use of a QTabWidget object in r0c0 and r1c1. Indeed, what is of interest to me in those QTabWidget objects are the tabs themselves, not the contents. This is why the size policy of those two objects is set to Minimum so that we 'only' see the tabs and nothing more. However, this doesn't quite work as I would like. I mean that if you look at the first attachment:

6721

You will see that the two QTabWidget objects render a 'bar' to the right / above the tabs. Also, there is a gap between r0c0 and r0c1, and r1c1 and r0c1. Ideally, both of those bars and the gap wouldn't be there... i.e. something similar to the second attachment (after manually editing the first attachment):

6720

So, my question is how would you personally go about doing what I am after?...

Cheers, Alan.

wysota
29th July 2011, 18:08
Maybe you should use QTabBar instead of QTabWidget?

agarny
30th July 2011, 12:31
Yes, indeed, that's what I was told by someone else and what I have ended up doing. It's not 100% 'clean' (rendering wise), but much better than using QTabWidget, no question about it.