我想为QComboBox
他的项目设置光标形状。setCursor
仅影响LineEdit
部分QComboBox
,如何访问项目视图以更改光标形状?
QComboBox *combo = new QComboBox();
combo->addItem("One");
combo->addItem("Two");
combo->addItem("Three");
combo->setCursor(Qt::PointingHandCursor); // changes cursor only for LineEdit part, on popup cursor is still arrow
combo->view()->setCursor(Qt::PointingHandCursor); // does not affect popup view
我们使用 Qt 5.5.1