Exemple #1
0
	def __init__(self, tabManager, dPrint=None, title=u'Empty document',
		**editorParams):

		"""
		desc:
			Constructor.

		arguments:
			tabManager:
				desc:	A tab manager.
				type:	QTabManager

		keywords:
			dPrint:		A function to be used for debug printing. Should
						accept a single parameter, which is the debug message.
						If no debug function is specified, the standard output
						is used.
			title:		A title for the document.

		keyword-dict:
			editorParams:
						A dictionary with keywords to be passed to QEditor.
		"""

		super(QProgEdit, self).__init__(tabManager)
		self.tabManager = tabManager
		self.title = title
		if dPrint is not None:
			self.dPrint = dPrint
		self.editor = QEditor(self, **editorParams)
		self.prefs = QEditorPrefs(self)
		self.prefs.hide()
		self.find = QEditorFind(self)
		self.find.hide()
		self.mainBox = QtWidgets.QVBoxLayout(self)
		self.mainBox.setContentsMargins(4,4,4,4)
		self.mainBox.setSpacing(4)
		self.mainBox.addWidget(self.prefs)
		self.mainBox.addWidget(self.find)
		self.mainBox.addWidget(self.editor)
		self.setLayout(self.mainBox)
		if self.tabManager is not None:
			self.editor.cursorPositionChanged.connect(
				self.tabManager.cornerWidget().statusWidget.updateCursorPos)