本文整理汇总了Python中PySide.QtWebKit.QWebView.hide方法的典型用法代码示例。如果您正苦于以下问题:Python QWebView.hide方法的具体用法?Python QWebView.hide怎么用?Python QWebView.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtWebKit.QWebView
的用法示例。
在下文中一共展示了QWebView.hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Browser
# 需要导入模块: from PySide.QtWebKit import QWebView [as 别名]
# 或者: from PySide.QtWebKit.QWebView import hide [as 别名]
#.........这里部分代码省略.........
def goNext(self):
self.cmdNext(list())
def onConnection(self):
self.socket = self.server.nextPendingConnection()
self.socket.write(self.hostname + ' % ')
self.connect(self.socket, SIGNAL("readyRead()"), self, SLOT("onDataReceived()"));
def print_(self, text):
if (self.socket != False):
self.socket.write(text + '\n')
print(text)
def onDataReceived(self):
data = self.socket.readAll().data().strip()
try:
args = data.split(' ')
map(lambda x : x.strip(), args)
self.commands.get(args[0])(args)
except Exception:
self.print_('>> syntax error')
self.printCommandsList()
if self.socket.isOpen():
self.socket.write(self.hostname + ' % ')
def printCommandsList(self):
self.print_('avaible commands:')
for command in self.commands:
self.print_(' ' + command)
def onSslErrors(self, reply, errors):
url = unicode(reply.url().toString())
reply.ignoreSslErrors()
# commands
def cmdHelp(self, args):
self.print_('>> help')
self.printCommandsList()
def cmdRefresh(self, args):
self.print_('>> refresh ' + self.url.toString().encode())
self.frontView.reload()
def cmdAdd(self, args):
self.print_('>> add ' + args[1] + ' ' + args[2] + ' ' + args[3])
self.sites.append(Site(QUrl(args[1]), int(args[2], int(args[3]))))
def cmdDel(self, args):
self.print_('>> del ' + args[1])
self.sites.pop(int(args[1]))
def cmdList(self, args):
self.print_('>> list')
self.print_('current list:')
sitesCount = len(self.sites)
i = 0
while i < sitesCount:
self.print_('%1c[%1d] %2ds : %3s' % ((i==self.siteId) and '*' or ' ' ,i, self.sites[i].time, self.sites[i].url.toString().encode()))
i = i + 1
def cmdZoom(self, args):
self.print_('>> zoom ' + args[1])
self.frontView.setZoomFactor(float(args[1]))
def cmdFs(self, args):
self.print_('>> fs ' + args[1])
if (args[1] == '1'):
self.showFullScreen()
else:
self.showNormal()
def cmdExit(self, args):
self.print_('>> exit')
self.socket.close()
def cmdNext(self, args):
self.timer.stop()
self.timer.start(self.sites[self.siteId].time * 1000)
self.siteId = (self.siteId + 1) % len(self.sites)
print('>> next ' + self.sites[self.siteId].url.toString().encode())
self.backView.show()
self.frontView, self.backView = self.backView, self.frontView
self.backView.load(self.sites[self.siteId].url)
self.backView.setZoomFactor(self.sites[self.siteId].zoom)
self.backView.hide()
def cmdRestart(self, args):
self.print_('>> restart')
self.close()
def cmdUpgrade(self, args):
self.print_('>> upgrade')
update = urllib.urlopen('https://raw.githubusercontent.com/tjardick/monitoring_browser/master/webkit.py').read()
script = file('webkit.py', 'w')
script.write(update)
script.close()
self.close()