from PySide import QtCore, QtGui
class ListView(QtGui.QListView):
def __init__(self, *args, **kwargs):
super(ListView, self).__init__(*args, **kwargs)
self.__statusBar = None
def mouseMoveEvent(self, e):
if self.__statusBar:
idx = self.indexAt(e.pos())
if idx.isValid():
tip = idx.data(QtCore.Qt.StatusTipRole)
self.__statusBar.showMessage(tip, 5*1000)
else:
self.__statusBar.clearMessage()
def setStatusBar(self, bar):
''' Set a reference to a QStatusBar, for messages '''
self.__statusBar = bar
self.setMouseTracking(bool(bar))
# Usage
win = QtGui.QMainWindow()
listW = ListView(win)
listW.setStatusBar(win.statusBar())
mod = QtGui.QStandardItemModel(listW)
listW.setModel(mod)
item = QtGui.QStandardItem("name")
item.setToolTip("tooltip")
item.setStatusTip("status tip")
mod.appendRow(item)
win.setCentralWidget(listW)
win.show()
win.raise_()
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/78bbbd46-fe77-41b7-84a9-8b3b9161e21a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2CsZLahEpTdj50kd5mL0STLn6-1FfXqSe79R-NsPguvw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1434523295.2152909.297684433.1F5ABE9C%40webmail.messagingengine.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0jWSQKd3mokp33ePBrmf31GoEzVUBLfm-eBjTvnVAjTA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1434525799.2169229.297708313.1F715BA1%40webmail.messagingengine.com.