本文整理汇总了Python中PySide.QtCore.QUrl.setUserName方法的典型用法代码示例。如果您正苦于以下问题:Python QUrl.setUserName方法的具体用法?Python QUrl.setUserName怎么用?Python QUrl.setUserName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtCore.QUrl
的用法示例。
在下文中一共展示了QUrl.setUserName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testSetAttributes
# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import setUserName [as 别名]
def testSetAttributes(self):
#Construct QUrl by set* methods
url = QUrl()
url.setScheme('ftp')
self.assertEqual(url.toString(), 'ftp:')
url.setHost('www.google.com')
self.assertEqual(url.toString(), 'ftp://www.google.com')
url.setPort(8080)
self.assertEqual(url.toString(), 'ftp://www.google.com:8080')
url.setPath('mail/view')
self.assertEqual(url.toString(),
'ftp://www.google.com:8080/mail/view')
url.setUserName('john')
self.assertEqual(url.toString(),
'ftp://[email protected]:8080/mail/view')
url.setPassword('abc123')
self.assertEqual(url.toString(),
'ftp://john:[email protected]:8080/mail/view')
示例2: __init__
# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import setUserName [as 别名]
def __init__(self):
super(Browser, self).__init__()
self.layout = QStackedLayout(self)
self.frontView = QWebView(self)
self.backView = QWebView(self)
self.frontView.page().networkAccessManager().sslErrors.connect(self.onSslErrors)
self.backView.page().networkAccessManager().sslErrors.connect(self.onSslErrors)
self.hostname = os.uname()[1]
self.layout.setStackingMode(QStackedLayout.StackAll)
self.layout.addWidget(self.frontView)
self.layout.addWidget(self.backView)
self.commands = {
'help' : self.cmdHelp,
'refresh' : self.cmdRefresh,
'add' : self.cmdAdd,
'del' : self.cmdDel,
'list' : self.cmdList,
'zoom' : self.cmdZoom,
'fs' : self.cmdFs,
'exit' : self.cmdExit,
'next' : self.cmdNext,
'restart' : self.cmdRestart,
'upgrade' : self.cmdUpgrade,
}
self.timer = QTimer()
self.timer.setSingleShot(False)
self.sites = list()
self.siteId = -1
self.socket = False
url = QUrl("http://status.mobilevikings.com/")
self.sites.append(Site(url, 10, 1.5))
url = QUrl("http://ihackernews.com")
self.sites.append(Site(url, 10, 1))
url = QUrl("http://demo.kibana.org")
self.sites.append(Site(url, 10, 1))
url = QUrl("http://logstash.openstack.org")
self.sites.append(Site(url, 10, 1))
url = QUrl("http://demo.mathias-kettner.de/demo/check_mk/")
url.setUserName("demo897");
url.setPassword("demo");
self.sites.append(Site(url, 15, 1))
self.server = QTcpServer()
self.server.listen(QHostAddress.Any, 4242)
self.connect(self.server, SIGNAL("newConnection()"), self, SLOT("onConnection()"));
self.connect(self.timer, SIGNAL("timeout()"), self, SLOT("goNext()"));
self.goNext()
self.goNext()