Qt QCombobox currentIndexChanged signal

人走茶凉 提交于 2019-12-12 02:09:54

问题


How get ItemIndex from one ComboBox and send to another ComboBox? Both Comb's created in QTableWidget

QComboBox *comboA = static_cast<QComboBox*>(ui->tableWidget->cellWidget(0,0));
QComboBox *comboB = static_cast<QComboBox*>(ui->tableWidget->cellWidget(0,1));
QObject::connect(comboA, SIGNAL(currentIndexChanged(int)),comboB, SLOT(setCurrentIndex(int)));

But this code does not work. Rather, it is necessary to define new methods for pointers.

来源:https://stackoverflow.com/questions/17748109/qt-qcombobox-currentindexchanged-signal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!