Trees | Indices | Help |
|
---|
|
1 ## example PyQt panel that implements a simple web browser in Nuke 2 3 import nuke 4 import nukescripts 5 import sip 6 7 from PyQt4.QtGui import * 8 from PyQt4.QtCore import * 9 from PyQt4.QtWebKit import * 10 1141 4714 self.webView.load( QUrl(self.locationEdit.text()) )1517 super( QWidget, self).__init__() 18 self.webView = QWebView(); 19 20 self.setLayout( QVBoxLayout() ) 21 22 self.locationEdit = QLineEdit( 'http://www.google.com' ) 23 self.locationEdit.setSizePolicy( QSizePolicy.Expanding, self.locationEdit.sizePolicy().verticalPolicy() ) 24 25 QObject.connect( self.locationEdit, SIGNAL('returnPressed()'), self.changeLocation ) 26 27 self.layout().addWidget( self.locationEdit ) 28 29 bar = QToolBar() 30 bar.addAction( self.webView.pageAction(QWebPage.Back)) 31 bar.addAction( self.webView.pageAction(QWebPage.Forward)) 32 bar.addAction( self.webView.pageAction(QWebPage.Stop)) 33 bar.addAction( self.webView.pageAction(QWebPage.Reload)) 34 bar.addSeparator() 35 36 37 self.layout().addWidget( bar ) 38 self.layout().addWidget( self.webView ) 39 40 self.webView.load( QUrl( 'http://www.google.com' ) )4954 55 58 59 menu = nuke.menu('Pane') 60 menu.addCommand('Web Browser',addPanel) 61 nukescripts.registerPanel('uk.co.thefoundry.WebBrowserPanel', addPanel) 6251 super(WebBrowserPanel, self).__init__("Web Browser", "uk.co.thefoundry.WebBrowserPanel") 52 self.webBrowserKnob = nuke.PyCustom_Knob( "web", "", "nukescripts.pyQtExamples.webBrowser.WebBrowserKnob()" ) 53 self.addKnob( self.webBrowserKnob )
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Nov 23 08:52:28 2012 | http://epydoc.sourceforge.net |