Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.15.7, 6.1
-
None
Description
The method QDomElement QDomDocument::elementById(const QString &elementId) is implemented and documented as this:
/*! Returns the element whose ID is equal to \a elementId. If no element with the ID was found, this function returns a \l{QDomNode::isNull()}{null element}. Since the QDomClasses do not know which attributes are element IDs, this function returns always a \l{QDomNode::isNull()}{null element}. This may change in a future version. */ QDomElement QDomDocument::elementById(const QString& /*elementId*/) { qWarning("elementById() is not implemented and will always return a null node."); return QDomElement(); }
First, I do not see a reason to have a method which does nothing, especially not what one expects it should do.
Second, why is it not implemented? I understand that xml has no defined id attribute, but that could be given as a second parameter, defaulting to id, which presumably most people use:
QDomElement QDomDocument::elementById(const QString &elementId, const QString& idAttribute = "id")