Using webview and web settings
In this recipe, we will dive deeper into the features available in Qt’s WebEngine module and explore the settings that we can use to customize our webview
. We will use the source files from the previous example and add more code to it.
How to do it…
Let’s explore some of the basic features of the Qt WebEngine module:
- Open
mainwindow.ui
and add a vertical layout under the progress bar. Add a Plain Text Edit widget (under the Input Widgets category) and a push button to the vertical layout. Change the display of the push button to Load HTML and set theplaintext
property of the Plain Text Edit widget to the following:<Img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"></img> <h1>Hello World!</h1> <h3>This is our custom HTML page.</h3> <script>alert("Hello!");</script>
This is how it should look after you have added...