Results 1 to 4 of 4

Thread: QWebView PyQt4

  1. #1
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QWebView PyQt4

    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:

    Qt Code:
    1. def omap(self):
    2. m = QtWebKit.QWebView(self)
    3. j = QtCore.QUrl('http://www.openstreetmap.org/')
    4. m.setUrl(j)
    5. print j
    6. m.load(j)
    To copy to clipboard, switch view to plain text mode 

    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.

  2. #2
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QWebView PyQt4

    UPDATE:

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

    Qt Code:
    1. m.show()
    To copy to clipboard, switch view to plain text mode 

    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.

  3. #3
    Join Date
    Jan 2010
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QWebView PyQt4

    UPDATE: I figured out how to embed webpages in my GUI. For anyone wanting to know how, QWebView is the correct approach.

  4. #4
    Join Date
    Nov 2010
    Posts
    5
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: QWebView PyQt4

    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?

Similar Threads

  1. 64-bit PyQt4 on Mac?
    By keflavich in forum Installation and Deployment
    Replies: 0
    Last Post: 4th July 2009, 01:25
  2. Cannot compile PyQt4 under Mac OS 10.4.11
    By ceharon in forum Newbie
    Replies: 0
    Last Post: 6th May 2009, 05:46
  3. Need Help for PyQt4
    By JAIDEEP KANDELWAL in forum Qt Programming
    Replies: 0
    Last Post: 22nd April 2009, 23:08
  4. [PyQt4]reStInPeace
    By kib2 in forum Qt-based Software
    Replies: 0
    Last Post: 20th October 2007, 18:58
  5. keypressevent with pyqt4
    By coldlin in forum Qt Programming
    Replies: 3
    Last Post: 3rd October 2007, 16:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.