문제

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.

도움이 되었습니까?

해결책

Are you looking for this? For example:

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

enter image description here

다른 팁

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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top