예제 #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
 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
    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
 def __init__(self,show=True):
     self.app = QApplication(sys.argv)
     QWebView.__init__(self)
     if show:
         self.show()#显示浏览器
예제 #10
0
        def __init__ ( self, parent, editor ):
            """ Initializes the object.
            """
            QWebView.__init__( self, parent )

            self._editor = editor
예제 #11
0
 def __init__(self,*args):
     QWebView.__init__(self)
예제 #12
0
 def __init__(self, display=True):
     self.app = QApplication([])
     QWebView.__init__(self)
     if display:
         self.show() # show the browser