Browse Source

underline help label

283
ThomasV 10 years ago
parent
commit
0a1c8f5546
  1. 7
      gui/qt/util.py

7
gui/qt/util.py

@ -116,15 +116,20 @@ class HelpLabel(QLabel):
QLabel.__init__(self, text)
self.help_text = help_text
self.app = QCoreApplication.instance()
self.font = QFont()
def mouseReleaseEvent(self, x):
QMessageBox.information(self, 'Help', self.help_text, 'OK')
def enterEvent(self, event):
self.app.setOverrideCursor(QCursor(Qt.WhatsThisCursor))
self.font.setUnderline(True)
self.setFont(self.font)
self.app.setOverrideCursor(QCursor(Qt.PointingHandCursor))
return QLabel.enterEvent(self, event)
def leaveEvent(self, event):
self.font.setUnderline(False)
self.setFont(self.font)
self.app.setOverrideCursor(QCursor(Qt.ArrowCursor))
return QLabel.leaveEvent(self, event)

Loading…
Cancel
Save