Exemplo n.º 1
0
    def generate_custom_cursor(self):
        print(QPixmap.defaultDepth())
        bitmap = QPixmap(QSize(32, 32))
        mask = QPixmap(QSize(32, 32))
        bitmap.fill(QColor("#ffffff"))
        mask.fill(QColor("#ffffff"))

        x, y = Preview.M_SIZE
        painter = QPainter(bitmap)
        painter.setPen(QColor("#000000"))
        painter.drawRect(0, 0, x + 2, y + 2)
        painter.drawLine(x / 2 + 2, 1, x / 2 + 2, y + 1)
        painter.drawLine(1, y / 2 + 2, x + 1, y / 2 + 2)
        painter.end()

        return QCursor(QBitmap(bitmap), QBitmap(mask), (x + 2) / 2,
                       (y + 2) / 2)