我使用的是QT版本是QT-2.3.7,出现的问题是第二个窗体不能显示出来!!! 
具体的代码如下: 
/****************************Main.cpp*********************************************/ 
#include <qapplication.h> 
#include "formtest.h" 
int main( int argc, char ** argv ) 
{ 
    QApplication app( argc, argv ); 
    First formTest; 
    app.setMainWidget(&formTest); 
    formTest.show(); 
    return app.exec(); 
} 
/*第一个窗体的文件******************************************************************/ 
          /******************formtest.h***********************/ 
/**************************************************************************** 
** Form interface generated from reading ui file 'formtest.ui' 
** 
** Created: Thu May 21 20:30:55 2009 
**      by:  The User Interface Compiler (uic) 
** 
** WARNING! All changes made in this file will be lost! 
****************************************************************************/ 
#ifndef FIRST_H 
#define FIRST_H 
#include <qvariant.h> 
#include <qwidget.h> 
#include "./formtest2.h" 
class QVBoxLayout; 
class QHBoxLayout; 
class QGridLayout; 
class QPushButton; 
class SecondForm; 
class First : public QWidget 
{ 
    Q_OBJECT 
public: 
    First( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 
    ~First(); 
    
    QPushButton* OKButton; 
    SecondForm secondForm; 
private slots: 
    void displayForm2( ); 
}; 
#endif // FIRST_H 
/**************formtest.cpp************************/ 
/**************************************************************************** 
** Form implementation generated from reading ui file 'formtest.ui' 
** 
** Created: Thu May 21 20:31:05 2009 
**      by:  The User Interface Compiler (uic) 
** 
** WARNING! All changes made in this file will be lost! 
****************************************************************************/ 
#include "formtest.h" 
#include <qpushbutton.h> 
#include <qlayout.h> 
#include <qvariant.h> 
#include <qtooltip.h> 
#include <qwhatsthis.h> 
/* 
*  Constructs a First which is a child of 'parent', with the 
*  name 'name' and widget flags set to 'f' 
*/ 
First::First( QWidget* parent,  const char* name, WFlags fl ) 
    : QWidget( parent, name, fl ) 
{ 
    if ( !name ) 
setName( "First" ); 
    resize( 400, 400 ); 
    setMaximumSize( QSize( 400, 400 ) ); 
    setCaption( tr( "first" ) ); 
    OKButton = new QPushButton( this, "OKButton" ); 
    OKButton->setGeometry( QRect( 140, 70, 70, 40 ) ); 
    OKButton->setText( tr( "OK" ) ); 
  
    connect(OKButton, SIGNAL( clicked() ), this, SLOT( displayForm2( ) ) ); 
  
} 
/*  
*  Destroys the object and frees any allocated resources 
*/ 
First::~First() 
{ 
    // no need to delete child widgets, Qt does it all for us 
} 
void First::displayForm2( ) 
{ 
  this->close(); 
  secondForm.show(); 
                      
} 
/*第二个窗体的文件************************************************************/ 
/***********************************formtest2.h****************************************/ 
/**************************************************************************** 
** Form interface generated from reading ui file 'formtest2.ui' 
** 
** Created: Thu May 21 20:31:18 2009 
**      by:  The User Interface Compiler (uic) 
** 
** WARNING! All changes made in this file will be lost! 
****************************************************************************/ 
#ifndef SECONDFORM_H 
#define SECONDFORM_H 
#include <qvariant.h> 
#include <qwidget.h> 
class QVBoxLayout; 
class QHBoxLayout; 
class QGridLayout; 
class QTextBrowser; 
class SecondForm : public QWidget 
{ 
    Q_OBJECT 
public: 
    SecondForm( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 
    ~SecondForm(); 
    QTextBrowser* TextBrowser1; 
}; 
#endif // SECONDFORM_H 
/****************************************formtest2.cpp********************************/ 
/**************************************************************************** 
** Form implementation generated from reading ui file 'formtest.ui' 
** 
** Created: Thu May 21 20:31:05 2009 
**      by:  The User Interface Compiler (uic) 
** 
** WARNING! All changes made in this file will be lost! 
****************************************************************************/ 
#include "formtest.h" 
#include <qpushbutton.h> 
#include <qlayout.h> 
#include <qvariant.h> 
#include <qtooltip.h> 
#include <qwhatsthis.h> 
/* 
*  Constructs a First which is a child of 'parent', with the 
*  name 'name' and widget flags set to 'f' 
*/ 
First::First( QWidget* parent,  const char* name, WFlags fl ) 
    : QWidget( parent, name, fl ) 
{ 
    if ( !name ) 
setName( "First" ); 
    resize( 400, 400 ); 
    setMaximumSize( QSize( 400, 400 ) ); 
    setCaption( tr( "first" ) ); 
    OKButton = new QPushButton( this, "OKButton" ); 
    OKButton->setGeometry( QRect( 140, 70, 70, 40 ) ); 
    OKButton->setText( tr( "OK" ) ); 
  
    connect(OKButton, SIGNAL( clicked() ), this, SLOT( displayForm2( ) ) ); 
  
} 
/*  
*  Destroys the object and frees any allocated resources 
*/ 
First::~First() 
{ 
    // no need to delete child widgets, Qt does it all for us 
} 
void First::displayForm2( ) 
{ 
  this->close(); 
  secondForm.show(); 
                      
}