O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

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

Allowed item types

Not all types can be put in containers. All containers can only hold types that provide a default constructor, a copy constructor, and an assignment operator. All primitive types and most Qt data types (such as QString or QPointF) satisfy these requirements. Simple structs also can be stored in a container because the required constructors and operators are generated for them automatically, as per C++ standard.

A particular type usually cannot be put in a container because it doesn't have a constructor without arguments or copying this type was deliberately disabled. This is actually the case for QObject and all its descendants. The usage patterns of QObject suggest that you usually want to store pointers to a QObject

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