Created an application on Qt for OS X, but the standard shortcut keys for closing and compressing windows do not work, because of this, the application will not be accepted in the Mac App Store. How to fix it?

    1 answer 1

    Unfortunately, the standard shortcut keys are really little supported. But you can add them yourself in the constructor of each QMainWindow :

     #include <QShortcut> MyWindow::MyWindow (QWidget *parent) : QMainWindow(parent) { #ifdef TARGET_OS_MAC new QShortcut(QKeySequence("Ctrl+M"), this, SLOT(showMinimized())); new QShortcut(QKeySequence("Ctrl+W"), this, SLOT(close())); #endif } 

    Please note that the name Ctrl interpreted as Cmd on a Mac keyboard. (For the Ctrl key itself, Qt uses the name Meta .)