QComboBox 自定义显示下拉框
SZ阿辉 2013-04-15 04:52:19 各位大神,我用showPopup显示下拉框,但选定后不会回到键盘事件里面(我是用按键来显示的),
有什么方法让项目选定后回到showPopup这个函数后面。我试了下自定义显示的,用show()函数显示不出来,
下面是我自定义显示的代码:
QListView * userList;
userList = new QListView;
QStringList user;
user += "first";
user +="second";
QStringListModel *model = new QStringListModel(user);
userList->setModel(model); //useList是个QListView
m_pComboBox[2][5]->setModel( userList->model() );
m_pComboBox[2][5]->setView(userList);
m_pComboBox[2][5]->setEditable(true);
m_pComboBox[2][5]->show();