Good question. I wonder why that isn't working as expected. While it does
store a status tip value that can be retrieved, it doesn't seem to
propagate that. Maybe someone else knows an exact reason... but you could
work around it if you really wanted a status tip to show. QListWidget has
an explicit event for an itemEntered, and with QListView you would have to
track it yourself:

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_()

​
I actually do something a little bit similar to this, when I have my own
random QStatusBar within a widget layout (not the main status bar) and I
want to do custom status bar messages from child widgets.

On Wed, Jun 17, 2015 at 7:22 AM ynedelin <[email protected]> wrote:

> hey guys,
> In QListView QStandartItem statusTip does not show up in the status line
>
> I am in maya 2015 using pyside
>
> I have a QListView with a QStandardItemModel with several appended rows of
> QStandardItem
>
> model = QtGui.QStandardItemModel.
> item = QtGui.QStandardItem(k)
> model.appendRow(item)
> item.setToolTip("this is tool tip")
> item.setStatusTip("this is status tip")
>
> tool tip shows up with the mouse hoovering over the item but the status
> line remains empty.
>
> Any ideas ?
>
> Thanks
> Yury
>
>
>  --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/78bbbd46-fe77-41b7-84a9-8b3b9161e21a%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/78bbbd46-fe77-41b7-84a9-8b3b9161e21a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2CsZLahEpTdj50kd5mL0STLn6-1FfXqSe79R-NsPguvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to