change mouse cursor over clickable labels

This commit is contained in:
ThomasV 2015-05-02 13:36:10 +02:00
parent 617fb36b06
commit 9f4a914526
1 changed files with 9 additions and 0 deletions

View File

@ -115,10 +115,19 @@ class HelpLabel(QLabel):
def __init__(self, text, help_text):
QLabel.__init__(self, text)
self.help_text = help_text
self.app = QCoreApplication.instance()
def mouseReleaseEvent(self, x):
QMessageBox.information(self, 'Help', self.help_text, 'OK')
def enterEvent(self, event):
self.app.setOverrideCursor(QCursor(Qt.WhatsThisCursor))
return QLabel.enterEvent(self, event)
def leaveEvent(self, event):
self.app.setOverrideCursor(QCursor(Qt.ArrowCursor))
return QLabel.leaveEvent(self, event)
class HelpButton(QPushButton):
def __init__(self, text):