O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Saving the comic script

Now that our scriptEditor has minimal functionality, we want the user to be able to save their work. We will add this option as a menu entry, using a QAction (http://doc.qt.io/qt-5.9/qaction.html), which is an implementation of the command pattern. It provides an abstraction for a similar action that could be invoked via the UI from several entry points, such as a menu entry, toolbar icon, and keyboard shortcut.

To add the menu entry, we will open mainwindow.ui again and select the element in the canvas at the top-left corner with the Type Here label. We then edit this text and rename it as File. A popup with a couple of menu entries will appear, where we will modify the first one (Type Here), call it Save as..., and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required