The QObject class is the base class of all Qt objects that can deal with signals, slots and events. (details) (complete member list)
#include <qobject.h>
Inherited by QAccel, QSenderObject, QSignal, QTimer and QWidget.
Qt uses a very powerful mechanism, signals that are connected to slots, for communication between objects. An object has zero or more signals and zero or more slots, and a signal may be connected to a slot in any object.
When an object has changed in some way that might be interesting, it emits a signal to tell whoever is interested. If that signal is connected to any slots, those slots get called.
That is. the calling or emitting object doesn't need to know or care what slot the signal is connected to. It works much like the traditional callback mechanism, but it isn't necessary to write null pointer checks or for loops all the time.
QScrollBar is a good example. In order to use it, you create a scroll bar, connect its newValue() signal to a slot which e.g. scrolls your widget. Then, if it suits you, you can connect e.g. QScrollBar::nextLine() to a suitable slot. nextLine() is useless in most cases but if you need it, it's there.
Constructs an object with parent objects parent and a name.
The parent of a widget may be viewed as the object's owner. For instance, a dialog box is the parent of the "ok" and "cancel" buttons inside it.
An object destroys its child objects when it is destroyed itself.
Sending a null pointer as parent makes an object with no parent. If the object is a widget, it will become a top-level window.
The name is not used at present.
See also: destroy(), destroyed(), name(), QWidget.
Destroys the object and all its children objects.
All signals to and from the object are automatically disconnected.
Returns a pointer to a list of this object's children. High priority children are first on the list.
This function is not for the inexperienced.
See also: insertChild(), removeChild(), parent().
Returns this object's type as an ASCII string. This is the actual type, not what the object is used as:
QRadioButton * rb = new QRadioButton( parent, "example" );
Button * b;
b = rb;
ASSERT ( strcmp( b->name(), "example" ) == 0 )
ASSERT ( strcmp( b->className(), "QRadioButton" ) == 0 )
This happens through the magic of the moc.
See also: name().
Connects signal from object sender to member in this object.
Disconnects signal from member of receiver.
Disconnects all signals in this object from member of receiver.
To do:
Disconnects signal in object sender from member in object receiver.
If signal is null, disconnect() breaks any connections that pass the other tests.
If member is null, disconnect() breaks any connections that pass the other tests.
If receiver is null, disconnect() breaks any connections that pass the other tests.
See also: connect().
Returns TRUE if the object is high priority. High priority objects are placed first in an object's list of children, on the assumption that they'll be referenced very often.
Currently only QAccel is high priority.
Returns TRUE if this object is an istance of a class that inherits clname. (A class is considered to inherit itself.)
QTimer *t = new QTimer; // QTimer inherits QObject
t->inherits("QTimer"); // returns TRUE
t->inherits("QObject"); // returns TRUE
t->inherits("QButton"); // returns FALSE
This function may be used to determine whether a given object
supports certain features. Qt uses it to implement keyboard
accelerators, for instance: A keyboard accelerator is an object for
which inherits("QAccel")
is TRUE.
See also: isA().
Adds an event filter to the list.
See also: removeEventFilter(), eventFilter(), event().
Returns TRUE if the object is a widget, FALSE if not.
Returns a pointer to this object's meta object. The meta object is generated by the meta object compiler, and is used for e.g. signals, slots, inherits(), isA().
Returns the name of this object.
See also: setName().
Returns a pointer to this object's parent.
This function is not for the inexperienced.
See also: children().
Removes an event filter from the list.
See also: installEventFilter(), eventFilter(), event().
This functions has not yet been documented; see our home page for updates.
Returns TRUE if this object is currently not accepting signals.
See also: blockSignals().
This file is part of the Qt toolkit, copyright 1995 Troll Tech, all rights reserved.
It was generated from the following files: