On 11/30/2013 07:55 AM, Terry Brown wrote:
> Apparently Qt doesn't support tooltips for menu *items*
> http://qt-project.org/forums/viewthread/8663
Perhaps that forum thread is about a Qt Designer limitation, not a PyQt4
limitation. Perhaps, it is out of date.
Tooltips on menu items works for me. Here are is the relevant code
excerpted from my program:
------
self._menuSpecial = QtGui.QMenu(self)
self.connect(self._menuSpecial, QtCore.SIGNAL("hovered(QAction *)"),
self._actionHovered)
actTDL = QtGui.QAction('&Show defaults', self._menuSpecial)
actTDL.setToolTip('Show all control parameter defaults.')
self._menuSpecial.connect(actTDL,
Qt.SIGNAL("activated()"),
lambda : self._callController(Cpolima.VcC_ShowDefaults))
self._menuSpecial.addAction(actTDL)
------
def _actionHovered(self, action):
""" Cursor hovering over a context menu item.
"""
tip = action.toolTip()
QtGui.QToolTip.showText(QtGui.QCursor.pos(), tip)
--
Segundo Bob
[email protected]
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.