如何设置combobox下拉菜单后的光标移动,也就是如何通过发信号来控制下拉框后光标的上下移动。
------解决方案--------------------
模拟键盘的上下键:
QKeyEvent *eventUp;
QKeyEvent *eventDown;
eventDown = new QKeyEvent(QEvent::KeyPress,Qt::Key_Down,0);
eventUp = new QKeyEvent(QEvent::KeyPress,Qt::Key_Up,0);
QCoreApplication::sendEvent(this->focusWidget(),eventUp);
QCoreApplication::sendEvent(this->focusWidget(),eventDown);
------解决方案--------------------
setCurrentIndex()...?