An important class to become familiar with is the one from which all Qt Widgets are derived: QObject. In this chapter, the authors discuss the QObject class in Qt4.
An important class to become familiar with is the one from which all Qt Widgets are derived: QObject. In this chapter, the authors discuss the QObject class in Qt4.
So they basically copied Delphi/Object Pascal’s TObject with some container features?
There’s a saying:
“Great minds think alike”
Who says they copied it?
Maybe the way Delphi and Qt implement the object class is one of the better ways to do it? The bonus is that it’s extremely easy to switch between the two api’s.
A car has four wheels and a steering wheel.
It makes no sense to create a car with one wheel and no steering wheel. If you know what I mean.
So they basically copied Delphi/Object Pascal’s TObject with some container features?
Oh no, obviously they copied XMotif’s Composite object class ๐
http://www.vaxination.ca/motif/Composite_3X.html
The parent-child pattern is pretty old, particularly with GUI toolkits. QObject makes use of this, with some nifty support for signals and slots, introspection and i18n too.
Yes but the Delphi version is better.
Yes but the Delphi version is better.
How so?
Mitarai: Yes but the Delphi version is better.
Chicken Blood: How so?
Well, from the comments I read from Mitarai I get the impression that his reasoning might be: “Because it’s not Qt” ๐
But I too would be interested to read about how QObject could be improved, as I have not missed much yet.
Anyone?