def changeIndex(self, ind):
		'''
		This function is called when a different tab is selected.
		It changes the state of the window to mirror the current state
		of the newly selected tab. Future changes to this state will be
		done in response to signals emitted by the tab, to which the
		window was subscribed when the tab was created. The window is
		subscribed to all tabs like this, but only the active tab will
		logically generate these signals.
		Aside from the above this function also calls the handlers for
		the other changes that are implied by a tab switch: filename
		change, modification state change and active markup change.
		'''
		self.currentTab = self.tabWidget.currentWidget()
		editBox = self.currentTab.editBox
		previewState = self.currentTab.previewState
		self.actionUndo.setEnabled(editBox.document().isUndoAvailable())
		self.actionRedo.setEnabled(editBox.document().isRedoAvailable())
		self.actionCopy.setEnabled(editBox.textCursor().hasSelection())
		self.actionCut.setEnabled(editBox.textCursor().hasSelection())
		self.actionPreview.setChecked(previewState >= PreviewLive)
		self.actionLivePreview.setChecked(previewState == PreviewLive)
		self.actionTableMode.setChecked(editBox.tableModeEnabled)
		self.editBar.setEnabled(previewState < PreviewNormal)
		self.ind = ind
		editBox.setFocus(Qt.OtherFocusReason)

		self.tabFileNameChanged(self.currentTab)
		self.tabModificationStateChanged(self.currentTab)
		self.tabActiveMarkupChanged(self.currentTab)
def changeIndex ( self , ind ) : self . currentTab = self . tabWidget . currentWidget ( ) editBox = self . currentTab . editBox previewState = self . currentTab . previewState self . actionUndo . setEnabled ( editBox . document ( ) . isUndoAvailable ( ) ) self . actionRedo . setEnabled ( editBox . document ( ) . isRedoAvailable ( ) ) self . actionCopy . setEnabled ( editBox . textCursor ( ) . hasSelection ( ) ) self . actionCut . setEnabled ( editBox . textCursor ( ) . hasSelection ( ) ) self . actionPreview . setChecked ( previewState >= PreviewLive ) self . actionLivePreview . setChecked ( previewState == PreviewLive ) self . actionTableMode . setChecked ( editBox . tableModeEnabled ) self . editBar . setEnabled ( previewState < PreviewNormal ) self . ind = ind editBox . setFocus ( Qt . OtherFocusReason ) self . tabFileNameChanged ( self . currentTab ) self . tabModificationStateChanged ( self . currentTab ) self . tabActiveMarkupChanged ( self . currentTab )
This function is called when a different tab is selected.
		It changes the state of the window to mirror the current state
		of the newly selected tab. Future changes to this state will be
		done in response to signals emitted by the tab, to which the
		window was subscribed when the tab was created. The window is
		subscribed to all tabs like this, but only the active tab will
		logically generate these signals.
		Aside from the above this function also calls the handlers for
		the other changes that are implied by a tab switch: filename
		change, modification state change and active markup change.