Qt: how to apply a shortcut( Key_Comma + Key_Return) to action

后端 未结 1 1584
轮回少年
轮回少年 2021-01-26 00:04

I tried to set a shortcut by the following code, but it doesn\'t work. If I change it to ALT + Comma or ALT + Return, it will be fine. but the request is Comma + Return. Does an

相关标签:
1条回答
  • 2021-01-26 00:56

    You can create it by using the multiple arguments constructor for QKeySequence.

    like this:

    auto ac = new QAction(this);
    ac->setShortcut(Qt::Key_Comma + Qt::Key_Return);
    
    0 讨论(0)
提交回复
热议问题