O'Reilly logo

An Introduction to Design Patterns in C++ with Qt 4 by Paul Ezust, Alan Ezust

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required