Details
-
Task
-
Resolution: Done
-
P3: Somewhat important
-
None
-
Qt 4.7. GNU/Linux Kubuntu 10.10 x86_64. APT package: qt4-doc 4:4.7.0-ubuntu4
Description
In the following snippet from the example in the detailed description of QMetaType:
int id = QMetaType::type("MyClass");
if (id == 0) {
...
The if condition is wrong. According to QMetaType documentation, type() returns 0 if the type is not registered, so the condition should be (id != 0), so the program tries to do something only when the type exists.