def __init__(self, parent=None): super(PythonEditor, self).__init__(parent=parent) self.setObjectName('PythonEditor') self._parent = parent if parent is not None: self.setParent(parent) layout = QtWidgets.QVBoxLayout(self) layout.setObjectName('PythonEditor_MainLayout') layout.setContentsMargins(0, 0, 0, 0) self.tabeditor = tabs.TabEditor(self) self.editor = self.tabeditor.editor self.terminal = terminal.Terminal() splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical) splitter.setObjectName('PythonEditor_MainVerticalSplitter') splitter.addWidget(self.terminal) splitter.addWidget(self.tabeditor) layout.addWidget(splitter) self.splitter = splitter act = actions.Actions( pythoneditor=self, editor=self.editor, tabeditor=self.tabeditor, terminal=self.terminal, ) sch = shortcuts.ShortcutHandler( editor=self.editor, tabeditor=self.tabeditor, terminal=self.terminal, ) self.menubar = menubar.MenuBar(self) SE = shortcuteditor.ShortcutEditor self.shortcuteditor = SE(editor=self.editor, tabeditor=self.tabeditor, terminal=self.terminal) PE = preferences.PreferencesEditor self.preferenceseditor = PE() # Loading the AutosaveManager will also load # all the contents of the autosave into tabs. AM = autosavexml.AutoSaveManager self.filehandler = AM(self.tabeditor)
def construct_ui(self): layout = QtWidgets.QVBoxLayout(self) layout.setObjectName('PythonEditor_MainLayout') layout.setContentsMargins(0, 0, 0, 0) self.tabeditor = tabs.TabEditor(self) self.editor = self.tabeditor.editor self.terminal = terminal.Terminal() self.menubar = menubar.MenuBar(self) splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical) splitter.setObjectName('PythonEditor_MainVerticalSplitter') splitter.addWidget(self.terminal) splitter.addWidget(self.tabeditor) layout.addWidget(splitter)
def build_layout(self): """ Create the layout. """ layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) # self.setup_menu() self.menubar = menubar.MenuBar(self) left_widget = QtWidgets.QWidget() left_layout = QtWidgets.QVBoxLayout(left_widget) path_edit = QtWidgets.QLineEdit() path_edit.textChanged.connect(self.update_tree) self.path_edit = path_edit splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal) self.splitter = splitter self.xpanded = False self.setLayout(layout) self.tool_button = QtWidgets.QToolButton() self.tool_button.setText('<') self.tool_button.clicked.connect(self.xpand) self.tool_button.setMaximumWidth(20) layout.addWidget(splitter) browse = browser.FileTree(NUKE_DIR) self.browser = browse left_layout.addWidget(self.path_edit) left_layout.addWidget(self.browser) self.tabs = edittabs.EditTabs() widgets = [left_widget, self.tool_button, self.tabs] for w in widgets: splitter.addWidget(w) splitter.setSizes([200, 10, 800]) self.install_features() self.check_modified_tabs() if self.tabs.count() == 0: self.tabs.new_tab()
def build_layout(self): """ Create the layout. """ layout = QtWidgets.QVBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) # self.setup_menu() self.read_only = True self.menubar = menubar.MenuBar(self) left_widget = QtWidgets.QWidget() left_layout = QtWidgets.QVBoxLayout(left_widget) path_edit = QtWidgets.QLineEdit() path_edit.textChanged.connect(self.update_tree) self.path_edit = path_edit splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal) self.splitter = splitter self.xpanded = False self.setLayout(layout) self.tool_button = QtWidgets.QToolButton() self.tool_button.setText('<') self.tool_button.clicked.connect(self.xpand) self.tool_button.setMaximumWidth(20) layout.addWidget(splitter) browse = browser.FileTree(NUKE_DIR) self.browser = browse left_layout.addWidget(self.path_edit) left_layout.addWidget(self.browser) self.editor = editor.Editor(handle_shortcuts=True) self.editor.path = 'C:/Users/tsalx/Desktop/temp_editor_save.py' widgets = [left_widget, self.tool_button, self.editor] for w in widgets: splitter.addWidget(w) splitter.setSizes([200, 10, 800]) self.browser.path_signal.connect(self.read) self.editor.textChanged.connect(self.write) self.editor.modificationChanged.connect(self.handle_changed)