コード例 #1
0
ファイル: ptwebview.py プロジェクト: ptphp/PtPy
    def __init__(self, parent=None, userData=None,inspector = True):
        QWebView.__init__(self, parent)  

        settings = QWebSettings.globalSettings()
        settings.setFontFamily(QWebSettings.StandardFont, 'Helvetica')
        settings.setFontSize(QWebSettings.DefaultFontSize, 12)

        self.webpage = page = PtWebPage(self)        
        self.setPage(page) 
        self.connect(self, SIGNAL('loadFinished(bool)'), self.onLoadFinished)
        self.settings().setAttribute(
                    QWebSettings.WebAttribute.DeveloperExtrasEnabled, True)
        #path = os.getcwd()
        #self.settings().setUserStyleSheetUrl(QUrl.fromLocalFile(path + "/myCustom.css"))

        font = QFont("Helvetica")
        font.setPixelSize(12)
        self.setFont(font)
        # or globally:
        # QWebSettings.globalSettings().setAttribute(
        #     QWebSettings.WebAttribute.DeveloperExtrasEnabled, True)
        if inspector:
            self.inspector = QWebInspector()
            self.inspector.setPage(self.page())
            self.inspector.hide()

        self.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
        self.page().linkClicked.connect(self._on_page_link_clicked)
コード例 #2
0
    def __init__(self, fn):
        QWebView.__init__(self)

        if fn:
            self.load_file(fn)

        self.setTextSizeMultiplier(Previwer.DEFAULE_TEXT_MULTIPLIER)
        self.__set_shortcut()
コード例 #3
0
ファイル: browserrender.py プロジェクト: HussainAther/scrape
 def __init__(self, display=True):
     """
     Initialize the display with the app.
     """
     self.app = QApplication([])
     QWebView.__init__(self)
     if display:
         self.show()  # show the browser
コード例 #4
0
ファイル: qttut01.py プロジェクト: godber/path-of-a-pyqter
    def __init__(self, app):
        QWebView.__init__(self)

        # By storing a reference to the application which started this
        # instance, we will be able to close the application once we get what
        # we want
        self.parent_app = app

        # connect the loadFinished signal to a method defined by us.
        # loadFinished is the signal which is triggered when a page is loaded
        self.loadFinished.connect(self._load_finished)
コード例 #5
0
    def __init__(self, path, parent=None, encoding='utf8'):
        QWebView.__init__(self, parent)
        self.path = path
        self.encoding = encoding
        self.__watcher = QFileSystemWatcher(self)

        self.__watcher.fileChanged.connect(self.loadFile)
        self.__watcher.directoryChanged.connect(self.loadFile)

        self.__watcher.addPath(self.path)
        self.__watcher.addPath(QFileInfo(self.path).path())

        self.setWindowTitle(self.path)

        self.loadFile()
コード例 #6
0
ファイル: login.py プロジェクト: Aeium/dotStudio
    def __init__(self, authorize_url):
        """
        Custom Webview widget to handle authentication of an authorisation url.
        authorize_url is string returned via flow_from_clientsecrets.step1_get_authorize_url object

        If Authorization is successful, returns an access code required for step2 of oauth flow object
        """

        QWebView.__init__(self)
        self.URL = QUrl.fromPercentEncoding(str(authorize_url))
        self.setUrl(self.URL)

        self.titleChanged.connect(self.handleTitleChange)

        self.load(self.URL)

        self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.Popup)
コード例 #7
0
ファイル: login.py プロジェクト: rohtau/dotStudio
    def __init__(self, authorize_url):
        """
        Custom Webview widget to handle authentication of an authorisation url.
        authorize_url is string returned via flow_from_clientsecrets.step1_get_authorize_url object

        If Authorization is successful, returns an access code required for step2 of oauth flow object
        """

        QWebView.__init__(self)
        self.URL = QUrl.fromPercentEncoding(str(authorize_url))
        self.setUrl(self.URL)

        self.titleChanged.connect(self.handleTitleChange)

        self.load(self.URL)

        self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.Popup)
コード例 #8
0
 def __init__(self, display=True):
     self.app = QApplication([])
     QWebView.__init__(self)
     if display:
         self.show()  # show the browser
コード例 #9
0
ファイル: brower_render.py プロジェクト: APLK/python_scrape
 def __init__(self,show=True):
     self.app = QApplication(sys.argv)
     QWebView.__init__(self)
     if show:
         self.show()#显示浏览器
コード例 #10
0
ファイル: html_editor.py プロジェクト: davidmorrill/facets
        def __init__ ( self, parent, editor ):
            """ Initializes the object.
            """
            QWebView.__init__( self, parent )

            self._editor = editor
コード例 #11
0
ファイル: dream_web_view.py プロジェクト: Dingobloo/dreamer
 def __init__(self,*args):
     QWebView.__init__(self)
コード例 #12
0
ファイル: browser_render.py プロジェクト: mk-z/windbg
 def __init__(self, display=True):
     self.app = QApplication([])
     QWebView.__init__(self)
     if display:
         self.show() # show the browser