本文整理汇总了C++中KToggleAction::setExclusiveGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ KToggleAction::setExclusiveGroup方法的具体用法?C++ KToggleAction::setExclusiveGroup怎么用?C++ KToggleAction::setExclusiveGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KToggleAction
的用法示例。
在下文中一共展示了KToggleAction::setExclusiveGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KMdiMainFrm
KMDITest::KMDITest()
: KMdiMainFrm( 0, "KMDITest", KMdi::IDEAlMode ), m_childs( 0 )
{
setXMLFile("kmditestui.rc");
// Create some actions
KStdAction::openNew( this, SLOT( openNewWindow() ), actionCollection() );
KStdAction::close( this, SLOT( closeCurrent() ), actionCollection() );
KStdAction::quit( kapp, SLOT( quit() ), actionCollection() );
// Allow the user to change the MDI mode
KToggleAction *tl = new KRadioAction( i18n( "Top level mode" ), KShortcut(),
this, SLOT( switchToToplevelMode() ), actionCollection(), "toplevel" );
tl->setExclusiveGroup( "MDIMode" );
KToggleAction *cf = new KRadioAction( i18n( "Child frame mode" ), KShortcut(),
this, SLOT( switchToChildframeMode() ), actionCollection(), "childframe" );
cf->setExclusiveGroup( "MDIMode" );
KToggleAction *tp = new KRadioAction( i18n( "Tab page mode" ), KShortcut(),
this, SLOT( switchToTabPageMode() ), actionCollection(), "tabpage" );
tp->setExclusiveGroup( "MDIMode" );
KToggleAction *id = new KRadioAction( i18n( "IDEAl mode" ), KShortcut(),
this, SLOT( switchToIDEAlMode() ), actionCollection(), "ideal" );
id->setExclusiveGroup( "MDIMode" );
id->setChecked( true );
createGUI( 0 );
// When we change view, change the status bar text
connect( this, SIGNAL( viewActivated( KMdiChildView * ) ),
this, SLOT( currentChanged( KMdiChildView * ) ) );
// Create the status bar
statusBar()->message( i18n( "No view!" ) );
// Create the list of the opened windows
m_listBox = new KListBox( this );
m_listBox->setCaption( i18n( "Opened windows" ) );
addToolWindow( m_listBox, KDockWidget::DockLeft, getMainDockWidget() );
connect( m_listBox, SIGNAL( executed( QListBoxItem * ) ), this,
SLOT( listBoxExecuted( QListBoxItem * ) ) );
}