WebView and web settings
In this section, we will dive deeper into the features available in Qt's WebEngine 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:
First of all, open up
mainwindow.ui
and add a vertical layout under the progress bar. Then, add a Plain Text Edit widget (under the input widget 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>
Next, go to File | New File or Project. A window will then pop up and ask you to choose a file template...