本文整理汇总了C++中QMenuBar::setFont方法的典型用法代码示例。如果您正苦于以下问题:C++ QMenuBar::setFont方法的具体用法?C++ QMenuBar::setFont怎么用?C++ QMenuBar::setFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMenuBar
的用法示例。
在下文中一共展示了QMenuBar::setFont方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMenuBar
QMenuBar*
ActionCollection::createMenuBar( QWidget *parent )
{
QMenuBar* menuBar = new QMenuBar( parent );
menuBar->setFont( TomahawkUtils::systemFont() );
QMenu* controlsMenu = new QMenu( tr( "&Controls" ), menuBar );
controlsMenu->setFont( TomahawkUtils::systemFont() );
controlsMenu->addAction( m_actionCollection[ "playPause" ] );
controlsMenu->addAction( m_actionCollection[ "previousTrack" ] );
controlsMenu->addAction( m_actionCollection[ "nextTrack" ] );
controlsMenu->addSeparator();
controlsMenu->addAction( m_actionCollection[ "togglePrivacy" ] );
controlsMenu->addAction( m_actionCollection[ "showOfflineSources" ] );
controlsMenu->addSeparator();
controlsMenu->addAction( m_actionCollection[ "importPlaylist" ] );
controlsMenu->addAction( m_actionCollection[ "updateCollection" ] );
controlsMenu->addAction( m_actionCollection[ "rescanCollection" ] );
controlsMenu->addSeparator();
controlsMenu->addAction( m_actionCollection[ "quit" ] );
QMenu* settingsMenu = new QMenu( tr( "&Settings" ), menuBar );
settingsMenu->setFont( TomahawkUtils::systemFont() );
#ifndef Q_OS_MAC
settingsMenu->addAction( m_actionCollection[ "toggleMenuBar" ] );
#endif
settingsMenu->addAction( m_actionCollection[ "preferences" ] );
QMenu* helpMenu = new QMenu( tr( "&Help" ), menuBar );
helpMenu->setFont( TomahawkUtils::systemFont() );
helpMenu->addAction( m_actionCollection[ "diagnostics" ] );
helpMenu->addAction( m_actionCollection[ "openLogfile" ] );
helpMenu->addAction( m_actionCollection[ "legalInfo" ] );
helpMenu->addAction( m_actionCollection["getSupport"] );
helpMenu->addAction( m_actionCollection["reportBug"] );
helpMenu->addAction( m_actionCollection["helpTranslate"] );
helpMenu->addSeparator();
QMenu* whatsNew = helpMenu->addMenu( ImageRegistry::instance()->icon( RESPATH "images/whatsnew.svg" ), tr( "What's New in ..." ) );
whatsNew->setFont( TomahawkUtils::systemFont() );
whatsNew->addAction( m_actionCollection[ "whatsnew_0_8" ] );
helpMenu->addAction( m_actionCollection[ "aboutTomahawk" ] );
// Setup update check
#ifndef Q_OS_MAC
helpMenu->insertSeparator( m_actionCollection[ "legalInfo" ] );
#endif
#if defined( Q_OS_MAC ) && defined( HAVE_SPARKLE )
helpMenu->addAction( m_actionCollection[ "checkForUpdates" ] );
#elif defined( Q_OS_WIN )
helpMenu->addSeparator();
helpMenu->addAction( m_actionCollection[ "checkForUpdates" ] );
#endif
if ( qApp->arguments().contains( "--debug" ) )
{
helpMenu->addSeparator();
helpMenu->addAction( m_actionCollection[ "crashNow" ] );
}
menuBar->addMenu( controlsMenu );
menuBar->addMenu( settingsMenu );
#if defined( Q_OS_MAC )
QMenu* windowMenu = new QMenu( tr( "&Window" ), menuBar );
windowMenu->setFont( TomahawkUtils::systemFont() );
windowMenu->addAction( m_actionCollection[ "minimize" ] );
windowMenu->addAction( m_actionCollection[ "zoom" ] );
windowMenu->addAction( m_actionCollection[ "fullscreen" ] );
menuBar->addMenu( windowMenu );
#endif
menuBar->addMenu( helpMenu );
return menuBar;
}