Doc: Fix snippet to use initializer list
We can expect C++11 now, and using an initializer list is much shorter. Change-Id: I6424d24ce7660b342a629e836b94d62c8868a44d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>bb10
parent
337a7e96b6
commit
13c198cedb
|
|
@ -147,10 +147,7 @@ QVariant data = QVariant::fromValue(object);
|
|||
|
||||
//! [9]
|
||||
|
||||
QList<int> intList;
|
||||
intList.push_back(7);
|
||||
intList.push_back(11);
|
||||
intList.push_back(42);
|
||||
QList<int> intList = {7, 11, 42};
|
||||
|
||||
QVariant variant = QVariant::fromValue(intList);
|
||||
if (variant.canConvert<QVariantList>()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue