QWidget显示功能奇怪

时间:2012-10-30 03:21:15

标签: c++ qt qwidget

两个UI类,也称为主题。 然后写一些控制事件。 这是我的主要代码

  if(ui==1){
    theme1=new theme1();
    connect(theme1->ui->btn_send1,SIGNAL(clicked()),this,SLOT(Btn_Click_send1()));      
    connect(theme1->ui->btn_send2,SIGNAL(clicked()),this,SLOT(Btn_Click_send2()));       

 }else{
     theme2=new theme2();
     connect(theme2->ui->btn_send1,SIGNAL(clicked()),this,SLOT(Btn_Click_send1()));     
    connect(theme2->ui->btn_send2,SIGNAL(clicked()),this,SLOT(Btn_Click_send2()));      
 }
 void testCode::Btn_Click_send1(){
  run1=new Run1();
   run1.show();
 }
void testCode::Btn_Click_send2(){
run2=new Run2();
run2.show();

}

UI等于1,代码很好,但等于其他UI出现BUG。

在show()中发现错误时进行调试。

Run1和Run2在其他类中运行,但它很好。

我不知道为什么!!!一个星期,我很着急!

谢谢大家!

0 个答案:

没有答案
相关问题