예제 #1
0
    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
            completionmodel.complete(e, "scorewiz/completion/header/" + name)
            e.completer().setCaseSensitivity(Qt.CaseInsensitive)

        app.settingsChanged.connect(self.readSettings)
        self.readSettings()
        app.translateUI(self)
예제 #2
0
 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
         completionmodel.complete(e, "scorewiz/completion/header/"+name)
         e.completer().setCaseSensitivity(Qt.CaseInsensitive)
     
     app.settingsChanged.connect(self.readSettings)
     self.readSettings()
     app.translateUI(self)