def __init__(self, parent=None, fontsize=12 ): super(notesEditor, self).__init__(parent) # Do not allow line-wrap; horizontal scrollbar appears when required. self.setLineWrapMode(QPlainTextEdit.NoWrap) # get same font as main editor uses self.setFont(pqMsgs.getMonoFont(12,False)) self.connect(self.document(), SIGNAL("modificationChanged(bool)"),self.eek) self.findText = QString()
def __init__(self, parent=None, fontsize=12): super(notesEditor, self).__init__(parent) # Do not allow line-wrap; horizontal scrollbar appears when required. self.setLineWrapMode(QPlainTextEdit.NoWrap) # get same font as main editor uses self.setFont(pqMsgs.getMonoFont(12, False)) self.connect(self.document(), SIGNAL("modificationChanged(bool)"), self.eek) self.findText = QString()
def __init__(self, parent=None, fontsize=12 ): super(PPTextEditor, self).__init__(parent) # Do not allow line-wrap; horizontal scrollbar appears when required. self.setLineWrapMode(QPlainTextEdit.NoWrap) # make sure when we jump to a line, it goes to the window center self.setCenterOnScroll(True) # Get a monospaced font as selected by the user with View>Font self.setFont(pqMsgs.getMonoFont(fontsize,True)) # instantiate our "syntax" highlighter object, but link it to an empty # QTextDocument. We will redirect it to our actual document only after # loading a document, as it relies on metadata, and then only when/if # the IMC.*HiliteSwitch es are on. self.nulDoc = QTextDocument() # make a null document self.hiliter = wordHighLighter(self.nulDoc) # all the metadata lists will be initialized when self.clear() is # called from pqMain, shortly. # save a regex for quickly finding if a selection is a single word self.oneWordRE = QRegExp(u'^\W*(\w{2,})\W*$') self.menuWord = QString() # Create and initialize an SHA-1 hash machine self.cuisineart = QCryptographicHash(QCryptographicHash.Sha1)
def __init__(self, parent=None, fontsize=12): super(PPTextEditor, self).__init__(parent) # Do not allow line-wrap; horizontal scrollbar appears when required. self.setLineWrapMode(QPlainTextEdit.NoWrap) # make sure when we jump to a line, it goes to the window center self.setCenterOnScroll(True) # Get a monospaced font as selected by the user with View>Font self.setFont(pqMsgs.getMonoFont(fontsize, True)) # instantiate our "syntax" highlighter object, but link it to an empty # QTextDocument. We will redirect it to our actual document only after # loading a document, as it relies on metadata, and then only when/if # the IMC.*HiliteSwitch es are on. self.nulDoc = QTextDocument() # make a null document self.hiliter = wordHighLighter(self.nulDoc) # all the metadata lists will be initialized when self.clear() is # called from pqMain, shortly. # save a regex for quickly finding if a selection is a single word self.oneWordRE = QRegExp(u'^\W*(\w{2,})\W*$') self.menuWord = QString() # Create and initialize an SHA-1 hash machine self.cuisineart = QCryptographicHash(QCryptographicHash.Sha1)
def __init__(self, parent=None): super(pagesPanel, self).__init__(parent) # The layout is very basic, the table with an Update button. mainLayout = QVBoxLayout() self.setLayout(mainLayout) hlayout = QHBoxLayout() self.updateButton = QPushButton("Update") self.insertText = QLineEdit() self.insertText.setFont(pqMsgs.getMonoFont()) self.insertButton = QPushButton("Insert") hlayout.addWidget(self.updateButton, 0) hlayout.addWidget(self.insertText, 1) # text gets all available room hlayout.addWidget(self.insertButton, 0) mainLayout.addLayout(hlayout) self.view = QTableView() self.view.setCornerButtonEnabled(False) self.view.setWordWrap(False) self.view.setAlternatingRowColors(True) self.view.setSortingEnabled(False) self.c1Delegate = formatDelegate() self.view.setItemDelegateForColumn(1, self.c1Delegate) self.c2Delegate = actionDelegate() self.view.setItemDelegateForColumn(2, self.c2Delegate) self.c3Delegate = folioDelegate() self.view.setItemDelegateForColumn(3, self.c3Delegate) mainLayout.addWidget(self.view, 1) # Set up the table model/view. self.model = myTableModel() self.view.setModel(self.model) # Connect the double-clicked signal of the view self.connect(self.view, SIGNAL("doubleClicked(QModelIndex)"), self.goToRow) # Connect the update button to the model's update method self.connect(self.updateButton, SIGNAL("clicked()"), self.model.updateFolios) # Connect the insert button to our insert method self.connect(self.insertButton, SIGNAL("clicked()"), self.insertMarkers)
def __init__(self, parent=None): super(pagesPanel, self).__init__(parent) # The layout is very basic, the table with an Update button. mainLayout = QVBoxLayout() self.setLayout(mainLayout) hlayout = QHBoxLayout() self.updateButton = QPushButton("Update") self.insertText = QLineEdit() self.insertText.setFont(pqMsgs.getMonoFont()) self.insertButton = QPushButton("Insert") hlayout.addWidget(self.updateButton,0) hlayout.addWidget(self.insertText,1) # text gets all available room hlayout.addWidget(self.insertButton,0) mainLayout.addLayout(hlayout) self.view = QTableView() self.view.setCornerButtonEnabled(False) self.view.setWordWrap(False) self.view.setAlternatingRowColors(True) self.view.setSortingEnabled(False) self.c1Delegate = formatDelegate() self.view.setItemDelegateForColumn(1,self.c1Delegate) self.c2Delegate = actionDelegate() self.view.setItemDelegateForColumn(2,self.c2Delegate) self.c3Delegate = folioDelegate() self.view.setItemDelegateForColumn(3,self.c3Delegate) mainLayout.addWidget(self.view,1) # Set up the table model/view. self.model = myTableModel() self.view.setModel(self.model) # Connect the double-clicked signal of the view self.connect(self.view, SIGNAL("doubleClicked(QModelIndex)"), self.goToRow) # Connect the update button to the model's update method self.connect(self.updateButton, SIGNAL("clicked()"),self.model.updateFolios) # Connect the insert button to our insert method self.connect(self.insertButton, SIGNAL("clicked()"),self.insertMarkers)
if (points > 4) and (points < 32): # don't let's get ridiculous, hmm? f = self.font() # so get our font, f.setPointSize(points) # change its point size +/- self.setFont(f) # and put the font back event.accept() else: event.ignore() super(MagicLineEdit, self).keyPressEvent(event) if __name__ == "__main__": from PyQt4.QtCore import (PYQT_VERSION_STR, QT_VERSION_STR, QSettings) from PyQt4.QtGui import (QPlainTextEdit) import pqIMC, pqMsgs import sys import os app = QApplication(sys.argv) base = os.path.dirname(__file__) kfile = open(base + '/extras/Greek.palette', 'rb') IMC = pqIMC.tricorder() IMC.editWidget = QPlainTextEdit() IMC.fontFamily = QString("Liberation Mono") pqMsgs.IMC = IMC pqMsgs.getMonoFont() IMC.settings = QSettings() kbd = KeyPalette('Greek', kfile) kbd.show() app.exec_()
change = (-1) if (key == Qt.Key_Minus) else 1 points = self.fontInfo().pointSize() + change if (points > 4) and (points < 32): # don't let's get ridiculous, hmm? f = self.font() # so get our font, f.setPointSize(points) # change its point size +/- self.setFont(f) # and put the font back event.accept() else : event.ignore() super(MagicLineEdit, self).keyPressEvent(event) if __name__ == "__main__": from PyQt4.QtCore import(PYQT_VERSION_STR,QT_VERSION_STR,QSettings) from PyQt4.QtGui import (QPlainTextEdit) import pqIMC, pqMsgs import sys import os app = QApplication(sys.argv) base = os.path.dirname(__file__) kfile = open(base+'/extras/Greek.palette','rb') IMC = pqIMC.tricorder() IMC.editWidget = QPlainTextEdit() IMC.fontFamily = QString("Liberation Mono") pqMsgs.IMC = IMC pqMsgs.getMonoFont() IMC.settings = QSettings() kbd = KeyPalette('Greek',kfile) kbd.show() app.exec_()