Details
-
Bug
-
Resolution: Done
-
P4: Low
-
4.6.2
-
None
Description
In QSharedDataPointer documentation, there is an example code as follows,
class EmployeeData : public QSharedData
{
public:
EmployeeData() : id(-1)
EmployeeData(const EmployeeData &other)
: QSharedData(other), id(other.id), name(other.name) { }
~EmployeeData() { }
int id;
QString name;
};
Am I correct to assume that the name.clear() call in the default constructor is completely and utterly superfluous? The destructor is also not needed.
This relatively minor bug makes this part of the documentation more difficult to read. Ever after wiring Qt software for some time now, I was somewhat confused by the "necessity" of using clear() on a null QString.