def createTempoWidget(self): self.tempoLabel = QLabel() self.tempo = widgets.lineedit.LineEdit() c = QCompleter(completionmodel.model("scorewiz/completion/scoreproperties/tempo"), self.tempo) c.setCaseSensitivity(Qt.CaseInsensitive) self.tempo.setCompleter(c) self.tempoLabel.setBuddy(self.tempo)
def __init__(self, parent): super(HeaderWidget, self).__init__(parent) layout = QHBoxLayout() self.setLayout(layout) # The html view with the score layout example t = self.htmlView = QTextBrowser() t.setOpenLinks(False) t.setOpenExternalLinks(False) t.setSearchPaths(__path__) t.setTextInteractionFlags(Qt.LinksAccessibleByMouse) t.setFocusPolicy(Qt.NoFocus) # ensure that the full HTML example page is displayed t.setContentsMargins(2, 2, 2, 2) t.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) t.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) t.setMinimumSize(QSize(350, 350)) layout.addWidget(t) t.anchorClicked.connect(self.slotAnchorClicked) grid = QGridLayout() layout.addLayout(grid) grid.setVerticalSpacing(1) grid.setColumnMinimumWidth(1, 200) self.labels = {} self.edits = {} for row, (name, desc) in enumerate(headers()): l = QLabel() e = QLineEdit() l.setBuddy(e) grid.addWidget(l, row, 0) grid.addWidget(e, row, 1) self.labels[name] = l self.edits[name] = e c = QCompleter(completionmodel.model("scorewiz/completion/header/"+name), e) c.setCaseSensitivity(Qt.CaseInsensitive) e.setCompleter(c) self.window().accepted.connect(self.saveCompletions) app.settingsChanged.connect(self.readSettings) self.readSettings() app.translateUI(self)