当前位置:编程学习 > wap >>

在qt4中关于窗口关闭的问题

在qt3中,想要在关闭主窗口或主程序时,所有打开的独立的子窗口都能同时被关闭,是在main.cpp文件中连接信号void QApplication::lastWindowClosed ();如
int main( int argc, char ** argv )
{
    QApplication a( argc, argv );
    ABMainWindow *mw = new ABMainWindow();
    mw->setCaption( "Qt Example - Addressbook" );
    a.setMainWidget( mw );
    mw->show();
    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
    int result = a.exec();
    delete mw;
    return result;
}
但是,qt4中没有setMainWidget(),我要想实现此功能,该怎么办? --------------------编程问答-------------------- 不需要实现,顶级窗口关闭,程序自动结束
补充:移动开发 ,  Qt
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,