Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use a QWinJumpList?
Forum Updated to NodeBB v4.3 + New Features

How to use a QWinJumpList?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 867 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Donald Duck
    wrote on last edited by
    #1

    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?

    mrjjM 1 Reply Last reply
    0
    • D Donald Duck

      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?

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      Sample must be old

      Try 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();
      }
      
      

      alt text

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved