diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-11-12 17:02:23 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-11-13 11:26:56 +0000 |
commit | 71a4a624fcdc2768d19619fa5a0bc583e2cc2a11 (patch) | |
tree | a28b3f4d8cc8cf85031a1bdaf66b9243cc64fbb3 | |
parent | 55be074d7f40ae2d0ebed21b36192b18f7edf5b5 (diff) |
Fix jumplist example documentation snippet
Update API.
Fixes: QTBUG-71709
Change-Id: I21d5a78a0a9c124308b2341a61cb1e12bf689a4a
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/winextras/doc/snippets/code/jumplist.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/winextras/doc/snippets/code/jumplist.cpp b/src/winextras/doc/snippets/code/jumplist.cpp index 2527528..6f8221e 100644 --- a/src/winextras/doc/snippets/code/jumplist.cpp +++ b/src/winextras/doc/snippets/code/jumplist.cpp @@ -54,19 +54,16 @@ void foo() { //! [jumplist] QWinJumpList jumplist; - jumplist.begin(); - jumplist.setKnownCategoryShown(QWinJumpList::RecentCategory); - - jumplist.beginTasks(); + QWinJumpListCategory *tasks = jumplist.tasks(); QWinJumpListItem *newProject = new QWinJumpListItem(QWinJumpListItem::Link); newProject->setTitle(tr("Create new project")); newProject->setFilePath(QDir::toNativeSeparators(QCoreApplication::applicationFilePath())); newProject->setArguments(QStringList("--new-project")); - jumplist.addItem(newProject); + tasks->addItem(newProject); - jumplist.addLink(tr("Launch SDK Manager"), QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\\sdk-manager.exe"); + tasks->addLink(tr("Launch SDK Manager"), QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\\sdk-manager.exe"); - jumplist.commit(); + tasks->setVisible(true); //! [jumplist] } |