February 27, 2013

InAndOutLand InAndOutLand
Lab Rat
17 posts

Go to a Webpage in Qt WebKit

 

I have a question about Qt WebKit. I am trying to make a web browser in Qt. I have got the Back and Foward Buttons working, but not the URL bar working. Once the user is done typing in the URL they want to go to, and they have pressed Return, the web browser would go to the webpage that the User wanted the web browser to go. But there is no go() function in Qt. What do I do now?

 Signature 

Here’s to the crazy ones. The rebels. The troublemakers. The ones who see things differently. While some may see them as the crazy ones, we see genius.

8 replies

February 27, 2013

zenoalbisser zenoalbisser
Lab Rat
5 posts

If you are using the QQuickWebView (QML) then simply setting the url property of the WebView should load the requested page.
If you are using QWebView (Widgets) then QWebView::load(const QUrl & url) would do the trick.

March 5, 2013

InAndOutLand InAndOutLand
Lab Rat
17 posts

Sorry for the late response, but, how do I implement QWebView::load in the text box and the QWebView?

 Signature 

Here’s to the crazy ones. The rebels. The troublemakers. The ones who see things differently. While some may see them as the crazy ones, we see genius.

March 6, 2013

zenoalbisser zenoalbisser
Lab Rat
5 posts

Take a look at this: http://qt.gitorious.org/qt/qtwebkit/blobs/stable/Tools/MiniBrowser/qt/qml/BrowserWindow.qml

In particular line 43 and 315.

March 9, 2013

InAndOutLand InAndOutLand
Lab Rat
17 posts

Well, I get that, but, what do I need to do for it to work(like steps do I need to acomplish.)

 Signature 

Here’s to the crazy ones. The rebels. The troublemakers. The ones who see things differently. While some may see them as the crazy ones, we see genius.

March 13, 2013

InAndOutLand InAndOutLand
Lab Rat
17 posts

By that, I mean what do I do with the code, and/or how I implement it.

 Signature 

Here’s to the crazy ones. The rebels. The troublemakers. The ones who see things differently. While some may see them as the crazy ones, we see genius.

March 14, 2013

zenoalbisser zenoalbisser
Lab Rat
5 posts

May be you could be slightly more specific asking your question.
What exactly does not work?
Paste your code somewhere, so other people can have a look etc.

March 15, 2013

InAndOutLand InAndOutLand
Lab Rat
17 posts

I don’t have a problem, I just want to know how to use the code.
Mainwindow.ui: http://pastebin.com/7JvJJQ63
Mainwindow.cpp: http://pastebin.com/buqpmapj
Main.cpp: http://pastebin.com/vMp8RspL
Mainwindow.h: http://pastebin.com/TWkq5CKP
.pro file: http://pastebin.com/ePvRYVfs

 Signature 

Here’s to the crazy ones. The rebels. The troublemakers. The ones who see things differently. While some may see them as the crazy ones, we see genius.

April 6, 2013

InAndOutLand InAndOutLand
Lab Rat
17 posts

Well, I guess my problem is, that, I want to go to a webpage. I tried that link, and pasted those lines in to a file(I don’t remember) and nothing happened.

 Signature 

Here’s to the crazy ones. The rebels. The troublemakers. The ones who see things differently. While some may see them as the crazy ones, we see genius.

 
  ‹‹ Frame Capture of the application itself      QT webkit an LOOONNNNGGGG page Not working ››

You must log in to post a reply. Not a member yet? Register here!