本文整理汇总了C++中TabButton::setMenu方法的典型用法代码示例。如果您正苦于以下问题:C++ TabButton::setMenu方法的具体用法?C++ TabButton::setMenu怎么用?C++ TabButton::setMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabButton
的用法示例。
在下文中一共展示了TabButton::setMenu方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qDebug
TabWidget::TabWidget( QWidget* parent )
{
qDebug() << "[TABWIDGET] Constructing";
mGrabbedWidget = 0;
mTabs = 0;
// set the tab position
setTabsPosition();
mStatusBar = &mStatusBar->getInstance();
// create the tabbar
mBar = new TabBar;
setTabBar( mBar );
// connect the mouse clicks
connect( mBar, SIGNAL( tabRightClicked( int, QPoint ) ),
this, SLOT( tabRightClicked( int, QPoint ) ) );
connect( mBar, SIGNAL( tabMiddleClicked( int, QPoint ) ),
this, SLOT( tabMiddleClicked( int, QPoint ) ) );
TabButton* newTabButton = new TabButton( this );
TabButton* mMenuButton = new TabButton( this );
connect( newTabButton, SIGNAL( clicked() ),
this, SLOT( addUnityBrowser()) );
connect( newTabButton, SIGNAL( middleClicked() ),
this, SLOT( addUnityBrowserWithSR() ) );
connect( mMenuButton, SIGNAL( clicked() ),
mMenuButton, SLOT( showMenu()) );
mMenuButton->setMenu( kueueMainMenu() );
newTabButton->setIcon( QIcon( ":icons/menus/newtab.png" ) );
mMenuButton->setIcon( QIcon(":/icons/kueue.png") );
if ( Settings::unityEnabled() )
{
setCornerWidget( newTabButton, Qt::TopRightCorner );
}
setCornerWidget( mMenuButton, Qt::TopLeftCorner );
// create the main browser tabs...
mQueueBrowser = new QueueBrowser( this );
mSubownerBrowser = new SubownerBrowser( this );
mPersonalTab = new BrowserWithSearch( mQueueBrowser, this );
mSubownerTab = new BrowserWithSearch( mSubownerBrowser, this );
connect( mQueueBrowser, SIGNAL( setMenus() ),
this, SLOT( setMenus() ) );
connect( mSubownerBrowser, SIGNAL( setMenus() ),
this, SLOT( setMenus() ) );
connect( mQueueBrowser, SIGNAL( expandAll() ),
this, SLOT( expandAllTables() ) );
connect( mQueueBrowser, SIGNAL( closeAll() ),
this, SLOT( closeAllTables() ) );
mQmonBrowser = new QMonBrowser( this );
mMonitorTab = new BrowserWithSearch( mQmonBrowser, this );
mStatsBrowser = new StatsBrowser( this );
mStatsTab = new BrowserWithSearch( mStatsBrowser, this );
if ( Settings::unityEnabled() )
{
addUnityBrowser();
rebuildMaps();
}
mSubVisible = true;
// ...and add them to the tabbar
insertTab( 0, mPersonalTab, QIcon( ":icons/conf/targets.png" ), "Personal queue" );
insertTab( 1, mSubownerTab, QIcon( ":icons/conf/targets.png" ), "Subowned SRs" );
insertTab( 2, mMonitorTab, QIcon( ":/icons/conf/monitor.png" ), "Queue monitor" );
insertTab( 3, mStatsTab, QIcon( ":/icons/conf/stats.png" ), "Statistics" );
QShortcut* search = new QShortcut( QKeySequence( Qt::CTRL + Qt::Key_F ), this );
connect( search, SIGNAL( activated() ),
this, SLOT( showSearch() ) );
refreshTabs();
}