Hi, I have an application that works with Qt4 and uses the colon (":") as a shortcut for a QAction. I was testing out how the application worked under Qt5 and have found out that this particular shortcut does not work anymore. This isn't an issue specific to my application but with Qt5 in general, as it can be shown with the minimally reproducing application that I attach at the end of the message.

I have checked the docs but haven't found anything that has changed to guarantee this difference. Any idea on what it may be ? Or should I report this as a bug ?

Thanks,

Qt Code:
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3.  
  4. #include <QMainWindow>
  5.  
  6. class MainWindow : public QMainWindow
  7. {
  8. Q_OBJECT
  9.  
  10. public:
  11. MainWindow(QWidget *parent = 0);
  12. ~MainWindow();
  13.  
  14. public slots:
  15. void performTestAction();
  16.  
  17. private:
  18. QAction *testAction;
  19. };
  20.  
  21. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. #include "mainwindow.h"
  2.  
  3. #include <QMainWindow>
  4. #include <QAction>
  5. #include <QMessageBox>
  6.  
  7. MainWindow::MainWindow(QWidget *parent)
  8. : QMainWindow(parent)
  9. {
  10. testAction = new QAction("Test action", this);
  11. // Neither of this work in Qt5 but do work in Qt4
  12. testAction->setShortcut(QKeySequence(tr(":")));
  13. //testAction->setShortcut(QKeySequence(Qt::Key_Colon));
  14. connect(testAction, SIGNAL(triggered()), this, SLOT(performTestAction()));
  15. addAction(testAction);
  16. }
  17.  
  18. MainWindow::~MainWindow()
  19. { }
  20.  
  21. void MainWindow::performTestAction()
  22. {
  23. QMessageBox messageBox;
  24. messageBox.setText("The action has been executed.");
  25. messageBox.exec();
  26. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. MainWindow w;
  8. w.show();
  9.  
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. #-------------------------------------------------
  2. #
  3. # Project created by QtCreator 2013-04-03T10:23:58
  4. #
  5. #-------------------------------------------------
  6.  
  7. QT += core gui
  8.  
  9. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  10.  
  11. TARGET = colontest
  12. TEMPLATE = app
  13.  
  14.  
  15. SOURCES += main.cpp\
  16. mainwindow.cpp
  17.  
  18. HEADERS += mainwindow.h
To copy to clipboard, switch view to plain text mode