views:

71

answers:

0

Here is the code, but it dos not work. Who can create the code. Thanks very much!

void add() {

QComboBox *ziduan = new QComboBox;

ziduan->addItem("年度","nd");

int row =0;

int col =1;

QSignalMapper* signalMapper = new QSignalMapper(this); 

connect(ziduan, SIGNAL(currentIndexChanged(int)), signalMapper, SLOT(map())); 

signalMapper->setMapping(ziduan, QString("%1-%2").arg(row).arg(col)); 

connect(signalMapper, SIGNAL(mapped(const QString &)),this, SIGNAL(changeZiduan(const QString &))); 

}

void sqlGenerator::changeZiduan(const QString &position) {

 QStringList coordinates = position.split("-"); 

 int row = coordinates[0].toInt(); 

 int col = coordinates[1].toInt(); 

}