Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我开始使用 QT,并且遇到了这样的问题。我需要将某个字段(行)的字体设置QCombobox为斜体。有没有办法做到这一点?
QCombobox
谢谢你。
看看QtComboBox::setItemData。
例子:
newFont=QFont("FontFamily",italic=True) myComboBox.setItemData(0, newFont, Qt::FontRole) // Where 0 is your index. Compute as necessary
另请查看此线程,该线程讨论了类似的粗体操作。