How to use a QWinJumpList?
-
I'm trying to use the following code for a QWinJumpList that I found here:
QWinJumpList jumplist; jumplist.begin(); jumplist.setKnownCategoryShown(QWinJumpList::RecentCategory); jumplist.beginTasks(); 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); jumplist.addLink(tr("Launch SDK Manager"), QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\\sdk-manager.exe"); jumplist.commit();
But in the documentation, it says that all these methods don't exist. I've tested the code and like it said in the documentation, it didn't compile with the error "'begin': is not a member of QWinJumpList".
Why does the example say to use methods that don't exist? Have I missed something?
Could someone please provide a working example for how to use a QWinJumpList?
-
I'm trying to use the following code for a QWinJumpList that I found here:
QWinJumpList jumplist; jumplist.begin(); jumplist.setKnownCategoryShown(QWinJumpList::RecentCategory); jumplist.beginTasks(); 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); jumplist.addLink(tr("Launch SDK Manager"), QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\\sdk-manager.exe"); jumplist.commit();
But in the documentation, it says that all these methods don't exist. I've tested the code and like it said in the documentation, it didn't compile with the error "'begin': is not a member of QWinJumpList".
Why does the example say to use methods that don't exist? Have I missed something?
Could someone please provide a working example for how to use a QWinJumpList?
hi
Sample must be oldTry this
#include <QWinJumpList> #include <QWinJumpListItem> #include <QWinJumpListCategory> // ADD QT += winextras to .pro file int main(int argc, char* argv[]) { QApplication a(argc, argv); QWinJumpListItem jumpItem(QWinJumpListItem::Link); jumpItem.setArguments(QStringList(QString("as"))); jumpItem.setDescription("Some Text"); jumpItem.setTitle("MY LITTLE JUMP LIST"); QWinJumpList jumpList; jumpList.tasks()->setTitle("Some Title"); jumpList.tasks()->addItem(&jumpItem); jumpList.tasks()->setVisible(true); MainWindow w; w.show(); return a.exec(); }