def __init__(self, parent=None):
super(ShapedClock, self).__init__(parent,
Qt.FramelessWindowHint | Qt.WindowSystemMenuHint)
timer = QTimer(self)
timer.timeout.connect(self.update)
timer.start(1000)
quitAction = QAction("E&xit", self, shortcut="Ctrl+Q",
triggered=QApplication.instance().quit)
self.addAction(quitAction)
self.setContextMenuPolicy(Qt.ActionsContextMenu)
self.setToolTip("Drag the clock with the left mouse button.\n"
"Use the right mouse button to open a context menu.")
self.setWindowTitle(self.tr("Shaped Analog Clock"))
评论列表
文章目录