Skip to content

Commit

Permalink
settings
Browse files Browse the repository at this point in the history
  • Loading branch information
lmortimer committed Aug 22, 2011
1 parent 677a2b8 commit 10ab6f4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -9,3 +9,7 @@ Demonstrates how to listen for an event, specifically *QWebFrame.loadFinished()*
useragent.py
============
Defines a class which extends *QWebPage*, overrides *setUserAgentForUrl()* method, defines a custom user agent on all requests.

settings.py
===========
Shows how to enable and disable various settings including the Web Inspector/Debugger, Javascript, Local Storage and Plugins (Flash).
40 changes: 40 additions & 0 deletions settings.py
@@ -0,0 +1,40 @@
# github.com/lastkarrde
# 22.8.11

import sys

from PySide.QtCore import QUrl
from PySide.QtGui import QApplication, QGridLayout, QWidget
from PySide.QtWebKit import QWebSettings, QWebView

class Settings(QWidget):

def __init__(self, parent=None):
super(Settings, self).__init__(parent)

self.setWindowTitle('Settings, Debugger Application')

url = QUrl('http://www.bitcoin.org/')

settings = QWebSettings.globalSettings()
settings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True)

# more settings
# http://pyside.org/docs/pyside/PySide/QtWebKit/QWebSettings.html#detailed-description

self.webView = QWebView()
self.webView.setUrl(url)

self.mainLayout = QGridLayout()
self.mainLayout.addWidget(self.webView)

self.setLayout(self.mainLayout)

if __name__ == '__main__':

app = QApplication(sys.argv)

s = Settings()
s.show()

sys.exit(app.exec_())

0 comments on commit 10ab6f4

Please sign in to comment.