Creating a small browser
Let's now learn a technique to display a web page or the content of an HTML document. We will simply be making use of the Line Edit
andPush Button
widgets so that the user can enter the URL of the desired site, followed by clicking on thePush Button
widget. On clicking the push button, that site will appear in a customized widget. Let's see how.
In this recipe, we will learn how to make a small browser. Because Qt Designer does not includes any widgets specifically, the focus of this recipe is to make you understand how a custom widget can be promoted intoQWebEngineView
, which in turn can be used for displaying a web page.
The application will prompt for a URL and when the user clicks the Go
button after entering the URL, the specified web page will open in the QWebEngineView
object.
How to do it...
In this recipe, we will require just three widgets: one for entering the URL, a second for clicking the button, and a third for displaying the website. Here are the steps...