其他分享
首页 > 其他分享> > QT界面开发-使用new QComboBox添加触发事件

QT界面开发-使用new QComboBox添加触发事件

作者:互联网

 1     //创建QComboBox控件
 2             m_comboBox = new QComboBox(ww);
 3             m_comboBox->setObjectName(GBK::ToUnicode(sheet1Ini));
 4             m_comboBox->setGeometry(0, 0, 100, 20);
 5             m_comboBox->setFont(font);
 6             m_comboBox->move(150, ((i - 3) * 30) + 0);
 7             for (int j = 0; j < choiseData.size(); j++)
 8             {
 9                 m_comboBox->addItem(GBK::ToUnicode(choiseData[j].c_str()));
10             }
11             m_comboBox->setCurrentIndex(defaultValue);        
12             m_comboBox->show();
13             connect(m_comboBox, SIGNAL(currentIndexChanged(const QString)), this, SLOT(m_open(const QString)));
1 int NewEdgewinDesignTest::m_open(const QString &text)
2 {
3     QMessageBox::warning(this, "error", text);
4     return 0;
5 }

标签:const,QT,int,comboBox,QComboBox,GBK,QString,new
来源: https://www.cnblogs.com/nxopen2018/p/12206548.html