本文整理汇总了C++中setMenu函数的典型用法代码示例。如果您正苦于以下问题:C++ setMenu函数的具体用法?C++ setMenu怎么用?C++ setMenu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setMenu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例2: setMenu
void MainMenuBar::reload()
{
setMenu(NULL);
// Reload all menus.
AppMenus::instance()->reload();
setMenu(AppMenus::instance()->getRootMenu());
}
示例3: setMenu
void CustomColorButton::usePopupGrid(bool bGrid)
{
if (bGrid == true)
{
setMenu(mpMenu);
setPopupMode(QToolButton::MenuButtonPopup);
}
else
{
setMenu(NULL);
setPopupMode(QToolButton::DelayedPopup);
}
}
示例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);
}
示例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 );
}
示例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
示例7: UIAction
UIActionMenu::UIActionMenu(QObject *pParent, const QIcon &icon)
: UIAction(pParent, UIActionType_Menu)
{
if (!icon.isNull())
setIcon(icon);
setMenu(new UIMenu);
}
示例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 );
}
示例9: clearCompare
void clearCompare(void)
{
if (pCurHexEdit->GetHexProp().pCmpResult->hFile != NULL) {
pCurHexEdit->SetCompareResult(NULL);
setMenu();
}
}
示例10: toggleHexEdit
void toggleHexEdit(void)
{
GetShortCuts(nppData._nppHandle);
pCurHexEdit->doDialog(TRUE);
DialogUpdate();
setMenu();
}
示例11: UIActionInterface
UIMenuAction::UIMenuAction(QObject *pParent, const QIcon &icon)
: UIActionInterface(pParent, UIActionType_Menu)
{
if (!icon.isNull())
setIcon(icon);
setMenu(new UIMenuInterface);
}
示例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);
}
示例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 {
示例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();
}
示例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);
}
}
}