def initLogo(self, layout): font_label = QFont() font_label.setBold(True) font_info = QFont() font_info.setItalic(True) font_info.setPixelSize(12) lisa_logo = QLabel() logopath = find_logo() logo = QPixmap(logopath) logo = logo.scaled(130, 130) lisa_logo.setPixmap(logo) # scaledToWidth(128)) lisa_logo.mousePressEvent = lambda event: self.changeWidget('Main') layout.addWidget(lisa_logo) return layout
def _iconOverlayEvent(self, event): popup = QMenu(self) layout = QVBoxLayout() layout.setContentsMargins(4, 4, 4, 4) popup.setLayout(layout) iconLabel = QLabel(popup) layout.addWidget(iconLabel) closeEvent = lambda event: popup.setParent(None) geometry = self.songIcon.geometry() songIcon = QPixmap(self.iconPath) iconLabel.setGeometry(geometry) iconLabel.setPixmap(songIcon) iconLabel.mousePressEvent = closeEvent popup.popup(event.globalPos() - event.pos())
def mousePressEvent(self, event): self.emit(SIGNAL("clicked()")) # Use busy cursor for 2 secs self.setCursor(Qt.WaitCursor) QTimer.singleShot(2000, self, SLOT("slot_setNormalCursor()")) QLabel.mousePressEvent(self, event)
def mousePressEvent(self, event): self.emit(SIGNAL("clicked()")) # Use busy cursor for 2 secs self.setCursor(Qt.WaitCursor) QTimer.singleShot(2000, self, SLOT("slot_setNormalCursor()")) QLabel.mousePressEvent(self, event)