当前位置: 首页>>代码示例>>Python>>正文


Python QUrl.addQueryItem方法代码示例

本文整理汇总了Python中PySide.QtCore.QUrl.addQueryItem方法的典型用法代码示例。如果您正苦于以下问题:Python QUrl.addQueryItem方法的具体用法?Python QUrl.addQueryItem怎么用?Python QUrl.addQueryItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtCore.QUrl的用法示例。


在下文中一共展示了QUrl.addQueryItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _urlencode_request_data

# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import addQueryItem [as 别名]
    def _urlencode_request_data(self, raw_data):
        # the data which we want to send to the server must be urlencoded
        request_data = QUrl()
        for (name, value) in raw_data.items():
            request_data.addQueryItem(name, unicode(value))

        return request_data.encodedQuery()
开发者ID:godber,项目名称:path-of-a-pyqter,代码行数:9,代码来源:qttut04.py

示例2: email_note

# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import addQueryItem [as 别名]
 def email_note(self):
     body = self.page.mainFrame().toPlainText()[
         len(self.title):
     ].strip()
     url = QUrl("mailto:")
     url.addQueryItem("subject", self.title)
     url.addQueryItem("body", body)
     QDesktopServices.openUrl(url)
开发者ID:RadixSeven,项目名称:everpad,代码行数:10,代码来源:content.py

示例3: testAllEncodedQueryItemsValues

# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import addQueryItem [as 别名]
    def testAllEncodedQueryItemsValues(self):
        #QUrl.allEncodedQueryItemValues
        url = QUrl()
        key = 'key'
        valid_data = ['data', 'valid', 'test']

        for i, data in enumerate(valid_data):
            url.addQueryItem(key, data)
            self.assertEqual(url.allEncodedQueryItemValues(key),
                             list(valid_data[:i+1]))
开发者ID:Hasimir,项目名称:PySide,代码行数:12,代码来源:qurl_test.py

示例4: testAddQueryItem

# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import addQueryItem [as 别名]
    def testAddQueryItem(self):
        #QUrl.addQueryItem
        url = QUrl()
        valid_data = [('hl', 'en'), ('user', 'konqui')]

        url.addQueryItem(*valid_data[0])
        self.assertEqual(url.queryItems()[0], valid_data[0])

        url.addQueryItem(*valid_data[1])
        self.assertEqual(sorted(url.queryItems()), sorted(valid_data))
开发者ID:Hasimir,项目名称:PySide,代码行数:12,代码来源:qurl_test.py

示例5: get_oauth_url

# 需要导入模块: from PySide.QtCore import QUrl [as 别名]
# 或者: from PySide.QtCore.QUrl import addQueryItem [as 别名]
    def get_oauth_url(self, app_id, redirect_uri, scope, state, response_type,
            display):
        """
        Return encoded OAuth URL with request params formated as GET params.

        @param app_id        (str/uni)
        @param redirect_uri  (str/uni)
        @param scope         (list)
        @param state         (str/uni)
        @param response_type (str/uni)
        @param display       (str/uni)

        @return (QUrl)
        """

        if type(app_id) not in (str, unicode):
            raise FBAuthDialogInvalidParamException(
                "app_id must be `str` or `unicode` but was: %s" % type(app_id))

        if type(redirect_uri) not in (type(None), str, unicode):
            raise FBAuthDialogInvalidParamException(
                "redirect_uri must be `None`, `str` or `unicode` but was: %s" %
                type(redirect_uri))

        if type(scope) not in (type(None), list):
            raise FBAuthDialogInvalidParamException(
                "scope must be `None` or `list` but was: %s" %
                type(scope))

        if type(state) not in (type(None), str, unicode):
            raise FBAuthDialogInvalidParamException(
                "state must be `None`, `str` or `unicode` but was: %s" %
                type(state))

        if type(response_type) not in (type(None), str, unicode):
            raise FBAuthDialogInvalidParamException(
                "response_type must be `None`, `str` or `unicode` but was: %s"
                % type(response_type))

        if type(display) not in (type(None), str, unicode):
            raise FBAuthDialogInvalidParamException(
                "display must be `None`, `str` or `unicode` but was: %s"
                % type(display))

        url = QUrl(OAUTH_URL)

        url.addQueryItem("client_id", app_id)
        url.addQueryItem("redirect_uri", redirect_uri)
        url.addQueryItem("response_type", response_type)
        url.addQueryItem("display", display)

        if scope:
            _scope = ",".join(map(unicode, scope))

            url.addQueryItem("scope", _scope)

        if state:
            url.addQueryItem("state", state)

        return url
开发者ID:AbleCoder,项目名称:pyside-facebook,代码行数:62,代码来源:pyside_facebook.py


注:本文中的PySide.QtCore.QUrl.addQueryItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。