A simple question, I am looking for a effect in pyqt like this:
Jquery UI slider how to make a box follow the handler?
But those code is JQuery and I am trying to achieve it with PyQT
import sys
from PyQt4 import QtGui, QtCore
class Window(QtGui.QMainWindow):
def __init__(self):
super(Window, self).__init__()
self.setGeometry(50, 50, 500, 500)
self.setWindowTitle("PyQT example!")
slider = QtGui.QSlider(self)
slider.setOrientation(QtCore.Qt.Horizontal)
slider.move(50, 50)
slider.valueChanged.connect(self.value_changed)
self.show()
def value_changed(self, value):
QtGui.QToolTip.showText(QtGui.QCursor.pos(), str(value), self)
app = QtGui.QApplication(sys.argv)
GUI = Window()
sys.exit(app.exec_())
This code successfully made tip balloon follow the cursor. Now is it possible to make the tip follow my slider handler?