ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
[TOC] ## 概述 统一了Windows,macOS,KDE,GNOME的快捷键 使用: ``` // 4种方式相同 QKeySequence(QKeySequence::Print); QKeySequence(tr("Ctrl+P")); QKeySequence(tr("Ctrl+p")); QKeySequence(Qt::CTRL + Qt::Key_P); ``` ## 实例 ### simple ``` QAction *openfile = new QAction(tr("测试"),this); openfile->setIcon(QIcon(":/1.jpeg")); openfile->setShortcut(QKeySequence::Open); openfile->setText("test"); openfile->setIconText("test2"); connect(openfile,&QAction::triggered,this,&MainWindow::open); ui->toolBar->addAction(openfile); ```