PDA

View Full Version : QWebView PyQt4



jaybstory
3rd February 2010, 06:54
Hello,

I am trying to open a website in a QWebView box in my gui. I have a signal slot connection that states if the "open map" button is clicked, it will go to my omap function which is:




def omap(self):
m = QtWebKit.QWebView(self)
j = QtCore.QUrl('http://www.openstreetmap.org/')
m.setUrl(j)
print j
m.load(j)



however, the website is not loading in the QWebView box. I'm not sure what I am doing wrong here or if this is even the correct way to accomplish what I am doing (trying to have a website embedded in my gui) Any help would be greatful, thank you in advance.

jaybstory
3rd February 2010, 07:37
UPDATE:

so I added one line of code to the end which was:




m.show()



which displays the webpage. However, it displays it into a tiny little corner in the top left hand screen of my gui. I wanted to know if there is a way to embed this webpage in a box in my gui? If so, is QWebView the way to approach this problem? How would I implement this? Thank you in advance.

jaybstory
6th February 2010, 00:29
UPDATE: I figured out how to embed webpages in my GUI. For anyone wanting to know how, QWebView is the correct approach.

blanka
9th December 2010, 17:44
Well suggesting i am on the right truck is not helping me at the moment.I am having same exact problem. i want to open the webview in a window of its own when the button is pressed....so on my gui when i press button a new window opens showing the page...can anyone suggest any idea?