__init__.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Laborejo 作者: hilbrichtsoftware 项目源码 文件源码
def __init__(self, mainWindow):
        super().__init__()
        self.mainWindow = mainWindow


        viewport = QtOpenGL.QGLWidget(QtOpenGL.QGLFormat(QtOpenGL.QGL.SampleBuffers))
        viewport.format().setSwapInterval(0) #disable VSync.
        viewport.setAutoFillBackground(False)

        viewport = QtWidgets.QOpenGLWidget()
        viewportFormat = QtGui.QSurfaceFormat()
        viewportFormat.setSwapInterval(0) #disable VSync
        viewportFormat.setSamples(2**8)
        viewportFormat.setDefaultFormat(viewportFormat)
        viewport.setFormat(viewportFormat)
        self.setViewport(viewport)

        self.setAlignment(QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        #self.setDragMode(QtWidgets.QGraphicsView.RubberBandDrag)
        self.setDragMode(QtWidgets.QGraphicsView.NoDrag)

        self.scoreScene = GuiScore(self)
        self.setScene(self.scoreScene)

        api.getCallbacksDatabase().setCursor.append(self.centerOnCursor) #returns a dict
        api.getCallbacksDatabase().updateBlockTrack.append(self.updateMode)

        self.xFactor = 1 #keep track of the x stretch factor.

        style = """
        QScrollBar:horizontal {
            border: 1px solid black;
        }

        QScrollBar::handle:horizontal {
            background: #00b2b2;
        }

        QScrollBar:vertical {
            border: 1px solid black;
        }

        QScrollBar::handle:vertical {
            background: #00b2b2;
        }
        """
        self.setStyleSheet(style)

        self._zoom() #no parameters, uses config values
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号