Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, November 2007
Tab Position


Message 1 in thread

I create patch for change text position to horizontal on vertical tab position.

Old vertical tabs with vertical text:
http://www.nuos.edu.ua/~pavel/psi/psi-win1.PNG

New vertical tabs with horizontal text:
http://www.nuos.edu.ua/~pavel/psi/psi1.jpg
http://www.nuos.edu.ua/~pavel/psi/psi-win2.PNG



qt4-patch.tar.gz  for  qt-x11-opensource-src-4.3.2

I patched 3 files:
/src/gui/styles/qcommonstyle.cpp
/src/gui/widgets/qtabbar.cpp
/src/gui/widgets/qtabwidget.cpp

I'ill try to add new const QTabWidget::TabPosition:
QTabWidget::West_Horiz
QTabWidget::East_Horiz

Is is good or bad?

Attachment:

Attachment: qt4-patch.tar.gz
Description: GNU Zip compressed data


Message 2 in thread

El Viernes 02 Noviembre 2007, C. H. escribiÃ:
> I create patch for change text position to horizontal on vertical tab
> position.
>
> Old vertical tabs with vertical text:
> http://www.nuos.edu.ua/~pavel/psi/psi-win1.PNG
>
> New vertical tabs with horizontal text:
> http://www.nuos.edu.ua/~pavel/psi/psi1.jpg
> http://www.nuos.edu.ua/~pavel/psi/psi-win2.PNG
>
>
>
> qt4-patch.tar.gz  for  qt-x11-opensource-src-4.3.2
>
> I patched 3 files:
> /src/gui/styles/qcommonstyle.cpp
> /src/gui/widgets/qtabbar.cpp
> /src/gui/widgets/qtabwidget.cpp
>
> I'ill try to add new const QTabWidget::TabPosition:
> QTabWidget::West_Horiz
> QTabWidget::East_Horiz
>
> Is is good or bad?

At least the images are nice :-)

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 3 in thread

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

C. H. wrote:
> I create patch for change text position to horizontal on vertical tab position.

> Is is good or bad?

I prefer how it looked to start with, but having a choice is never a bad
thing.

- --
Jonathan Brady
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHLFEzN8xRV9hCNWcRAos/AJsHkQsg+ZVwlulL4+8PMKaPsQRmjwCgqpj8
OF6pum81Je7DEHhSATLNOEg=
=HXj7
-----END PGP SIGNATURE-----

--
 [ signature omitted ] 

Message 4 in thread

On lørdag den 3. November 2007, Jonathan Brady wrote:
> C. H. wrote:
> > I create patch for change text position to horizontal on vertical tab
> > position.
> >
> > Is is good or bad?
>
> I prefer how it looked to start with, 

Me too.

> but having a choice is never a bad thing.

Wrong. Creeping featurism hurts by making the API more complex and make the 
code less maintainable. In applications, it's the users who are hurt because 
they have more features to search through (think: Nope, that wasn't the right 
feature either...).

There's a reason most people tell you to strive for minimal but complete 
interfaces.

However, in Qt, I would like to see more possibilities of changing the widgets 
by subclassing them. Too often, we hit the dreaded private d-pointer when 
searching for the right information or place to hook in.

Bo.

-- 
 [ signature omitted ] 

Message 5 in thread

Bo Thorsen wrote:

> However, in Qt, I would like to see more possibilities of changing the
> widgets by subclassing them. Too often, we hit the dreaded private
> d-pointer when searching for the right information or place to hook in.
Hear! Hear!

This whole craze towards putting everything in the d-pointer (which has
infected KDE as well) makes subclassing virtually useless in a lot of
cases. Not really the idea of an object oriented language such as C++.

André

-- 
 [ signature omitted ] 

Message 6 in thread

On mandag den 5. November 2007, André Somers wrote:
> Bo Thorsen wrote:
> > However, in Qt, I would like to see more possibilities of changing the
> > widgets by subclassing them. Too often, we hit the dreaded private
> > d-pointer when searching for the right information or place to hook in.
>
> Hear! Hear!
>
> This whole craze towards putting everything in the d-pointer (which has
> infected KDE as well) makes subclassing virtually useless in a lot of
> cases. Not really the idea of an object oriented language such as C++.

Well, they don't do this without reasons. The d-pointer pattern has a number 
of advantages:

- It makes it possible to add or remove attributes without changing the 
signature of the class.

- It removes the private things from the API, which means we have less clutter 
when looking at the code.

- It can cut down dramatically on development compile time because many 
includes can be moved from headers to implementation files.

The problem as I see it isn't really the use of the d-pointers. It's that 
there is no way to get to a lot of the information in them.

Bo.

-- 
 [ signature omitted ] 

Message 7 in thread

Bo Thorsen wrote:

> On mandag den 5. November 2007, André Somers wrote:
>> This whole craze towards putting everything in the d-pointer (which has
>> infected KDE as well) makes subclassing virtually useless in a lot of
>> cases. Not really the idea of an object oriented language such as C++.
> 
> Well, they don't do this without reasons. The d-pointer pattern has a
> number of advantages:
> 
> - It makes it possible to add or remove attributes without changing the
> signature of the class.
> 
> - It removes the private things from the API, which means we have less
> clutter when looking at the code.
> 
> - It can cut down dramatically on development compile time because many
> includes can be moved from headers to implementation files.

Yes, I am aware of the advantages and the arguments for using them, but, as
you say:

> The problem as I see it isn't really the use of the d-pointers. It's that
> there is no way to get to a lot of the information in them.
... there are severe disadvantages as well, making subclasses do anything
usefull very hard. At this moment the idea seems to be that as much stuff
as possible should be moved to the d-pointers. The problem with this is
that people using an API may not always want to do so in exactly the way
the creator of the API had envisioned. In fact, I think that's the whole
point of using subclassing: doing stuff differently or making existing
components usable in another context or another way. Using d-pointers
really limits the developers freedom to do just that. 

By the way, I don't really buy this argument:
> - It removes the private things from the API, which means we have less
> clutter when looking at the code.
The Qt API has grown considerably in recent times. I am not complaining
about the API, don't get me wrong, but I am not convinced that that in
itself has not resulted in clutter.

André

P.S. no need to CC me, I'm on the list (that is, the newsgroup interface)
-- 
 [ signature omitted ] 

Message 8 in thread

André Somers wrote:
>This whole craze towards putting everything in the d-pointer (which has
>infected KDE as well) makes subclassing virtually useless in a lot of
>cases. Not really the idea of an object oriented language such as C++.

It makes no difference if the members are in the d pointer or in the 
private section of the class: you cannot access them directly. You can 
only access what we provide accessors for.

However, we gain a lot by using the d pointers (see Bo Thorsen's reply).

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 9 in thread

Em Tuesday 06 November 2007 18:12:01 Scott Aron Bloom escreveu:
> Once an algorithm goes into the dptr nether world, there is no chance in
> changing the behavior without changing the TT code...

In most cases, this is what is intended.

In other words, where we foresee the need to change the behaviour, we'll make 
the necessary accessors public, or add virtual functions. You can look at 
QIODevice as an example or QWidget.

But where we don't see such need or when we haven't been able to clean the API 
up to allow it, we won't provide the hooks. The example here is a 
QIODevice-derived class: QAbstractSocket. That would still be true even if we 
weren't using d-pointers: member variables would be private and there would 
be a lot of private functions.

You would *still* not be able to access them without ugly hacks like:
#define private public
(which don't work on MSVC).

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 10 in thread

On tirsdag den 6. November 2007, Thiago Macieira wrote:
> Em Tuesday 06 November 2007 18:12:01 Scott Aron Bloom escreveu:
> > Once an algorithm goes into the dptr nether world, there is no chance in
> > changing the behavior without changing the TT code...
>
> In most cases, this is what is intended.
>
> In other words, where we foresee the need to change the behaviour, we'll
> make the necessary accessors public, or add virtual functions. You can look
> at QIODevice as an example or QWidget.

I can tell you that for QComboBox, you foresaw wrong. There's no end to the 
amount of times where I have written a widget that just uses the combobox 
style code for drawing - half the times the customer eventually decided 
against using it.

There's almost no room for changes to the behaviour of that widget. And I have 
seen Justin Noel write about the same problem, so I'm not alone on this.

Another example: I wrote a great (but evil) hack that allows QTabWidget to 
have the same widget in multiple tabs.

Don't even get me started on QGraphicsView. That class is written to the 
intended use, and is impossible to change.

Stylesheets have solved some of the problems that are present in the 
tableview. That class was *really* difficult to change the look of. But the 
other day, someone asked about a tableview that resizes in jumps, so the size 
always fits the rows. I haven't investigated it, but it sounds quite 
difficult to do.

Actually, I should be quite happy about this. My company makes a living being 
Qt experts, and I have lots of customers who hire us to do these kinds of 
tricks to get Qt to do all the things you didn't intend for it to do. But 
sometimes, it's just incredibly frustrating.

Bo.

-- 
 [ signature omitted ] 

Message 11 in thread

C. H. wrote:
> I create patch for change text position to horizontal on vertical tab position.
> 
> Old vertical tabs with vertical text:
> http://www.nuos.edu.ua/~pavel/psi/psi-win1.PNG
> 
> New vertical tabs with horizontal text:
> http://www.nuos.edu.ua/~pavel/psi/psi1.jpg
> http://www.nuos.edu.ua/~pavel/psi/psi-win2.PNG
> 
> 
> 
> qt4-patch.tar.gz  for  qt-x11-opensource-src-4.3.2
> 
> I patched 3 files:
> /src/gui/styles/qcommonstyle.cpp
> /src/gui/widgets/qtabbar.cpp
> /src/gui/widgets/qtabwidget.cpp
> 
> I'ill try to add new const QTabWidget::TabPosition:
> QTabWidget::West_Horiz
> QTabWidget::East_Horiz
> 
> Is is good or bad?

Good.

Thanks for the patch, keep them coming. I created 186458 to track your patch.

Girish

--
 [ signature omitted ]