Let's learn how to call C++ functions from JavaScript using the following steps:
- Create a Qt Widgets Application project. Open the project file (.pro) and add the following modules to the project:
QT += core gui webengine webenginewidgets
- Open mainwindow.ui and delete the mainToolBar, menuBar, and statusBar, as we don't need any of these in this example program.
- Add a vertical layout to the canvas, then select the canvas and click on the Lay Out Vertically button on top of the canvas. Add a text label to the top of the vertical layout and set its text to Hello!. Make its font bigger by setting its styleSheet property as follows:
font: 75 26pt "MS Shell Dlg 2";
This is how it look like after we applied the font properties ...