Show tooltip when user selects item in QComboBox

I want to show a tooltip with text and the time when the user selects an item in the list view ( QCombobox over the item in list view) QCombobox .

I am using custom QCombobox with QItemDelegate .

+10
qt qcombobox
source share
2 answers

Are you looking for this ? For example:

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

enter image description here

+19
source share

Since I did not find an example, I will post it here.

A way to do this in Python (PyQt5):

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

All Articles