Search code examples
qtqcombobox

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.


Solution

  • Are you looking for this? For example:

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

    enter image description here