Ejemplo n.º 1
0
 def toggleCursor(self):
     if self.cursor().shape() == QCursor(Qt.ArrowCursor).shape():
         raw = QPixmap(":/gui/pics/pardusman-icon.png")
         raw.setMask(raw.mask())
         self.setCursor(QCursor(raw, 2, 2))
     else:
         self.unsetCursor()
Ejemplo n.º 2
0
 def toggleCursor(self):
     if self.cursor().shape() == QCursor(Qt.ArrowCursor).shape():
         raw = QPixmap(":/gui/pics/pardusman-icon.png")
         raw.setMask(raw.mask())
         self.setCursor(QCursor(raw, 2, 2))
     else:
         self.unsetCursor()
Ejemplo n.º 3
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__author__ = 'ipetrash'

from PyQt5.Qt import QApplication, QPixmap, QLabel

app = QApplication([])

pix = QPixmap("pipe.png")

win = QLabel()
win.setPixmap(pix)
win.setMask(pix.mask())
win.show()

app.exec()
Ejemplo n.º 4
0
    widget.move(pos)


if __name__ == '__main__':
    app = QApplication(sys.argv)

    lifetime_ms = 3000
    if len(sys.argv) == 2:
        lifetime_ms = int(sys.argv[1])

    pix = QPixmap(FILE_NAME)

    mw = QLabel()
    mw.setWindowFlag(Qt.WindowStaysOnTopHint)
    mw.setWindowFlag(Qt.FramelessWindowHint)
    mw.setPixmap(pix)
    mw.setMask(pix.mask())

    mw.show()

    move_window_to_cursor(mw)

    timer = QTimer()
    timer.timeout.connect(lambda: move_window_to_cursor(mw))
    timer.start(33)

    QTimer.singleShot(lifetime_ms, app.quit)

    app.exec()