コード例 #1
0
ファイル: view.py プロジェクト: zsalch/frescobaldi
 def __init__(self, document):
     """Create the View for the given document."""
     super(View, self).__init__()
     # to enable mouseMoveEvent to display tooltip
     super(View, self).setMouseTracking(True)
     self.setDocument(document)
     self.setLineWrapMode(QPlainTextEdit.NoWrap)
     self.setCursorWidth(2)
     # restore saved cursor position (defaulting to 0)
     document.loaded.connect(self.restoreCursor)
     document.loaded.connect(self.setTabWidth)
     document.closed.connect(self.slotDocumentClosed)
     self.textChanged.connect(self.invalidateCurrentBlock)
     variables.manager(document).changed.connect(self.setTabWidth)
     self.restoreCursor()
     app.settingsChanged.connect(self.readSettings)
     self.readSettings()  # will also call updateCursor
     # line wrap preference is only read on init
     wrap = QSettings().value("view_preferences/wrap_lines", False, bool)
     self.setLineWrapMode(
         QPlainTextEdit.WidgetWidth if wrap else QPlainTextEdit.NoWrap)
     self.installEventFilter(cursorkeys.handler)
     self.toolTipInfo = []
     self.block_at_mouse = None
     self.include_target = []
     app.viewCreated(self)
コード例 #2
0
ファイル: view.py プロジェクト: 19joho66/frescobaldi
 def __init__(self, document):
     """Create the View for the given document."""
     super(View, self).__init__()
     # to enable mouseMoveEvent to display tooltip
     super(View, self).setMouseTracking(True)
     self.setDocument(document)
     self.setLineWrapMode(QPlainTextEdit.NoWrap)
     self.setCursorWidth(2)
     # restore saved cursor position (defaulting to 0)
     document.loaded.connect(self.restoreCursor)
     document.loaded.connect(self.setTabWidth)
     document.closed.connect(self.slotDocumentClosed)
     self.textChanged.connect(self.invalidateCurrentBlock)
     variables.manager(document).changed.connect(self.setTabWidth)
     self.restoreCursor()
     app.settingsChanged.connect(self.readSettings)
     self.readSettings() # will also call updateCursor
     # line wrap preference is only read on init
     wrap = QSettings().value("view_preferences/wrap_lines", False, bool)
     self.setLineWrapMode(QPlainTextEdit.WidgetWidth if wrap else QPlainTextEdit.NoWrap)
     self.installEventFilter(cursorkeys.handler)
     self.toolTipInfo = []
     self.block_at_mouse = None
     self.include_target = []
     app.viewCreated(self)
コード例 #3
0
 def __init__(self, document):
     """Creates the View for the given document."""
     super(View, self).__init__()
     self.setDocument(document)
     self.setLineWrapMode(QPlainTextEdit.NoWrap)
     self.setCursorWidth(2)
     # restore saved cursor position (defaulting to 0)
     document.loaded.connect(self.restoreCursor)
     document.loaded.connect(self.setTabWidth)
     document.closed.connect(self.slotDocumentClosed)
     variables.manager(document).changed.connect(self.setTabWidth)
     self.restoreCursor()
     app.settingsChanged.connect(self.readSettings)
     self.readSettings() # will also call updateCursor
     app.viewCreated(self)
コード例 #4
0
ファイル: view.py プロジェクト: arnaldorusso/frescobaldi
 def __init__(self, document):
     """Creates the View for the given document."""
     super(View, self).__init__()
     self.setDocument(document)
     self.setLineWrapMode(QPlainTextEdit.NoWrap)
     self.setCursorWidth(2)
     # restore saved cursor position (defaulting to 0)
     document.loaded.connect(self.restoreCursor)
     document.loaded.connect(self.setTabWidth)
     document.closed.connect(self.slotDocumentClosed)
     variables.manager(document).changed.connect(self.setTabWidth)
     self.restoreCursor()
     app.settingsChanged.connect(self.readSettings)
     self.readSettings() # will also call updateCursor
     # line wrap preference is only read on init
     wrap = QSettings().value("view_preferences/wrap_lines", False, bool)
     self.setLineWrapMode(QPlainTextEdit.WidgetWidth if wrap else QPlainTextEdit.NoWrap)
     app.viewCreated(self)
コード例 #5
0
ファイル: view.py プロジェクト: ryanakca/frescobaldi
 def __init__(self, document):
     """Creates the View for the given document."""
     super(View, self).__init__()
     self.setDocument(document)
     self.setLineWrapMode(QPlainTextEdit.NoWrap)
     self.setCursorWidth(2)
     # restore saved cursor position (defaulting to 0)
     document.loaded.connect(self.restoreCursor)
     document.loaded.connect(self.setTabWidth)
     document.closed.connect(self.slotDocumentClosed)
     variables.manager(document).changed.connect(self.setTabWidth)
     self.restoreCursor()
     app.settingsChanged.connect(self.readSettings)
     self.readSettings()  # will also call updateCursor
     # line wrap preference is only read on init
     wrap = QSettings().value("view_preferences/wrap_lines", False, bool)
     self.setLineWrapMode(
         QPlainTextEdit.WidgetWidth if wrap else QPlainTextEdit.NoWrap)
     app.viewCreated(self)