当前位置: 首页>>代码示例>>C++>>正文


C++ setMenuBar函数代码示例

本文整理汇总了C++中setMenuBar函数的典型用法代码示例。如果您正苦于以下问题:C++ setMenuBar函数的具体用法?C++ setMenuBar怎么用?C++ setMenuBar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setMenuBar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QSProject

void SpreadSheet::init()
{
    inInit = true;

    project = new QSProject( this, "spreadsheet_project" );
    interpreter = project->interpreter();
#ifndef QSA_NO_GUI
	QSInputDialogFactory *fac = new QSInputDialogFactory;
    interpreter->addObjectFactory( fac );
#endif

    project->addObject( new SheetInterface( sheet1, this, "sheet1" ) );

    project->load( "spreadsheet.qsa" );
    connect( project, SIGNAL( projectEvaluated() ),
	     project, SLOT( save() ) );

    
    QMenuBar *menuBar = new QMenuBar(this);
    QMenu *fileMenu = menuBar->addMenu("&File");    
    QAction *fileExitAction = fileMenu->addAction("E&xit");
    connect(fileExitAction, SIGNAL(triggered(bool)), this, SLOT(fileExit()));

    scriptsMenu = menuBar->addMenu("&Scripts");
    QAction *scriptsNewAction = scriptsMenu->addAction(QIcon(":/images/hi22-action-run.png"), 
                                                       "&New...");
    connect(scriptsNewAction, SIGNAL(triggered(bool)), this, SLOT(addScript()));
    QAction *scriptsQSA = scriptsMenu->addAction(QIcon(":/images/hi22-action-project_open.png"), 
                                                 "QSA &Workbench");   
    connect(scriptsQSA, SIGNAL(triggered(bool)), this, SLOT(openIDE()));
    setMenuBar(menuBar);

    QToolBar *toolBar = new QToolBar("Calculation Toolbar", this);
    currentCell = new QLabel("A1", toolBar);
        toolBar->addWidget(currentCell);
    formulaEdit = new QLineEdit(toolBar);
        toolBar->addWidget(formulaEdit);
        connect(formulaEdit, SIGNAL(returnPressed()), this, SLOT(formulaEdited()));
    addToolBar(toolBar);

    scriptsToolbar = new QToolBar("Scripts Toolbar", this);
    scriptsToolbar->addAction(scriptsNewAction);
    scriptsToolbar->addAction(scriptsQSA);
    addToolBar(scriptsToolbar);        

    for (int i=0; i<sheet1->rowCount(); ++i) {
        sheet1->setVerticalHeaderItem(i, new QTableWidgetItem(QString::number(i + 1)));

        for (int j=0; j<sheet1->columnCount(); ++j) {
            sheet1->setItem(i, j, new QTableWidgetItem);
            if (i == 0) {
                sheet1->setHorizontalHeaderItem(j, new QTableWidgetItem);
            }
        }
    }

    setupSheet( sheet1 );
    inInit = false;
}
开发者ID:aschet,项目名称:qsaqt5,代码行数:59,代码来源:spreadsheet.cpp

示例2: setMenuBar

void UIMachineWindowNormal::prepareMenu()
{
    /* Call to base-class: */
    UIMachineWindow::prepareMenu();

    /* Prepare menu-bar: */
    setMenuBar(uisession()->newMenuBar());
}
开发者ID:ryenus,项目名称:vbox,代码行数:8,代码来源:UIMachineWindowNormal.cpp

示例3: setMenuBar

      ~MainWindow(){
#if JUCE_MAC
	MenuBarModel::setMacMainMenu(NULL);
#else
	setMenuBar(NULL);
#endif

      }
开发者ID:aaptel,项目名称:OwlNest,代码行数:8,代码来源:Main.cpp

示例4: setMenuBar

void AbstractTableTabAction::On_dataTabs_currentChanged(int iTab)
{
 //table = tabbedTableArray.at(iTab)->dataTable;
 tabbedTableArray.at(currTab)->bottomBox->setVisible(false);
 tabbedTableArray.at(iTab)->bottomBox->setVisible(true);
 currTab = iTab;
 setMenuBar(f);
 ((UserPreferencesManager*)InstanceManager::getDefault("UserPreferencesManager"))->setProperty(getClassName()+"."+getTableClass(),"currTab",currTab);
}
开发者ID:allenck,项目名称:DecoderPro_app,代码行数:9,代码来源:abstracttabletabaction.cpp

示例5: MenuBar

void MainWindow::MakeMenuBar()
{
	m_menu_bar = new MenuBar(this);
	setMenuBar(m_menu_bar);
	connect(m_menu_bar, &MenuBar::Open, this, &MainWindow::Open);
	connect(m_menu_bar, &MenuBar::Exit, this, &MainWindow::close);
	connect(m_menu_bar, &MenuBar::ShowTable, m_game_list, &GameList::SetTableView);
	connect(m_menu_bar, &MenuBar::ShowList, m_game_list, &GameList::SetListView);
}
开发者ID:aichunyu,项目名称:dolphin,代码行数:9,代码来源:MainWindow.cpp

示例6: QMenuBar

void MainWindow::createMenus()
{
    _menuBar = new QMenuBar(this);
    _menuBar->setObjectName(QString::fromUtf8("menuBar"));
    setMenuBar(_menuBar);

    // MENU FILE
    _menuFile = new QMenu(_menuBar);
    _menuFile->setObjectName(QString::fromUtf8("menuFile"));
    _menuFile->addAction(_actionNew);
    _menuFile->addAction(_actionOpen);
    _menuFile->addSeparator();
    _menuFile->addAction(_actionSave);
    _menuFile->addAction(_actionSaveAs);
    _menuFile->addSeparator();
    _menuFile->addAction(_actionExit);

    // recent files
    _separatorAction = _menuFile->insertSeparator(_actionExit);
    for (int i=0; i<MaxRecentFiles; ++i)
        _menuFile->insertAction(_actionExit, _recentFileActions[i]);
    _menuFile->insertSeparator(_actionExit);

    // MENU DRAW
    _menuDraw = new QMenu(_menuBar);
    _menuDraw->setObjectName(QString::fromUtf8("menuDraw"));
    _menuDraw->addAction(_actionShowGrid);
    _menuDraw->addAction(_actionProperties);

    // MENU SIMULATION
    _menuSimulation = new QMenu(_menuBar);
    _menuSimulation->setObjectName(QString::fromUtf8("menuSimulation"));
    _menuSimulation->addAction(_actionConfigurate);
    _menuSimulation->addAction(_actionLaunch);

    // MENU WINDOW
    _menuWin = new QtWindowListMenu(_menuBar);
    _menuWin->attachToMdiArea(_mdiArea);

    // MENU LANGUAGE
    createLanguageMenu();

    // MENU HELP
    _menuHelp = new QMenu(_menuBar);
    _menuHelp->setObjectName(QString::fromUtf8("menuHelp"));
    _menuHelp->addAction(_actionAbout);
    _menuHelp->addAction(_actionAboutQt);


    // MENUBAR
    _menuBar->addAction(_menuFile->menuAction());
    _menuBar->addAction(_menuDraw->menuAction());
    _menuBar->addAction(_menuSimulation->menuAction());
    _menuBar->addAction(_menuWin->menuAction());
    _menuBar->addAction(_menuLanguage->menuAction());
    _menuBar->addAction(_menuHelp->menuAction());
}
开发者ID:BackupTheBerlios,项目名称:qtfin-svn,代码行数:57,代码来源:mainwindow.cpp

示例7: DocumentWindow

//==============================================================================
MainWindow::MainWindow()
    : DocumentWindow ("The Jucer",
                      Colours::azure,
                      DocumentWindow::allButtons)
{
    if (oldLook == 0)
        oldLook = new OldSchoolLookAndFeel();

    setContentOwned (multiDocHolder = new MultiDocHolder(), false);

    setApplicationCommandManagerToWatch (commandManager);

   #if JUCE_MAC
    setMacMainMenu (this);
   #else
    setMenuBar (this);
   #endif

    setResizable (true, false);

    centreWithSize (700, 600);

    // restore the last size and position from our settings file..
    restoreWindowStateFromString (StoredSettings::getInstance()->getProps()
                                    .getValue ("lastMainWindowPos"));

    // Register all the app commands..
    {
        commandManager->registerAllCommandsForTarget (JUCEApplication::getInstance());
        commandManager->registerAllCommandsForTarget (this);

        // use a temporary one of these to harvest its commands..
        JucerDocumentHolder tempDesignHolder (ObjectTypes::createNewDocument (0));
        commandManager->registerAllCommandsForTarget (&tempDesignHolder);
    }

    commandManager->getKeyMappings()->resetToDefaultMappings();

    XmlElement* const keys = StoredSettings::getInstance()->getProps().getXmlValue ("keyMappings");

    if (keys != 0)
    {
        commandManager->getKeyMappings()->restoreFromXml (*keys);
        delete keys;
    }

    addKeyListener (commandManager->getKeyMappings());

    // don't want the window to take focus when the title-bar is clicked..
    setWantsKeyboardFocus (false);

   #ifndef JUCE_DEBUG
    // scan for fonts before the app gets started rather than glitching later
    FontPropertyComponent::preloadAllFonts();
   #endif
}
开发者ID:Frongo,项目名称:JUCE,代码行数:57,代码来源:jucer_MainWindow.cpp

示例8: MainMenuBar

        void MainWindow::setupMenus()
        {
            m_MenuBar = new MainMenuBar();
            m_StatusBar = new MainStatusBar();

            m_StatusBar->showMessage(tr("Ready"));

            setMenuBar((QMenuBar*)(m_MenuBar));
            setStatusBar((QStatusBar*)(m_StatusBar));
        }
开发者ID:ssell,项目名称:OcularEngine,代码行数:10,代码来源:MainWindow.cpp

示例9: setMenuBar

void MainWindow::setup_ui()
{
	/*
		MENU BAR
	*/
	setMenuBar(&menu_bar);

	/*
		TOOL BAR
	*/
//	tool_bar.setIconSize(QSize(24, 24));
//	addToolBar(Qt::TopToolBarArea, &tool_bar);

	/*
		CENTRAL WIDGET
	*/
	setCentralWidget(&central_widget);
	hbox_main.addLayout(&vbox_left, 1);
	hbox_main.addLayout(&vbox_right);

	vbox_left.addWidget(&draw_area, 0);
	vbox_right.addWidget(&spacer, 1);
	vbox_right.addWidget(&btn_run);
	vbox_right.addWidget(&btn_step);
	vbox_right.addLayout(&pixel_size_chooser.layout());
	vbox_right.addLayout(&time_interval_chooser.layout());
	ca_type_edit.widget().setText("Select ca");
	vbox_right.addLayout(&ca_type_edit.layout());
	btn_run.setCheckable(true);

	connect(&time_interval_chooser.widget(), SIGNAL(valueChanged(int)),
		&draw_area, SLOT(set_timeout_interval(int)));
	connect(&pixel_size_chooser.widget(), SIGNAL(valueChanged(int)),
		this, SLOT(change_pixel_size(int)));
	connect(&state_machine, SIGNAL(updated(StateMachine::STATE)),
		this, SLOT(state_updated(StateMachine::STATE)));
	connect(&btn_step, SIGNAL(released()),
		&state_machine, SLOT(trigger_step()));
	connect(&btn_run, SIGNAL(released()),
		&state_machine, SLOT(trigger_pause()));
	connect(&ca_type_edit.widget(), SIGNAL(clicked()),
		this, SLOT(change_ca_type()));
	connect(&menu_bar, SIGNAL(toggle_fullscreen()),
		this, SLOT(slot_fullscreen()));

	draw_area.fill_grid();
	draw_area.set_pixel_size(pixel_size_chooser.widget().value());

	/*pixel_size_chooser.widget().setMinimum(1);
	pixel_size_chooser.widget().setMaximum(255);
	pixel_size_chooser.widget().setValue(4);
	time_interval_chooser.widget().setMinimum(0);
	time_interval_chooser.widget().setMaximum(1000);
	time_interval_chooser.widget().setValue(10);*/
}
开发者ID:JohannesLorenz,项目名称:sca-toolsuite,代码行数:55,代码来源:MainWindow.cpp

示例10: DialogWindow

//==============================================================================
VstPluginWindow::VstPluginWindow (PluginEditorWindowHolder* owner_,
                                  BasePlugin* plugin_)
  : DialogWindow (String::empty, Colours::beige, true, false),
    plugin (0),
    owner (owner_),
    specialEditor (0),
    nativeEditor (0),
    externalEditor (0),
    content (0)
{
    DBG ("VstPluginWindow::VstPluginWindow");

    // add to desktop
    addToDesktop (getDesktopWindowStyleFlags());

    // setup window default values
    setTitleBarHeight (24);
    centreWithSize (400, 300);
    setWantsKeyboardFocus (true);
    setBackgroundColour (Config::getInstance ()->getColour (T("mainBackground")));

    // try to move the window to its old position
    int oldX = -1, oldY = -1, oldW = -1, oldH = -1, lastPage = 0;
    if (plugin_)
    {
        oldX = plugin_->getIntValue (PROP_WINDOWXPOS, -1);
        oldY = plugin_->getIntValue (PROP_WINDOWYPOS, -1);
        oldW = plugin_->getIntValue (PROP_WINDOWWSIZE, -1);
        oldH = plugin_->getIntValue (PROP_WINDOWHSIZE, -1);
        lastPage = plugin_->getIntValue (PROP_WINDOWPAGE, 0);
    }

    // try to move the window to its old position
    if (oldX >= 0 && oldY >= 0)
        setTopLeftPosition (oldX, oldY);

    // try to set the window to its old size
    if ((lastPage == 0 && ! externalEditor)
        || (lastPage == 1 && externalEditor))
    {
        if (oldW >= 0 && oldY >= 0)
            setSize (oldW, oldH);
    }

    // default plugin to open
    setPlugin (plugin_);
    
    // setMenuBar here, after setting the plugin, so the plugin's menu items are there immediately
    setMenuBar (this, getMenuBarHeight ());

    // restore window to front
    toFront (false);
    setVisible (true);
}
开发者ID:alessandropetrolati,项目名称:juced,代码行数:55,代码来源:VstPluginWindow.cpp

示例11: setMenuBar

void MainWindow::toolBarModified(int identifier)
{
	if (identifier == ToolBarsManager::MenuBar)
	{
		const bool showMenuBar = (ToolBarsManager::getToolBarDefinition(ToolBarsManager::MenuBar).visibility != AlwaysHiddenToolBar);

		if (m_menuBar && !showMenuBar)
		{
			m_menuBar->deleteLater();
			m_menuBar = NULL;

			setMenuBar(NULL);
		}
		else if (!m_menuBar && showMenuBar)
		{
			m_menuBar = new MenuBarWidget(this);

			setMenuBar(m_menuBar);
		}

		getAction(ActionsManager::ShowMenuBarAction)->setChecked(showMenuBar);
	}
	else if (identifier == ToolBarsManager::StatusBar)
	{
		const bool showStatusBar = (ToolBarsManager::getToolBarDefinition(ToolBarsManager::StatusBar).visibility != AlwaysHiddenToolBar);

		if (m_statusBar && !showStatusBar)
		{
			m_statusBar->deleteLater();
			m_statusBar = NULL;

			setStatusBar(NULL);
		}
		else if (!m_statusBar && showStatusBar)
		{
			m_statusBar = new StatusBarWidget(this);

			setStatusBar(m_statusBar);
		}
	}
}
开发者ID:sietse,项目名称:otter-browser,代码行数:41,代码来源:MainWindow.cpp

示例12: setMenuBar

void MainWindow::createMenus()
{
    setMenuBar(new QMenuBar(this));
    fileMenu = menuBar()->addMenu(tr("&File"));
    fileMenu->addAction(openFileAct);
    fileMenu->addAction(exitAct);

    viewMenu = menuBar()->addMenu(tr("&View"));

    helpMenu = menuBar()->addMenu(tr("&Help"));
    helpMenu->addAction(aboutAct);
}
开发者ID:wose,项目名称:EyeTER,代码行数:12,代码来源:MainWindow.cpp

示例13: PegMenuBar

PegMenuBar* MyMainFrame::getMenuBar()
{
	if(m_menuBar==NULL) 
	{
		PegMenuDescription defaultMenu[] = 
			{ {"Quitter", DEF_MENU_QUIT, AF_ENABLED|TT_COPY, NULL}, { "", 0,0,NULL } };
		PegMenuBar* t = new PegMenuBar(defaultMenu);
		t->Resize(defaultMenuBarRect());
		setMenuBar(t);
	}
	return m_menuBar;
}
开发者ID:Cartix,项目名称:BattleShip,代码行数:12,代码来源:MyMainFrame.cpp

示例14: QAction

MainWindow::MainWindow()
{
    QMenuBar *menuBar = new QMenuBar;
    QMenu *menuWindow = menuBar->addMenu(tr("&Window"));
    QAction *addNew = new QAction(menuWindow);
    addNew->setText(tr("Add new"));
    menuWindow->addAction(addNew);
    connect(addNew, SIGNAL(triggered()), this, SLOT(onAddNew()));
    setMenuBar(menuBar);

    onAddNew();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:12,代码来源:mainwindow.cpp

示例15: QMainWindow

MainWindow::MainWindow(const QUrl& url)
: QMainWindow()
{
  MainApplication::application()->setActivationWindow(this);
  MainApplication::application()->registerWindow(this);

  QWebSettings::setIconDatabasePath(MainApplication::temporaryDir().path());

  //ensure the toolbars are unified on mac
  setUnifiedTitleAndToolBarOnMac(true);

  //create the tab widget
  m_tabWidget = new TabWidget(this, this);

  //create the main toolbar
  m_toolBar = new MainToolBar(m_tabWidget, this);

  //create the bookmarks toolbar
  m_bookmarksToolBar = new BookmarksToolBar(this);
  connect(m_bookmarksToolBar, SIGNAL(bookmarkTriggered(const QUrl&)),
          this, SLOT(onBookmarkTriggered(const QUrl&)));

  //create the find toolbar
  m_findToolBar = new QToolBar(this);
  setupFindToolBar();

  //add the widgets
  addToolBar(Qt::TopToolBarArea, m_toolBar);
  addToolBarBreak(Qt::TopToolBarArea);
  addToolBar(Qt::TopToolBarArea, m_bookmarksToolBar);
  addToolBar(Qt::BottomToolBarArea, m_findToolBar);
  setCentralWidget(m_tabWidget);

  //create and set up the menubar
  m_menuBar = new MenuBar(this);
  setMenuBar(m_menuBar);

  //set the window title and restore the state
  setWindowTitle(MainApplication::APPLICATION_NAME);
  restoreWindowState();

  //add a new tab to begin
  if (!url.toString().isEmpty())
    m_tabWidget->addNewTab(url);
  else
    m_tabWidget->addNewTab();

  connect(m_tabWidget, SIGNAL(tabChanged(WebPanel*)),
          this, SLOT(onTabChanged(WebPanel*)));

  show();
}
开发者ID:pgeorges,项目名称:PGBrowser,代码行数:52,代码来源:MainWindow.cpp


注:本文中的setMenuBar函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。