In a custom item model, I want to call data changed with some given roles.
With 2 items in the initializer-list
, it compiles just fine:
emit dataChanged(index, index, QVector<int>{ Qt::CheckStateRole, Qt::DisplayRole });
However, when I add a third item to the list it fails:
emit dataChanged(index, index, QVector<int> { Qt::CheckStateRole, Qt::DisplayRole, Qt::DecorationRole });
error C2440: '<function-style-cast>' : cannot convert from 'initializer-list' to 'QVector<int>'
2> No constructor could take the source type, or constructor overload resolution was ambiguous
It doesn't seem to matter what the roles are, any two will compile and the third will not. I'm using MSVC2013 and Qt 5.4.1. Am I doing something wrong here?