c++qtqtguiqt3qaction

QAction::setAccel(QString) not available from Qt 4?


Following this documentation:

http://doc.qt.digia.com/qq/qq14-actioneditor.html

I figured that out there is no QAction::setAccel(QString) method anymore.

How can one modify the QAction accel other than using QtCreator? I need to change them runtime.

The documentation does not even seem to mention this method anymore here:

http://qt-project.org/doc/qt-4.8/qaction.html


Solution

  • Actually, the documentation does contain this under the qt3support section:

    The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

    You could still use it with some qmake modification as follows:

    QT += qt3support
    

    But as the documentation writes:

    void QAction::setAccel ( const QKeySequence & shortcut )

    Use setShortcut() instead.