Chapter 9. QObject

An important class to become familiar with is the one from which all Qt Widgets are derived: QObject.

9.1

QObject’s Child Managment

194

9.2

Composite Pattern: Parents and Children

196

9.3

QApplication and the Event Loop

200

9.4

Q_OBJECT and moc: A Checklist

209

9.5

Values and Objects

210

9.6

tr() and Internationalization

211

We will refer to any object of a class derived from QObject as a QObject. Here is an abbreviated look at its definition.

class QObject {
  public:
    QObject(QObject* parent=0);
    QObject * parent () const;
    QString objectName() const;
    void setParent ( QObject * parent );
    const ObjectList & children () const;
    // ... more ...
};

The first interesting thing that we observe is that QObject’s copy constructor is not public. QObjects are ...

Get An Introduction to Design Patterns in C++ with Qt 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.