def __init__(self, params, parent=None): QWidget.__init__(self, parent) self.file_name=None self.is_global = False if params is not None: self.is_global = params["global"] import core.InterpreterEditorCommands core.InterpreterEditorCommands.EVENT_COMMAND_CLEAR += self.clear core.InterpreterEditorCommands.EVENT_COMMAND_RESET += self.reset self.setMinimumWidth(400) self.setMinimumHeight(100) # create widgets self._editor_widget = mixin( WidthPythonHighlighter, WithFind, WidthMqHighlighter, WithLineNumbers, WithViewPortMargins, WithWordCompletionMulty_, InterpreterEditor.WithInterpreterCompletion, WithCompletion, InterpreterEditor.WidthLineEnterEvent, WithBasicIdentationManager, WithLineHighlight, WithFixedFont, WithMqEditIO, BaseWidget, QPlainTextEdit)(self) self._editor_widget.on_lines_event += self._process_lines if self.is_global: self._editor_widget.namespace = globals() else: self._editor_widget.namespace = locals() self._result_widget = mixin(WithFixedFont, QPlainTextEdit)(self) # create a horizontal splitter v_splitter = QSplitter(Qt.Horizontal, self) v_splitter.addWidget(self._editor_widget) v_splitter.addWidget(self._result_widget) layout = QVBoxLayout(self) layout.addWidget(v_splitter) layout.setMargin(0) self.setLayout(layout) self.reset() WithSingleIO.__init__(self, params) BaseWidget.__init__(self, params)
def __init__(self, params, parent=None): super(TestClass, self).__init__(parent) self.file_name=None # create widgets self._editor_widget = mixin( WithBasicIdentationManager, WithWordCompletionMulty_, WithCompletion, WithLineHighlight, WithFixedFont, WithMqEditIO, QPlainTextEdit)(self)
def test_mqedit_load_save(): """simple test""" from PyQt4.QtGui import QApplication from Mixin import mixin app = QApplication([]) widget = mixin( WithLineHighlight, WithFixedFont, WithMqEditIO, QPlainTextEdit)() widget.show() widget.load_file('MqEditIO.py') app.exec_()
def __init__(self, params, parent=None): self.base_dir = os.path.dirname(__file__) QWidget.__init__(self, parent) self.setMinimumWidth(300) self.setMinimumHeight(300) # create widgets self._editor_widget = mixin( WithFind, WidthMqHighlighter, WithMqEditIO, WithBasicIdentationManager, WithLineHighlight, WithFixedFont, WithLineNumbers, WithViewPortMargins, WithWordCompletionMulty_, WithCompletion, QPlainTextEdit)(self) self.webview = QWebView(self) #self.webview.load(QUrl("/home/maiquel/develop/developing/main/qt/qadoc/bin/__builds/documents.html")) self.splitter = QSplitter(Qt.Horizontal) self.splitter.addWidget(self._editor_widget) self.splitter.addWidget(self.webview) self.splitter.setSizes([self.size().width(), self.size().width()]) self.splitterv = QSplitter(Qt.Vertical) self.splitterv.addWidget(self.splitter) self.log_widget = QPlainTextEdit() self.splitterv.addWidget(self.log_widget) layout = QVBoxLayout(self) layout.addWidget(self.splitterv) layout.setMargin(0) self.setLayout(layout) # proc_compile self.proc_compile = QProcess() self.proc_compile.finished.connect(self.proc_compile_finished) self.proc_compile.error.connect(self.proc_compile_error) self.proc_compile.readyReadStandardOutput.connect(self.proc_compile_readyReadStandardOutput) self.proc_compile.readyReadStandardError.connect(self.proc_compile_readyReadStandardError) WithSingleIO.__init__(self, params)
def __init__(self, params, parent=None): super(QWidget, self).__init__(parent) self.setMinimumWidth(100) self.setMinimumHeight(100) # create widgets self._editor_widget = mixin( WithMqEditIO, WithFixedFont, WithLineHighlight, WithLineNumbers, WithViewPortMargins, WithWordCompletionMulty_, WithCompletion, QPlainTextEdit)(self) layout = QVBoxLayout(self) layout.addWidget(self._editor_widget) layout.setMargin(0) self.setLayout(layout) WithSingleIO.__init__(self, params)