def __init__(self, parent, project=None): QPlainTextEdit.__init__(self) EditorGeneric.__init__(self) BaseCentralWidget.__init__(self) self.parent = parent self.completer = Completer(self, project) self.setWordWrapMode(QTextOption.NoWrap) doc = self.document() option = QTextOption() option.setFlags(QTextOption.ShowTabsAndSpaces) doc.setDefaultTextOption(option) self.setDocument(doc) self.set_default_font() #file modification time POSIX self._mtime = None #Flag to dont bug the user when answer 'dont show the modification dialog' self.ask_if_externally_modified = True self.lineNumberArea = self.LineNumberArea(self) self.viewport().installEventFilter(self) self.highlighter = None styles.set_style(self, 'editor') self.connect(self, SIGNAL("cursorPositionChanged()"), self.highlight_current_line) self.connect(self, SIGNAL("modificationChanged(bool)"), self.modif_changed) self.highlight_current_line()
def __init__(self, URL, process=None): QWidget.__init__(self) BaseCentralWidget.__init__(self) self.path = URL self.process = process v_box = QVBoxLayout(self) #Web Frame self.webFrame = QWebView() self.webFrame.load(QUrl(URL)) v_box.addWidget(self.webFrame) if process is not None: time.sleep(0.5) self.webFrame.reload()
def __init__(self, image): QLabel.__init__(self) BaseCentralWidget.__init__(self) pixmap = QPixmap(image) self.setPixmap(pixmap) self.path = image