Details
-
Bug
-
Resolution: Cannot Reproduce
-
P4: Low
-
None
-
4.8.0, 5.1.1
-
None
-
Windows
Description
QStandardItemModel sets the string values for an empty string and a null string so that they can't be distinguish. The QStandardItemModel::setData() function does not see difference with QString() and QString::fromLatin1("") and thus it's not setting the data in the following code snippet:
QStandardItemModel model(1, 1);
QModelIndex index = model.index(0, 0);
bool ok1 = model.setData(index, QString());
bool ok2 = model.setData(index, QString::fromLatin1(""));
bool shouldBeFalse = model.data(index).toString().isNull();
This makes it impossible to distinguish between an empty and a null string.