summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp')
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp
index fb9e9161cc..ca1ea21b02 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qvariant.cpp
@@ -1,12 +1,22 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
@@ -137,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>()) {