本文整理汇总了C++中setMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ setMenu函数的具体用法?C++ setMenu怎么用?C++ setMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setMenu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: navigateElevationMenu
static void navigateElevationMenu(int inputResult)
{
switch (inputResult) {
case 1:
// Go to elevation angle
setMenu(ElGoto);
break;
case 2:
// Set elevation minimum
setMenu(ElMin);
break;
case 3:
// Set elevation maximum
setMenu(ElMax);
break;
case 4:
if (m_userMode == FACTORY) {
// Calibrate the elevation servo
} else {
m_currentMenu.returnToPrevious();
// Go back one level
}
break;
case 5:
if (m_userMode == FACTORY) {
// Calibrate the elevation servo
break;
}
// If not in factory mode, this is an error;
default:
if (m_userMode == FACTORY) errOutOfRange(1, 5);
else errOutOfRange(1, 4);
break;
}
}
开发者ID:MTRX3700Dirac,项目名称:Yavin4DefenceSystem,代码行数:35,代码来源:Menusystem.c
示例2: setMenu
void MainMenuBar::reload()
{
setMenu(NULL);
// Reload all menus.
AppMenus::instance()->reload();
setMenu(AppMenus::instance()->getRootMenu());
}
开发者ID:BlueHeisenberg,项目名称:aseprite,代码行数:9,代码来源:main_menu_bar.cpp
示例3: setMenu
void CustomColorButton::usePopupGrid(bool bGrid)
{
if (bGrid == true)
{
setMenu(mpMenu);
setPopupMode(QToolButton::MenuButtonPopup);
}
else
{
setMenu(NULL);
setPopupMode(QToolButton::DelayedPopup);
}
}
开发者ID:Tom-VdE,项目名称:opticks,代码行数:13,代码来源:CustomColorButton.cpp
示例4: QMainWindow
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), localServer(0)
{
QPixmapCache::setCacheLimit(200000);
client = new RemoteClient;
connect(client, SIGNAL(connectionClosedEventReceived(const Event_ConnectionClosed &)), this, SLOT(processConnectionClosedEvent(const Event_ConnectionClosed &)));
connect(client, SIGNAL(serverShutdownEventReceived(const Event_ServerShutdown &)), this, SLOT(processServerShutdownEvent(const Event_ServerShutdown &)));
connect(client, SIGNAL(loginError(Response::ResponseCode, QString, quint32)), this, SLOT(loginError(Response::ResponseCode, QString, quint32)));
connect(client, SIGNAL(socketError(const QString &)), this, SLOT(socketError(const QString &)));
connect(client, SIGNAL(serverTimeout()), this, SLOT(serverTimeout()));
connect(client, SIGNAL(statusChanged(ClientStatus)), this, SLOT(statusChanged(ClientStatus)));
connect(client, SIGNAL(protocolVersionMismatch(int, int)), this, SLOT(protocolVersionMismatch(int, int)));
connect(client, SIGNAL(userInfoChanged(const ServerInfo_User &)), this, SLOT(userInfoReceived(const ServerInfo_User &)), Qt::BlockingQueuedConnection);
clientThread = new QThread(this);
client->moveToThread(clientThread);
clientThread->start();
createActions();
createMenus();
tabSupervisor = new TabSupervisor(client);
connect(tabSupervisor, SIGNAL(setMenu(QList<QMenu *>)), this, SLOT(updateTabMenu(QList<QMenu *>)));
connect(tabSupervisor, SIGNAL(localGameEnded()), this, SLOT(localGameEnded()));
tabSupervisor->addDeckEditorTab(0);
setCentralWidget(tabSupervisor);
retranslateUi();
resize(900, 700);
restoreGeometry(settingsCache->getMainWindowGeometry());
aFullScreen->setChecked(windowState() & Qt::WindowFullScreen);
}
开发者ID:Aurenos,项目名称:Cockatrice,代码行数:35,代码来源:window_main.cpp
示例5: QToolButton
QgsColorButton::QgsColorButton( QWidget *parent, const QString &cdt, QgsColorSchemeRegistry *registry )
: QToolButton( parent )
, mBehavior( QgsColorButton::ShowDialog )
, mColorDialogTitle( cdt.isEmpty() ? tr( "Select Color" ) : cdt )
, mColor( QColor() )
, mDefaultColor( QColor() ) //default to invalid color
, mAllowOpacity( false )
, mAcceptLiveUpdates( true )
, mColorSet( false )
, mShowNoColorOption( false )
, mNoColorString( tr( "No color" ) )
, mShowNull( false )
, mPickingColor( false )
, mMenu( nullptr )
{
//if a color scheme registry was specified, use it, otherwise use the global instance
mColorSchemeRegistry = registry ? registry : QgsApplication::colorSchemeRegistry();
setAcceptDrops( true );
setMinimumSize( QSize( 24, 16 ) );
connect( this, &QAbstractButton::clicked, this, &QgsColorButton::buttonClicked );
//setup dropdown menu
mMenu = new QMenu( this );
connect( mMenu, &QMenu::aboutToShow, this, &QgsColorButton::prepareMenu );
setMenu( mMenu );
setPopupMode( QToolButton::MenuButtonPopup );
}
开发者ID:ndavid,项目名称:QGIS,代码行数:29,代码来源:qgscolorbutton.cpp
示例6: KTopLevelWidget
servercontroller::servercontroller /*FOLD00*/
(
QWidget*,
const char* name
)
:
KTopLevelWidget( name )
{
MenuBar = new("KMenuBar") KMenuBar(this, QString(name) + "_menu");
setMenu(MenuBar);
if(kSircConfig->DisplayMode == 0){
SDI:
displayMgr = new("DisplayMgrSDI") DisplayMgrSDI();
sci = new("scInside") scInside(this, QString(name) + "_mainview");
setView(sci, TRUE);
}
else if(kSircConfig->DisplayMode == 1){
DisplayMgrMDI *displayMgrMDI = new("DisplayMgrMDI") DisplayMgrMDI(this);
sci = new("scInside") scInside(this, QString(name) + "_mainview");
displayMgrMDI->newTopLevel(sci, TRUE);
displayMgrMDI->setCaption(sci, "Server Controller");
KMDIMgrBase *mgr = (KMDIMgrBase *)displayMgrMDI->getMGR();
KMDIWindow *km = mgr->getWindowByName((char *) sci->name());
if(km != 0)
connect(km, SIGNAL(minimized(KMDIWindow *)),
this, SLOT(MDIMinimized(KMDIWindow *)));
else
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:31,代码来源:servercontroller.cpp
示例7: UIAction
UIActionMenu::UIActionMenu(QObject *pParent, const QIcon &icon)
: UIAction(pParent, UIActionType_Menu)
{
if (!icon.isNull())
setIcon(icon);
setMenu(new UIMenu);
}
开发者ID:gvsurenderreddy,项目名称:VirtualBox-OSE,代码行数:7,代码来源:UIActionPool.cpp
示例8: QAction
wxQtAction::wxQtAction( wxMenu *parent, int id, const wxString &text, const wxString &help,
wxItemKind kind, wxMenu *subMenu, wxMenuItem *handler )
: QAction( wxQtConvertString( text ), parent->GetHandle() ),
wxQtSignalHandler< wxMenuItem >( handler )
{
setStatusTip( wxQtConvertString( help ));
if ( subMenu != NULL )
setMenu( subMenu->GetHandle() );
if ( id == wxID_SEPARATOR )
setSeparator( true );
switch ( kind )
{
case wxITEM_SEPARATOR:
setSeparator( true );
break;
case wxITEM_CHECK:
case wxITEM_RADIO:
setCheckable( true );
break;
case wxITEM_NORMAL:
// Normal for a menu item.
break;
case wxITEM_DROPDOWN:
case wxITEM_MAX:
// Not applicable for menu items.
break;
}
connect( this, &QAction::triggered, this, &wxQtAction::onActionTriggered );
}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:33,代码来源:menuitem.cpp
示例9: clearCompare
void clearCompare(void)
{
if (pCurHexEdit->GetHexProp().pCmpResult->hFile != NULL) {
pCurHexEdit->SetCompareResult(NULL);
setMenu();
}
}
开发者ID:zxjqazwsx,项目名称:HexEditor_0_9_5_git,代码行数:7,代码来源:Hex.cpp
示例10: toggleHexEdit
void toggleHexEdit(void)
{
GetShortCuts(nppData._nppHandle);
pCurHexEdit->doDialog(TRUE);
DialogUpdate();
setMenu();
}
开发者ID:zxjqazwsx,项目名称:HexEditor_0_9_5_git,代码行数:7,代码来源:Hex.cpp
示例11: UIActionInterface
UIMenuAction::UIMenuAction(QObject *pParent, const QIcon &icon)
: UIActionInterface(pParent, UIActionType_Menu)
{
if (!icon.isNull())
setIcon(icon);
setMenu(new UIMenuInterface);
}
开发者ID:LastRitter,项目名称:vbox-haiku,代码行数:7,代码来源:UIActionPool.cpp
示例12: QPopupMenu
void TopLevel::setupMenuBar()
{
file = new QPopupMenu();
options = new QPopupMenu();
file->insertItem(klocale->translate("E&xit"),
KApplication::getKApplication(), SLOT(quit()));
options->setCheckable(TRUE);
swallowID = options->insertItem(klocale->translate("&Swallow modules"),
this, SLOT(swallowChanged()));
QPopupMenu *helpMenu = kapp->getHelpMenu(true, klocale->translate("KDE Control Center - "
"Version 1.0\n\n"
"Written by Matthias Hölzer\n"
"([email protected])\n\n"
"Thanks to:\n"
"S. Kulow, P. Dowler, M. Wuebben & M. Jones."));
menubar = new KMenuBar(this);
menubar->insertItem(klocale->translate("&File"), file);
menubar->insertItem(klocale->translate("&Options"), options);
menubar->insertSeparator(-1);
menubar->insertItem(klocale->translate("&Help"), helpMenu);
setMenu(menubar);
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:27,代码来源:toplevel.cpp
示例13: KTopLevelWidget
TopWidget::TopWidget() : KTopLevelWidget("") {
// scan command line args for "-kppp"
bool kpppmode = FALSE;
for(int i = 1; i < kapp->argc(); i++)
if(strcmp(kapp->argv()[i], "-kppp") == 0)
kpppmode = TRUE;
setCaption(i18n("kPPP log viewer"));
td = new QTabDialog(this, "", FALSE);
// remove buttons
if(!kpppmode) {
td->setOkButton(0);
td->setCancelButton(0);
// create menu
mb = new KMenuBar(this);
fm = new QPopupMenu;
fm->insertItem(i18n("E&xit"), F_EXIT);
mb->insertItem(i18n("&File"), fm);
setMenu(mb);
mb->setAccel(CTRL + Key_X, F_EXIT);
connect(mb, SIGNAL(activated(int)),
this, SLOT(menuCallback(int)));
} else {
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:27,代码来源:main.cpp
示例14: QToolButton
LocationEditor::LocationEditor(QWidget *parent) :
QToolButton(parent)
{
QPalette pal;
pal.setColor(backgroundRole(), QPalette::Base);
setPalette(pal);
this->setFont(global.getGuiFont(font()));
inactiveColor = "QToolButton {background-color: transparent; border-radius: 0px; border:none; margin 0px; padding: 4px} ";
this->setCursor(Qt::PointingHandCursor);
this->setStyleSheet(inactiveColor);
defaultText = QString(tr("Click to set location..."));
this->setText(defaultText);
actionMenu = new QMenu();
editAction = actionMenu->addAction(tr("Edit..."));
clearAction = actionMenu->addAction(tr("Clear"));
viewAction = actionMenu->addAction(tr("View on map"));
connect(editAction, SIGNAL(triggered()), this, SLOT(buttonClicked()));
connect(viewAction, SIGNAL(triggered()), this, SLOT(viewClicked()));
connect(clearAction, SIGNAL(triggered()), this, SLOT(clearClicked()));
setAutoRaise(false);
setMenu(actionMenu);
this->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
this->reloadIcons();
connect(this, SIGNAL(clicked()), this, SLOT(buttonClicked()));
hide();
}
开发者ID:AustinPowered,项目名称:Nixnote2,代码行数:30,代码来源:locationeditor.cpp
示例15: while
void Menu::selectMenu() {
int menu_sel;
while (true) {
cout << endl;
cout << "(프로그램을 종료하시려면 -1을 입력해주세요.) \n무슨 함수를 실행해보시겠습니까? ";
try {
cin >> menu_sel;
}
catch (...) {
cout << "이상한거 입력하지마라.. " << endl;
}
if (menu_sel < MENU_LIST || menu_sel > GCD) {
if (menu_sel == -1) {
cout << "프로그램을 종료합니다." << endl;
break;
}
cout << "잘못 입력하셨습니다." << endl;
}
else {
setMenu((MENU_CL)menu_sel);
cout << "\n함수를 실행합니다." << endl;
executeAlgorithm((MENU_CL)menu_sel);
}
}
}
开发者ID:minjung-jang,项目名称:algorithm,代码行数:27,代码来源:Menu.cpp
示例16: QToolButton
QgsColorButton::QgsColorButton( QWidget *parent, const QString &cdt, QgsColorSchemeRegistry *registry )
: QToolButton( parent )
, mColorDialogTitle( cdt.isEmpty() ? tr( "Select Color" ) : cdt )
, mNoColorString( tr( "No color" ) )
{
//if a color scheme registry was specified, use it, otherwise use the global instance
mColorSchemeRegistry = registry ? registry : QgsApplication::colorSchemeRegistry();
setAcceptDrops( true );
setMinimumSize( QSize( 24, 16 ) );
connect( this, &QAbstractButton::clicked, this, &QgsColorButton::buttonClicked );
//setup drop-down menu
mMenu = new QMenu( this );
connect( mMenu, &QMenu::aboutToShow, this, &QgsColorButton::prepareMenu );
setMenu( mMenu );
setPopupMode( QToolButton::MenuButtonPopup );
#ifdef Q_OS_WIN
mMinimumSize = QSize( 120, 22 );
#else
mMinimumSize = QSize( 120, 28 );
#endif
mMinimumSize.setHeight( std::max( static_cast<int>( fontMetrics().height() * 1.1 ), mMinimumSize.height() ) );
}
开发者ID:cz172638,项目名称:QGIS,代码行数:26,代码来源:qgscolorbutton.cpp
示例17: KTopLevelWidget
Game::Game() : KTopLevelWidget()
{
setCaption( kapp->getCaption() );
setIcon(klocale->translate("Snake Race"));
conf = kapp->getConfig();
if(conf == NULL) {
printf(klocale->translate("KConfig error ??\n"));
kapp->quit();
}
levels = new Levels();
score = new Score;
menu();
checkMenuItems();
View *view = new View(this);
rattler = view->rattler;
rattler->setFocus();
connect(rattler, SIGNAL(setPoints(int)), view->lcd, SLOT(display(int)));
connect(rattler, SIGNAL(setTrys(int)), view->trys, SLOT(set(int)));
connect(rattler, SIGNAL(rewind()), view->pg, SLOT(rewind()));
connect(rattler, SIGNAL(advance()), view->pg, SLOT(advance()));
connect(view->pg, SIGNAL(restart()), rattler, SLOT(restartTimer()));
connect(rattler, SIGNAL(togglePaused()), this, SLOT(togglePaused()));
connect(rattler, SIGNAL(setScore(int)), score, SLOT(setScore(int)));
menubar->show();
setMenu(menubar);
view->show();
setView(view);
}
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:35,代码来源:game.cpp
示例18: setIcon
void ActionButton::onActionChanged()
{
if (FAction)
{
setIcon(FAction->icon());
setText(FAction->text());
setMenu(FAction->menu());
}
else
{
setIcon(QIcon());
setText(QString::null);
setMenu(NULL);
}
emit buttonChanged();
}
开发者ID:Rambler-ru,项目名称:Contacts,代码行数:16,代码来源:actionbutton.cpp
示例19: QToolButton
VolumeButton::VolumeButton(QWidget *parent) :
QToolButton(parent), menu(0), label(0), slider(0)
{
setIcon(style()->standardIcon(QStyle::SP_MediaVolume));
setPopupMode(QToolButton::InstantPopup);
QWidget *popup = new QWidget(this);
slider = new QSlider(Qt::Horizontal, popup);
slider->setRange(0, 100);
connect(slider, SIGNAL(valueChanged(int)), this, SIGNAL(volumeChanged(int)));
label = new QLabel(popup);
label->setAlignment(Qt::AlignCenter);
label->setNum(100);
label->setMinimumWidth(label->sizeHint().width());
connect(slider, SIGNAL(valueChanged(int)), label, SLOT(setNum(int)));
QBoxLayout *popupLayout = new QHBoxLayout(popup);
popupLayout->setMargin(2);
popupLayout->addWidget(slider);
popupLayout->addWidget(label);
QWidgetAction *action = new QWidgetAction(this);
action->setDefaultWidget(popup);
menu = new QMenu(this);
menu->addAction(action);
setMenu(menu);
stylize();
}
开发者ID:JamesLinus,项目名称:MusicEditor,代码行数:32,代码来源:volumebutton.cpp
示例20: QToolButton
OutPatternButton::OutPatternButton(QWidget * parent):
QToolButton(parent)
{
setPopupMode(QToolButton::InstantPopup);
setMenu(new QMenu(this));
mSeparator = menu()->addSeparator();
}
开发者ID:Zefling,项目名称:flacon,代码行数:7,代码来源:controls.cpp
注:本文中的setMenu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论