【发布时间】:2010-02-19 00:47:04
【问题描述】:
我想知道当我调用 QWidget-close() 时会发生什么,我在编写了一个设置函数后调用了它,这禁用了我的一些插槽以被调用。
之前(产生奇怪的行为):
pGrpCfg->setupGrpConfig();
pGrpCfg->close();
pGrpCfg->show();
之后(确定):
pGrpCfg->close();
pGrpCfg->setupGrpConfig();
pGrpCfg->show();
这是我的功能。我怀疑唯一可能对其产生影响的是信号连接(我想补充一点,这些连接从我使用 QSignalMapper 的构造函数开始):
无效 grpConfig::setupGrpConfig(){
断开连接(signalMapper,SIGNAL(映射(int)),这个,SIGNAL(txGrpComboBoxCurItemChanged(const int)));
断开连接(这个,信号(txGrpComboBoxCurItemChanged(const int)),这个,SLOT(updateTxFailOrderLayouts(int)));
myFPS->getData(REQUEST_SYSTEM_CONFIGURATION);
int numTxChains=myFPS->SystemData.NumberOfTransmitterChainsInSystem;
grpList.clear();
grpList.append("选择组");
for(int i=0;igetData(REQUEST_GROUP_INFORMATION,i);
grpCfgEleList.at(i)->ui.leGrpName->setText(myFPS->GroupData.Group[i].Name);
grpList.append(myFPS->GroupData.Group[i].Name);
}
for(int i=0;igetData(REQUEST_TX_CONFIGURATION,i);
txNameList.at(i)->setVisible(true);
txNameList.at(i)->setText(myFPS->TransmitterConfigurationData[i].Name);
txGrpCBlist.at(i)->setVisible(true);
txGrpCBlist.at(i)->clear();
txGrpCBlist.at(i)->addItems(grpList);
txGrpCBlist.at(i)->setCurrentIndex(myFPS->TransmitterConfigurationData[i].Group+INDEX_OFFSET);
}
for(int i=numTxChains;isetVisible(false);
txGrpCBlist.at(i)->setVisible(false);
}
for(int i=0;i}
【问题讨论】: