在菜单中加“工具栏”和“状态栏”,要可以隐藏的,下面这种使用方法可以吗?怎么关闭主窗口时报错?我用的是qt2.3.7。
QCheckBox *ToolBarBox = new QCheckBox( QString::fromUtf8( "工具栏" ), this, "ToolBar" );
connect( ToolBarBox, SIGNAL( toggled( bool ) ) , this, SLOT( ltoolBar( bool ) ) );
QCheckBox *StatusBarBox = new QCheckBox( QString::fromUtf8( "状态栏" ), this, "StatusBar" );
connect( StatusBarBox, SIGNAL( toggled( bool ) ) , this, SLOT( lstatusBar( bool ) ) );
QAction *MainWorkBarAction = new QAction( "MainWorkBar", QString::fromUtf8( "主界面" ), 0, this, "mainworkbar" );
QPopupMenu * lview = new QPopupMenu( this );
menuBar()->insertItem( QString::fromUtf8( "视图" ), lview );
lview->insertItem( ToolBarBox );
lview->insertItem( StatusBarBox );
MainWorkBarAction->addTo( lview );