summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-10-28 16:29:52 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-10-28 15:35:12 +0000
commitb9fa32d6d9be16e4bf3ad65864802b5691b5a0dc (patch)
tree810cf54e980069ba934fea9aea560933f0330803 /examples
parent8cc22d437ba532548a154cae57eba1c5d2e28888 (diff)
Fix building with MSVC2012.
No initializer lists.... Change-Id: I3a86992cd7412cde9967d57d9ad68d7f6424c404 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/mediaplayer-common/mainwindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/mediaplayer-common/mainwindow.cpp b/examples/mediaplayer-common/mainwindow.cpp
index 00ac4cb..b988b3a 100644
--- a/examples/mediaplayer-common/mainwindow.cpp
+++ b/examples/mediaplayer-common/mainwindow.cpp
@@ -53,13 +53,15 @@ MainWindow::MainWindow(QWidget *parent) :
{
ui->setupUi(this);
- auto model = new QStringListModel({"song 1", "song 2", "song 3"}, this);
+ auto model = new QStringListModel(QStringList() << QStringLiteral("song 1")
+ << QStringLiteral("song 2")
+ << QStringLiteral("song 3"), this);
ui->mediaListView->setModel(model);
connect(ui->mediaListView, &QAbstractItemView::clicked, [model,this](const QModelIndex & index){
- emit tap(QVariantMap({
- std::make_pair(QStringLiteral("media"), model->data(index, Qt::EditRole).toString())
- }));
+ QVariantMap data;
+ data.insert(QStringLiteral("media"), model->data(index, Qt::EditRole).toString());
+ emit tap(data);
});
}