QTableWidget에 포함된 QCombBox 객체의 행렬 정보 가져오기

2985 단어

QComboBox의currentIndexChanged (int) 신호의 SLOT에서 sender () 를 가져옵니다.
connect(comboxCircleType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCurrentIndexChanged(int)));
QTableWidget* table = new QTableWidget()
connect(comboxCircleType, SIGNAL(currentIndexChanged(int)), this, SLOT(slotCurrentIndexChanged(int))); }
And in the slot, you can use  sender()  to identify the combo box which emitted the signal.
void MainWindow::slotCurrentIndexChanged(const QString& text) { QComboBox* combo = qobject_cast<QComboBox*>(sender()); if (combo) { qDebug() << "row: " << combo->property("row").toInt(); qDebug() << "column: " << combo->property("column").toInt(); } }

전재 대상:https://www.cnblogs.com/iseekv/p/11438716.html

좋은 웹페이지 즐겨찾기