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


C++ QAction::setStatusTip方法代码示例

本文整理汇总了C++中QAction::setStatusTip方法的典型用法代码示例。如果您正苦于以下问题:C++ QAction::setStatusTip方法的具体用法?C++ QAction::setStatusTip怎么用?C++ QAction::setStatusTip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QAction的用法示例。


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

示例1: initAction

void TitleWidget::initAction()
{
	m_menu = new QMenu(this);
	m_menu->setObjectName("MainMenu");

	QAction *searchAction = new QAction("搜索", m_menu);
	searchAction->setIcon(QIcon(":/menu_icon/search"));
	searchAction->setShortcut(tr("Ctrl+S"));
	searchAction->setStatusTip("搜索单曲,歌单...");
	connect(searchAction, SIGNAL(triggered()), this, SIGNAL(search()));

	QAction *logOutAction = new QAction("注销", m_menu);
	logOutAction->setIcon(QIcon(":/menu_icon/logout"));
	logOutAction->setShortcut(tr("Ctrl+E"));
	logOutAction->setStatusTip("退出登录...");
	connect(logOutAction, SIGNAL(triggered()), this, SIGNAL(logOut()));

	allLoopAction = new QAction("列表循环", m_menu);
	//allLoopAction->setIcon(QIcon(":/menu_icon/list_loop"));
	allLoopAction->setShortcut(tr("Ctrl+A"));
	allLoopAction->setCheckable(true);
	allLoopAction->setChecked(true);
	allLoopAction->setStatusTip("列表循环播放歌曲...");
	connect(allLoopAction, SIGNAL(triggered()), this, SLOT(setAllLoopChecked()));

	oneLoopAction = new QAction("单曲循环", m_menu);
	//oneLoopAction->setIcon(QIcon(":/menu_icon/one_loop"));
	oneLoopAction->setShortcut(tr("Ctrl+O"));
	oneLoopAction->setCheckable(true);
	oneLoopAction->setChecked(false);
	oneLoopAction->setStatusTip("单曲循环播放歌曲...");
	connect(oneLoopAction, SIGNAL(triggered()), this, SLOT(setOneLoopChecked()));

	randomLoopAction = new QAction("随机循环", m_menu);
	//randomLoopAction->setIcon(QIcon(":/menu_icon/random_loop"));
	randomLoopAction->setCheckable(true);
	randomLoopAction->setChecked(false);
	randomLoopAction->setShortcut(tr("Ctrl+R"));
	randomLoopAction->setStatusTip("随机循环播放歌曲...");
	connect(randomLoopAction, SIGNAL(triggered()), this, SLOT(setRandomLoopChecked()));

	QAction *exitAction = new QAction("退出软件", m_menu);
	exitAction->setIcon(QIcon(":/menu_icon/exit"));
	exitAction->setShortcut(tr("Ctrl+Q"));
	connect(exitAction, SIGNAL(triggered()), this, SIGNAL(exitWidget()));


	m_menu->addAction(searchAction);
	m_menu->addSeparator();
	m_menu->addAction(oneLoopAction);
	m_menu->addAction(allLoopAction);
	m_menu->addAction(randomLoopAction);
	m_menu->addSeparator();
	m_menu->addAction(logOutAction);
	m_menu->addSeparator();
	m_menu->addAction(exitAction);
	m_menu->adjustSize();

	m_menu->setVisible(false);
}
开发者ID:fengleyl,项目名称:NetEase,代码行数:60,代码来源:titlewidget.cpp

示例2: createGUIAction

QAction* RS_ActionOrder::createGUIAction(RS2::ActionType type, QObject* /*parent*/) {
    QAction* action;
    switch (type) {
    case RS2::ActionOrderBottom:
        action = new QAction(tr("move to bottom"), NULL);
        action->setIcon(QIcon(":/extui/order_bottom.png"));
        action->setStatusTip(tr("set to bottom"));
        break;
    case RS2::ActionOrderLower:
        action = new QAction(tr("lower after entity"), NULL);
        action->setIcon(QIcon(":/extui/order_lower.png"));
        action->setStatusTip(tr("lower over entity"));
        break;
    case RS2::ActionOrderRaise:
        action = new QAction(tr("raise over entity"), NULL);
        action->setIcon(QIcon(":/extui/order_raise.png"));
        action->setStatusTip(tr("raise over entity"));
        break;
//    case RS2::ActionOrderTop:
    default:
        action = new QAction(tr("move to top"), NULL);
        action->setIcon(QIcon(":/extui/order_top.png"));
        action->setStatusTip(tr("set to top"));
        break;
    }
    return action;
}
开发者ID:Ngassa,项目名称:LibreCAD,代码行数:27,代码来源:rs_actionorder.cpp

示例3: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QAction *openAction = new QAction(tr("打开文件"),this);
    openAction->setStatusTip(tr("open file"));
    QAction *saveAction = new QAction(tr("保存文件"),this);
    saveAction->setStatusTip(tr("save file"));

    QMenu *file = menuBar()->addMenu(tr("选择"));
    file->addAction(openAction);
    file->addAction(saveAction);

    QToolBar *toolbar =addToolBar(tr("工具栏"));
    toolbar->addAction(openAction);
    toolbar->addAction(saveAction);

   textedit = new QTextEdit(this);
    setCentralWidget(textedit);//可以在中间显示textedit
    connect(openAction,&QAction::triggered,this,&MainWindow::openFile);//点击事件是triggered
    connect(saveAction,&QAction::triggered,this,&MainWindow::saveFile);



}
开发者ID:youngjeff,项目名称:qt,代码行数:27,代码来源:mainwindow.cpp

示例4: startupInstallActions

bool AMAppController::startupInstallActions()
{
	if(AMDatamanAppControllerForActions3::startupInstallActions()) {

		QAction *changeRunAction = new QAction("Change Run...", mw_);
		changeRunAction->setStatusTip("Change the current run, or create a new one");
		connect(changeRunAction, SIGNAL(triggered()), this, SLOT(showChooseRunDialog()));

		QAction *openScanActionsViewAction = new QAction("See Scan Actions...", mw_);
		openScanActionsViewAction->setStatusTip("Open the view to see all actions done by scans");
		connect(openScanActionsViewAction, SIGNAL(triggered()), this, SLOT(showScanActionsView()));

		QAction *automaticLaunchScanEditorAction = new QAction("Launch New Scans in Editors", mw_);
		automaticLaunchScanEditorAction->setStatusTip("Launch all new scans in an new scan editor to view them");
		automaticLaunchScanEditorAction->setCheckable(true);
		automaticLaunchScanEditorAction->setChecked(true);
		connect(automaticLaunchScanEditorAction, SIGNAL(toggled(bool)), this, SLOT(onActionAutomaticLaunchScanEditorToggled(bool)));

		fileMenu_->addSeparator();
		fileMenu_->addAction(changeRunAction);

		viewMenu_->addAction(openScanActionsViewAction);
		viewMenu_->addAction(automaticLaunchScanEditorAction);

		return true;
	}
	else
		return false;
开发者ID:anukat2015,项目名称:acquaman,代码行数:28,代码来源:AMAppController.cpp

示例5: init

void TextureViewer::init()
{
    control=0;
    shaderName=0;
    setMenuBar(new QMenuBar);
    QMenu *fileMenu = menuBar()->addMenu(tr("&File"));

    //Open action
    QAction *openAct = new QAction( tr("&Open"), this );
    openAct->setShortcuts(QKeySequence::Open);
    openAct->setStatusTip(tr("Open"));
    connect(openAct, SIGNAL(triggered()), this, SLOT(openFile()));

    QAction *createControlsAct = new QAction( tr("&Controls"), this );
    createControlsAct->setStatusTip(tr("Create Controls"));
    connect(createControlsAct, SIGNAL(triggered()), this, SLOT(createControls()));

    //Quit action
    QAction *quitAct = new QAction( tr("&Quit"), this );
    quitAct->setShortcuts(QKeySequence::Quit);
    quitAct->setStatusTip(tr("Quit"));
    connect(quitAct, SIGNAL(triggered()), this, SLOT(close()));

    fileMenu->addAction(openAct);
    fileMenu->addAction(createControlsAct);
    fileMenu->addAction(quitAct);
}
开发者ID:mtao,项目名称:MSc,代码行数:27,代码来源:window.cpp

示例6: setupFileMenu

///////////////////////////////////////////////////////////
//                                                       //
// File Menu                                             //
//                                                       //
///////////////////////////////////////////////////////////
void WinImage::setupFileMenu()
{
  // Actions
  QAction* open = new QAction( "&Open", this );
  open->setShortcut( Qt::CTRL + Qt::Key_O );
  open->setStatusTip( "This will open a file");
  connect( open, SIGNAL( triggered() ), this, SLOT( slotOpen() ) );

  //QAction* save = new QAction( "&Save", this );
  //connect( save, SIGNAL( triggered() ), this, SLOT( save() ) );

  QAction* saveAs = new QAction( "Save &As", this );
  saveAs->setShortcut( Qt::CTRL + Qt::Key_A );
  connect( saveAs, SIGNAL( triggered() ), this, SLOT( slotSaveAs() ) );

  QAction* quit = new QAction( "&Quit", this );
  quit->setShortcut( Qt::CTRL + Qt::Key_Q );
  quit->setStatusTip("This will quit the application unconditionally");
  quit->setWhatsThis("This is a button, stupid!");
  connect( quit, SIGNAL( triggered() ), qApp, SLOT( quit() ) );

  // Menubarvoid Test::paintEvent( QPaintEvent* )

  QMenu* file = new QMenu( "&File", menuBar());
  menuBar()->addMenu( file);
  file->addAction( open);
  //file->addAction( save);
  file->addAction( saveAs);
  file->addAction( quit);
}
开发者ID:chenx77,项目名称:MyCodeLab,代码行数:35,代码来源:winimage.cpp

示例7: createHelpMenu

void MainWindow::createHelpMenu()
{
	// Help menu
	QAction* manualAct = new QAction(QIcon(QString::fromLatin1(":/images/help.png")), tr("Open &Manual"), this);
	manualAct->setStatusTip(tr("Show the help file for this application"));
	manualAct->setShortcut(QKeySequence::HelpContents);
	connect(manualAct, &QAction::triggered, this, &MainWindow::showHelp);
	
	QAction* aboutAct = new QAction(tr("&About %1").arg(appName()), this);
	aboutAct->setStatusTip(tr("Show information about this application"));
	aboutAct->setMenuRole(QAction::AboutRole);
	connect(aboutAct, &QAction::triggered, this, &MainWindow::showAbout);
	
	QAction* aboutQtAct = new QAction(tr("About &Qt"), this);
	aboutQtAct->setStatusTip(tr("Show information about Qt"));
	aboutQtAct->setMenuRole(QAction::AboutQtRole);
	connect(aboutQtAct, &QAction::triggered, qApp, QApplication::aboutQt);
	
	if (show_menu)
	{
		QMenu* helpMenu = menuBar()->addMenu(tr("&Help"));
		helpMenu->addAction(manualAct);
		helpMenu->addAction(QWhatsThis::createAction(this));
		helpMenu->addSeparator();
		helpMenu->addAction(aboutAct);
		helpMenu->addAction(aboutQtAct);
	}
}
开发者ID:pat1005331,项目名称:mapper,代码行数:28,代码来源:main_window.cpp

示例8: CustomMenuRequested

void lcTimelineWidget::CustomMenuRequested(QPoint Pos)
{
	QMenu* Menu = new QMenu(this);

	QTreeWidgetItem* TreeItem = itemAt(Pos);

	lcObject* FocusObject = lcGetActiveModel()->GetFocusObject();

	if (FocusObject && FocusObject->IsPiece())
	{
		lcPiece* Piece = (lcPiece*)FocusObject;

		if (Piece->mPieceInfo->IsModel())
		{
			Menu->addAction(gMainWindow->mActions[LC_MODEL_EDIT_FOCUS]);
			Menu->addSeparator();
		}
	}

	// look for step headings
	if (TreeItem && TreeItem->data(0, Qt::UserRole).isNull())
	{
		{
			QAction* Action = new QAction(tr("Move selection here"), this);
			Action->setStatusTip(tr("Move the selected parts into this step"));
			Action->setData(qVariantFromValue((void *) TreeItem));
			Action->setEnabled(selectedItems().count() != 0);
			connect(Action, SIGNAL(triggered()), this, SLOT(MoveSelectionTo()));
			Menu->addAction(Action);
		}
		{
			QAction* Action = new QAction(tr("Set as current step"), this);
			Action->setStatusTip(tr("View the model at this point in the timeline"));
			Action->setData(qVariantFromValue((void *) TreeItem));
			connect(Action, SIGNAL(triggered()), this, SLOT(UpdateCurrentStep()));
			Menu->addAction(Action);
		}

		Menu->addSeparator();
	}

	QAction* InsertStepAction = Menu->addAction(gMainWindow->mActions[LC_VIEW_TIME_INSERT]->text(), this, SLOT(InsertStep()));
	InsertStepAction->setStatusTip(gMainWindow->mActions[LC_VIEW_TIME_INSERT]->statusTip());
	QAction* RemoveStepAction = Menu->addAction(gMainWindow->mActions[LC_VIEW_TIME_DELETE]->text(), this, SLOT(RemoveStep()));
	RemoveStepAction->setStatusTip(gMainWindow->mActions[LC_VIEW_TIME_DELETE]->statusTip());
	Menu->addSeparator();

	Menu->addAction(gMainWindow->mActions[LC_PIECE_HIDE_SELECTED]);
	Menu->addAction(gMainWindow->mActions[LC_PIECE_HIDE_UNSELECTED]);
	Menu->addAction(gMainWindow->mActions[LC_PIECE_UNHIDE_SELECTED]);
	Menu->addAction(gMainWindow->mActions[LC_PIECE_UNHIDE_ALL]);

	Menu->popup(viewport()->mapToGlobal(Pos));
}
开发者ID:eric-wieser,项目名称:leocad,代码行数:54,代码来源:lc_timelinewidget.cpp

示例9: AbstractUIComponent

AboutUIComponent::AboutUIComponent(Corrade::PluginManager::AbstractPluginManager* manager, const std::string& plugin): AbstractUIComponent(manager, plugin) {
    /* About */
    QAction* aboutAction = new QAction(QIcon(":/logo-16.png"), tr("About Kompas"), this);
    aboutAction->setStatusTip(tr("Show information about this application"));
    connect(aboutAction, SIGNAL(triggered(bool)), SLOT(aboutDialog()));
    _actions << aboutAction;

    /* About Qt */
    QAction* aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About Qt"), this);
    aboutQtAction->setStatusTip(tr("Show information about Qt"));
    connect(aboutQtAction, SIGNAL(triggered(bool)), qApp, SLOT(aboutQt()));
    _actions << aboutQtAction;
}
开发者ID:mosra,项目名称:kompas-qt,代码行数:13,代码来源:AboutUIComponent.cpp

示例10: dataPath

Interface::Interface(): QMainWindow()
{
    setAttribute(Qt::WA_AcceptTouchEvents);

    QString dataPath("/sdcard/polar/data/");
    QString dir = dataPath + "icons/";

    // Create a Viewer with shadows management
    viewer = new PoLAR::Viewer(this, "viewer", 0, true);
    //viewer->setShadowsOn();

    setCentralWidget(viewer);
    toolbar = new QToolBar(this);
    addToolBar(Qt::LeftToolBarArea, toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setAttribute(Qt::WA_AcceptTouchEvents);
    toolbar->setIconSize(QSize(128,128));
    qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, true);

    QAction *editImgAct = new QAction(QIcon(dir+"img.png"), tr("Edit image"), this);
    editImgAct->setStatusTip(tr("Edit Image"));
    QObject::connect(editImgAct, SIGNAL(triggered()), viewer, SLOT(startEditImageSlot()));
    //QObject::connect(editImgAct, SIGNAL(triggered()), this, SLOT(editImg()));
    toolbar->addAction(editImgAct);

    QAction *sceneManipAct = new QAction(QIcon(dir+"scene.png"), tr("Manipulate Scene"), this);
    sceneManipAct->setStatusTip(tr("Manipulate Scene"));
    QObject::connect(sceneManipAct, SIGNAL(triggered()), viewer, SLOT(startManipulateSceneSlot()));
    //QObject::connect(sceneManipAct, SIGNAL(triggered()), this, SLOT(sceneManip()));
    toolbar->addAction(sceneManipAct);

    toolbar->addAction(QIcon(dir+"edit.png"), QString("Edit Markers"), this, SLOT(newSpline()));
    toolbar->addAction(QIcon(dir+"exit.png"), QString("Remove Markers"), this, SLOT(deleteMarker()));
    toolbar->addAction(QIcon(dir+"valid.png"), QString("Calculate matrix"), this, SLOT(computeMatrix()));
    toolbar->addAction(QIcon(dir+"log.png"), QString("Print info"), this, SLOT(debugInfo()));

    for(auto it : toolbar->children())
    {
        if(QWidget* w = dynamic_cast<QWidget*>(it))
        {
            w->setAttribute(Qt::WA_AcceptTouchEvents);
        }
    }

    // add focus to this interface in order to get the keyboard events
    this->setFocusPolicy(Qt::StrongFocus);
    // remove the focus from the Viewer, otherwise it will bypass the interface's events
    viewer->setFocusPolicy(Qt::NoFocus);

    viewer->startEditImageSlot();
}
开发者ID:ConfusedReality,项目名称:pkg_augmented-reality_polAR,代码行数:51,代码来源:interface.cpp

示例11: populateResultsMenu

void ArbitrationWidget::populateResultsMenu(QMenu &iMenu, const QPoint &iPoint)
{
    const QModelIndex &index = treeViewResults->indexAt(iPoint);
    if (!index.isValid())
        return;

    const Move &move = getSelectedMove();

    // Action to display the word definition
    const QModelIndex &wordIndex = m_resultsModel->index(index.row(), 0);
    QString selectedWord = m_resultsModel->data(wordIndex).toString();
    QAction *showDefAction = m_resultsPopup->getShowDefinitionEntry(selectedWord);
    iMenu.addAction(showDefAction);
    if (!move.isValid())
        showDefAction->setEnabled(false);

    // Action to select as master move
    QAction *setAsMasterAction =
        new QAction(_q("Use as master move"), this);
    setAsMasterAction->setStatusTip(_q("Use the selected move (%1) as master move")
                                    .arg(formatMove(move)));
    setAsMasterAction->setShortcut(Qt::SHIFT + Qt::Key_M);
    QObject::connect(setAsMasterAction, SIGNAL(triggered()),
                     m_assignmentsWidget, SLOT(setMasterMove()));
    iMenu.addAction(setAsMasterAction);
    if (!m_assignmentsWidget->isSetMasterAllowed())
        setAsMasterAction->setEnabled(false);

    // Action to select all the players
    QAction *selectAllAction =
        new QAction(_q("Select all players"), this);
    selectAllAction->setStatusTip(_q("Select all the players"));
    selectAllAction->setShortcut(Qt::SHIFT + Qt::Key_A);
    QObject::connect(selectAllAction, SIGNAL(triggered()),
                     m_assignmentsWidget, SLOT(selectAllPlayers()));
    iMenu.addAction(selectAllAction);

    // Action to assign the selected move
    QAction *assignSelMoveAction =
        new QAction(_q("Assign selected move (%1)").arg(formatMove(move)), this);
    assignSelMoveAction->setStatusTip(_q("Assign move (%1) to the selected player(s)")
                                      .arg(formatMove(move)));
    assignSelMoveAction->setShortcut(Qt::Key_Enter);
    QObject::connect(assignSelMoveAction, SIGNAL(triggered()),
                     m_assignmentsWidget, SLOT(assignSelectedMove()));
    iMenu.addAction(assignSelMoveAction);
    if (!m_assignmentsWidget->isAssignMoveAllowed())
        assignSelMoveAction->setEnabled(false);
}
开发者ID:bratao,项目名称:eliot,代码行数:49,代码来源:arbitration_widget.cpp

示例12: CreateSceneMenu

//----------------------------------------------------------------------------------------------
void GraphScene::CreateSceneMenu()
{
    QAction *pNewNodeAction = new QAction(tr("N&ew Node"), this);
    pNewNodeAction->setStatusTip(tr("Creates new plan graph node"));
    connect(pNewNodeAction, SIGNAL(triggered()), this, SLOT(NewNode()));

    QAction *pLayoutGraph = new QAction(tr("L&ayout Plan"), this);
    pLayoutGraph->setStatusTip(tr("Layout plan graph in the scene"));
    connect(pLayoutGraph, SIGNAL(triggered()), this, SLOT(OnGraphStructureChange()));

    m_pSceneMenu = new QMenu(tr("Scene Menu"));
    m_pSceneMenu->setTearOffEnabled(true);
    m_pSceneMenu->addAction(pNewNodeAction);
    m_pSceneMenu->addAction(pLayoutGraph);
}
开发者ID:mabdelmonemali,项目名称:IStrategizer,代码行数:16,代码来源:GraphScene.cpp

示例13: contextMenuEvent

void GLScene::contextMenuEvent(QContextMenuEvent *event)
{
    QAction *start = new QAction(tr("&Start"), this);
    start->setStatusTip(tr("Start"));
    connect(start, SIGNAL(triggered()), this, SLOT(start()));
    
    QAction *stop = new QAction(tr("&Stop"), this);
    start->setStatusTip(tr("Stop"));
    connect(stop, SIGNAL(triggered()), this, SLOT(stop()));

    QMenu menu(this);    
    menu.addAction(start);
    menu.addAction(stop);
    menu.exec(event->globalPos());
}
开发者ID:JordanBlocher,项目名称:qt-opengl,代码行数:15,代码来源:GLScene.cpp

示例14: createPanelToolBar

void MilkMainWindow::createPanelToolBar()
{
    toolbarPanel = addToolBar(tr("Panels"));
    QAction* action = toolbarPanel->toggleViewAction();
    action->setStatusTip(tr("Show/Hide Panels Toolbar"));
    menuView->addAction(action);
}
开发者ID:itsuhane,项目名称:Milk,代码行数:7,代码来源:milkmainwindow.cpp

示例15: createGUIAction

QAction* RS_ActionPolylineSegment::createGUIAction(RS2::ActionType /*type*/, QObject* /*parent*/) {
    QAction* action = new QAction(tr("Create Polyline from Existing &Segments"), NULL);
    action->setShortcut(QKeySequence());
    action->setIcon(QIcon(":/extui/polylinesegment.png"));
    action->setStatusTip(tr("Create Polyline from Existing Segments"));
    return action;
}
开发者ID:DevinderKaur,项目名称:LibreCAD-1,代码行数:7,代码来源:rs_actionpolylinesegment.cpp


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