O'Reilly logo

Qt 5 Blueprints by Symeon Huang

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

Creating a C++ plugin for QML applications

It's not too difficult to write a plugin for Qt/C++ applications, whereas it's somewhat more complex to create a plugin for the QML applications. The idea is the same, and here we will use a very basic example to demonstrate this topic. Basically, this application will encode the text input as Base64 and display it. The Base64 encoding part is implemented in the C++ plugin.

This time, we're going to create the plugin project first, and then complete the QML part. Creating a plugin project for a QML application shares the same procedure. Navigate to Libraries | C++ Library, and then select Qt Plugin with the name as Base64Plugin. Its project file, Base64Plugin.pro, is pasted here:

QT += core qml TARGET = ...

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