引用第5楼dbzhang800于2010-05-19 09:20发表的 :
贴你的代码来证明该信号的存在!
SerialThread::SerialThread(MainWindow *parent)
{
this->parent = parent;
}
void SerialThread::run()
{
extern int i;
MainWindow *parent;
if(0 == i)
{
emit msgBoxsignal_0();
}
if(1 == i)
{
emit msgBoxsignal_1();
connect(parent, SIGNAL(serialsignal_1()), this, SLOT(serialslot_1()));
}
if(2 == i)
{
emit msgBoxsignal_2();
connect(parent, SIGNAL(serialsignal_2()), this, SLOT(serialslot_2()));
}
if(3 == i)
{
emit msgBoxsignal_3();
connect(parent, SIGNAL(serialsignal_3()), this, SLOT(serialslot_3()));
}
if(4 == i)
{
emit msgBoxsignal_4();
connect(parent, SIGNAL(serialsignal_4()), this, SLOT(serialslot_4()));
}
if(5 == i)
{
emit msgBoxsignal_5();
connect(parent, SIGNAL(serialsignal_5()), this, SLOT(serialslot_5()));
}
if(6 == i)
{
emit msgBoxsignal_6();
connect(parent, SIGNAL(serialsignal_6()), this, SLOT(serialslot_6()));
}
if(7 == i)
{
emit msgBoxsignal_7();
connect(parent, SIGNAL(serialsignal_7()), this, SLOT(serialslot_7()));
}
if(8 == i)
{
emit msgBoxsignal_8();
connect(parent, SIGNAL(serialsignal_8()), this, SLOT(serialslot_8()));
}
if(9 == i)
{
emit msgBoxsignal_9();
connect(parent, SIGNAL(serialsignal_9()), this, SLOT(serialslot_9()));
}
if(10 == i)
{
emit msgBoxsignal_10();
connect(parent, SIGNAL(serialsignal_10()), this, SLOT(serialslot_10()));
}
if(11 == i)
{
emit msgBoxsignal_11();
connect(parent, SIGNAL(serialsignal_11()), this, SLOT(serialslot_11()));
}
if(12 == i)
{
emit msgBoxsignal_12();
connect(parent, SIGNAL(serialsignal_12()), this, SLOT(serialslot_12()));
}
if(13 == i)
{
emit msgBoxsignal_13();
connect(parent, SIGNAL(serialsignal_13()), this, SLOT(serialslot_13()));
}
接收的是combobox的currentIndex的值后发送信号,用emit发送的,具体函数没有去实现