Show tooltip when the user selects item in QComboBox

I want to show the tooltip with the text and the time when user selects the item in list view (hovers the mouse on the item in the list view) of QCombobox.

I'm using a custom QComboBox with QItemDelegate.

Answers


Are you looking for this? For example:

 ui->comboBox->setItemData(0, "This is a tooltip for item[0]", Qt::ToolTipRole);


Since I did not find an example, I'll post this here.

The way to do this on Python (PyQt5) is:

from PyQt5 import QtGui, QtCore
...
combobox.setItemData(0, "This is a tooltip for item[0]",QtCore.Qt.ToolTipRole);

Need Your Help

What are the differences between the urllib, urllib2, urllib3 and requests module?

python python-requests urllib2 urllib python-2.x

In Python, what are the differences between the urllib, urllib2, urllib3 and requests module? Why are there three? They seem to do the same thing...

Why does a self-referencing iframe not infinitely loop and crash my machine?

html internet-explorer google-chrome firefox iframe

I created a simple HTML page with an iframe whose src attribute references the containing page -- in other words a self-referencing iframe.