• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ createAction函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: callfunc_selector

void Mouse::dizzy() {
	Sequence* seq;

	if (!fallIn) {
		seq = Sequence::create(
			CallFunc::create(this, callfunc_selector(Mouse::setDizzyDif)),
			Spawn::create(createAction("dizzy", 0, 0.15f, 1), MoveTo::create(0.1, Vec2(mousePositionX, mousePositionY)), NULL),
			CallFunc::create(this, callfunc_selector(Mouse::resetDif)),
			createRunningSequence(), NULL);
	}
	else {
		float fallPosition = 0;
		if (fallingSnare == nullptr) {
			fallPosition = this->getPosition().x;
		}
		else {
			fallPosition = fallingSnare->getPosition().x +fallingSnare->getContentSize().width / 6;
		}

		seq = Sequence::create(
			CallFunc::create(this, callfunc_selector(Mouse::setDizzyDif)),
			Spawn::create(createAction("dizzy", 0, 0.15f, 1),
			MoveTo::create(0.1, Vec2(fallPosition, mousePositionY - 70)), NULL),
			Spawn::create(createAction("fallend", 0.2, 0.15f, 1),
			MoveTo::create(0.75, Vec2(this->getPosition().x, mousePositionY)), NULL),
			CallFunc::create(this, callfunc_selector(Mouse::moveMouseBehineSnare)),
			createRunningSequence(), NULL);
	}
	this->runAction(seq);
}
开发者ID:JieweiWei,项目名称:TheWittyMouse2,代码行数:30,代码来源:Mouse.cpp


示例2: createAction

QList<QAction *> KoRdfLocationTreeWidgetItem::actions(QWidget *parent, KoCanvasBase *host)
{
    QList<QAction *> m_actions;
    QAction *action = 0;

#ifdef CAN_USE_MARBLE
    // These were coded to need marble
    action = createAction(parent, host, "Edit...");
    connect(action, SIGNAL(triggered(bool)), this, SLOT(edit()));
    m_actions.append(action);
    action = createAction(parent, host, "Show location on a map");
    connect(action, SIGNAL(triggered(bool)), this, SLOT(showInViewer()));
    m_actions.append(action);
#endif

    action = createAction(parent, host, "Export location to KML file...");
    connect(action, SIGNAL(triggered(bool)), this, SLOT(exportToFile()));
    m_actions.append(action);
    addApplyStylesheetActions(parent, m_actions, host);
    if (host) {
        action = new RdfSemanticTreeWidgetSelectAction(parent, host, semanticItem());
        m_actions.append(action);
    }
    return m_actions;
}
开发者ID:TheTypoMaster,项目名称:calligra,代码行数:25,代码来源:KoRdfLocationTreeWidgetItem.cpp


示例3: NotationTool

ClefInserter::ClefInserter(NotationWidget *widget) :
    NotationTool("clefinserter.rc", "ClefInserter", widget),
    m_clef(Clef::Treble)
{
    createAction("select", SLOT(slotSelectSelected()));
    createAction("erase", SLOT(slotEraseSelected()));
    createAction("notes", SLOT(slotNotesSelected()));
}
开发者ID:bownie,项目名称:RosegardenW,代码行数:8,代码来源:ClefInserter.cpp


示例4: QMenu

void Pixelepsy::createFileActions() {
    this->File = new QMenu(tr("&File"));
    this->menuBar()->addMenu(this->File);
    createAction(this->File, this->actionNew, "New", "Ctrl+N", std::bind(&Pixelepsy::on_actionNew_triggered, this));
    createAction(this->File, this->actionOpen, "Open", "Ctrl+O",std::bind(&Pixelepsy::on_actionOpen_triggered, this));
    createAction(this->File, this->actionSave, "Save", "Ctrl+S",std::bind(&Pixelepsy::on_actionSave_triggered, this));
    createAction(this->File, this->actionSaveAs, "Save As", "Ctrl+Shift+S", std::bind(&Pixelepsy::on_actionSave_As_triggered, this));
}
开发者ID:mzhaolz,项目名称:pixelepsy,代码行数:8,代码来源:pixelepsy.cpp


示例5: createAction

QList<QAction*> LiveViewManager::bandwidthActions(int cv, QObject *target,
                                                  const char *slot) const
{
    QList<QAction*> re;
    re << createAction(tr("Full Bandwidth"), FullBandwidth, cv, target, slot)
       << createAction(tr("Low Bandwidth"), LowBandwidth, cv, target, slot);
    return re;
}
开发者ID:chenbk85,项目名称:bluecherry-client,代码行数:8,代码来源:LiveViewManager.cpp


示例6: NotationTool

SymbolInserter::SymbolInserter(NotationWidget *widget) :
    NotationTool("symbolinserter.rc", "SymbolInserter", widget),
    m_symbol(Symbol::Segno)
{
    createAction("select", SLOT(slotSelectSelected()));
    createAction("erase", SLOT(slotEraseSelected()));
    createAction("notes", SLOT(slotNotesSelected()));
}
开发者ID:EQ4,项目名称:RosegardenW,代码行数:8,代码来源:SymbolInserter.cpp


示例7: MatrixTool

MatrixEraser::MatrixEraser(MatrixWidget *parent) :
    MatrixTool("matrixeraser.rc", "MatrixEraser", parent)
{
    createAction("resize", SLOT(slotResizeSelected()));
    createAction("draw", SLOT(slotDrawSelected()));
    createAction("select", SLOT(slotSelectSelected()));
    createAction("move", SLOT(slotMoveSelected()));

    createMenu();
}
开发者ID:EQ4,项目名称:RosegardenW,代码行数:10,代码来源:MatrixEraser.cpp


示例8: QMainWindow

QtGnuplotWindow::QtGnuplotWindow(int id, QtGnuplotEventHandler* eventHandler, QWidget* parent)
    : QMainWindow(parent)
{
    m_eventHandler = eventHandler;
    m_id = id;
    setAttribute(Qt::WA_DeleteOnClose);
    setWindowIcon(QIcon(":/images/gnuplot"));

    // Register as the main event receiver if not already created
    if (m_eventHandler == 0)
        m_eventHandler = new QtGnuplotEventHandler(this,
                "qtgnuplot" + QString::number(QCoreApplication::applicationPid()));

    // Central widget
    m_widget = new QtGnuplotWidget(m_id, m_eventHandler, this);
    connect(m_widget, SIGNAL(statusTextChanged(const QString&)), this, SLOT(on_setStatusText(const QString&)));
    setCentralWidget(m_widget);

    // Bars
    m_toolBar = new QToolBar(this);
    addToolBar(m_toolBar);
    statusBar()->showMessage(tr("Qt frontend for gnuplot"));

    // Actions
    QAction* copyToClipboardAction = new QAction(QIcon(":/images/clipboard"   ), tr("Copy to clipboard"), this);
    QAction* printAction           = new QAction(QIcon(":/images/print"       ), tr("Print"            ), this);
    QAction* exportAction          = new QAction(QIcon(":/images/export"      ), tr("Export"           ), this);
    QAction* exportPdfAction       = new QAction(QIcon(":/images/exportPDF"   ), tr("Export to PDF"    ), this);
    QAction* exportEpsAction       = new QAction(QIcon(":/images/exportVector"), tr("Export to EPS"    ), this);
    QAction* exportSvgAction       = new QAction(QIcon(":/images/exportVector"), tr("Export to SVG"    ), this);
    QAction* exportPngAction       = new QAction(QIcon(":/images/exportRaster"), tr("Export to image"  ), this);
    QAction* settingsAction        = new QAction(QIcon(":/images/settings"    ), tr("Settings"         ), this);
    connect(copyToClipboardAction, SIGNAL(triggered()), m_widget, SLOT(copyToClipboard()));
    connect(printAction,           SIGNAL(triggered()), m_widget, SLOT(print()));
    connect(exportPdfAction,       SIGNAL(triggered()), m_widget, SLOT(exportToPdf()));
    connect(exportEpsAction,       SIGNAL(triggered()), m_widget, SLOT(exportToEps()));
    connect(exportSvgAction,       SIGNAL(triggered()), m_widget, SLOT(exportToSvg()));
    connect(exportPngAction,       SIGNAL(triggered()), m_widget, SLOT(exportToImage()));
    connect(settingsAction,        SIGNAL(triggered()), m_widget, SLOT(showSettingsDialog()));
    QMenu* exportMenu = new QMenu(this);
    exportMenu->addAction(copyToClipboardAction);
    exportMenu->addAction(printAction);
    exportMenu->addAction(exportPdfAction);
//	exportMenu->addAction(exportEpsAction);
    exportMenu->addAction(exportSvgAction);
    exportMenu->addAction(exportPngAction);
    exportAction->setMenu(exportMenu);
    m_toolBar->addAction(exportAction);
    createAction(tr("Replot")       , 'e', ":/images/replot");
    createAction(tr("Show grid")    , 'g', ":/images/grid");
    createAction(tr("Previous zoom"), 'p', ":/images/zoomPrevious");
    createAction(tr("Next zoom")    , 'n', ":/images/zoomNext");
    createAction(tr("Autoscale")    , 'a', ":/images/autoscale");
    m_toolBar->addAction(settingsAction);
}
开发者ID:zsx,项目名称:gnuplot,代码行数:55,代码来源:QtGnuplotWindow.cpp


示例9: createAction

void
ControlEditorDialog::setupActions()
{
    createAction("file_close", SLOT(slotClose()));
    m_closeButton->setText(tr("Close"));
    connect(m_closeButton, SIGNAL(released()), this, SLOT(slotClose()));
    createAction("control_help", SLOT(slotHelpRequested()));
    createAction("help_about_app", SLOT(slotHelpAbout()));

    createGUI("controleditor.rc");
}
开发者ID:UIKit0,项目名称:rosegarden,代码行数:11,代码来源:ControlEditorDialog.cpp


示例10: QActionGroup

void DiagramToolBox::createActions()
{
	mDiagramModeActionGroup = new QActionGroup(this);
	connect(mDiagramModeActionGroup, SIGNAL(triggered(QAction*)),
		this, SLOT(setDiagramModeFromAction(QAction*)));

	addAction(createAction("Select Mode", ":/icons/oxygen/edit-select.png", "Escape"));
	addAction(createAction("Scroll Mode", ":/icons/oxygen/transform-move.png"));
	addAction(createAction("Zoom Mode", ":/icons/oxygen/page-zoom.png"));

	actions()[SelectModeAction]->setChecked(true);
}
开发者ID:jaallen85,项目名称:jade-legacy,代码行数:12,代码来源:DiagramToolBox.cpp


示例11: MatrixTool

MatrixResizer::MatrixResizer(MatrixWidget *parent) :
    MatrixTool("matrixresizer.rc", "MatrixResizer", parent),
    m_currentElement(0),
    m_currentViewSegment(0)
{
    createAction("select", SLOT(slotSelectSelected()));
    createAction("draw", SLOT(slotDrawSelected()));
    createAction("erase", SLOT(slotEraseSelected()));
    createAction("move", SLOT(slotMoveSelected()));
    
    createMenu();
}
开发者ID:tedfelix,项目名称:rosegarden,代码行数:12,代码来源:MatrixResizer.cpp


示例12: Vec2

void Mouse::fall(Snare* snare) {
	fallingSnare = snare;
	fallIn = true;
	Vec2 mousePosition = Vec2(mousePositionX, mousePositionY);
	auto seq = Sequence::create(
		CallFunc::create(this, callfunc_selector(Mouse::setFallDif)),
		Spawn::create(createAction("fall", 0.1, 0.08f, 1),
		MoveTo::create(0.56, Vec2(mousePositionX, mousePositionY - 70)), NULL),
		Spawn::create(createAction("fallend", 0.1, 0.08f, 1), MoveTo::create(0.56, mousePosition), NULL),
		CallFunc::create(this, callfunc_selector(Mouse::moveMouseBehineSnare)),
		createRunningSequence(), NULL);
	this->runAction(seq);
}
开发者ID:JieweiWei,项目名称:TheWittyMouse2,代码行数:13,代码来源:Mouse.cpp


示例13: createAction

void HtmlPreviewController::createActions()
{
    zoomInAction = createAction(tr("Zoom &In"), QKeySequence(Qt::CTRL | Qt::Key_Plus));
    connect(zoomInAction, SIGNAL(triggered()), 
            this, SLOT(zoomInView()));

    zoomOutAction = createAction(tr("Zoom &Out"), QKeySequence(Qt::CTRL | Qt::Key_Minus));
    connect(zoomOutAction, SIGNAL(triggered()),
            this, SLOT(zoomOutView()));

    zoomResetAction = createAction(tr("Reset &Zoom"), QKeySequence(Qt::CTRL | Qt::Key_0));
    connect(zoomResetAction, SIGNAL(triggered()),
            this, SLOT(resetZoomOfView()));
}
开发者ID:Bloodknight,项目名称:CuteMarkEd,代码行数:14,代码来源:htmlpreviewcontroller.cpp


示例14: resize

    MainWindow::MainWindow()
    {
        resize(640, 640);

        scroll = new QScrollArea();
        scroll->setWidgetResizable(true);
        setCentralWidget(scroll);

        editor = new EditorWidget();
        scroll->setWidget(editor);

        statusBar()->showMessage(tr("%1 - by Overkill.").arg(AppName), 2000);
        statusBar()->setStyleSheet(
            "QStatusBar {"
            "   border-top: 1px solid #CCCCCC;"
            "   background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #DADBDE, stop: 1 #F6F7FA);"
            "   padding: 4px;"
            "   color: #777777;"
            "}"
        );

#ifdef Q_WS_WIN
        QKeySequence quitSequence(Qt::ALT + Qt::Key_F4);
#else
        QKeySequence quitSequence(QKeySequence::Quit);
#endif

        fileMenu = menuBar()->addMenu(tr("&File"));
        newAction = createAction(fileMenu, tr("&New"), tr("Create a new CHR."), QKeySequence::New);
        openAction = createAction(fileMenu, tr("&Open..."), tr("Open an existing CHR."), QKeySequence::Open);
        createSeparator(fileMenu);
        saveAction = createAction(fileMenu, tr("&Save..."), tr("Save the current CHR."), QKeySequence::Save);
        saveAsAction = createAction(fileMenu, tr("Save &As..."), tr("Save a copy of the current CHR."), QKeySequence::SaveAs);
        createSeparator(fileMenu);
        for(int i = 0; i < MaxRecentCount; ++i)
        {
            auto action = createAction(fileMenu, QKeySequence(Qt::ALT + Qt::Key_1 + i));
            action->setDisabled(true);
            recentFileActions[i] = action;
            connect(action, SIGNAL(triggered()), this, SLOT(openRecentFile()));
        }
        clearRecentAction = createAction(fileMenu, tr("Clear &Recent Files"), tr("Clear all recently opened files."), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Delete));
        updateRecentFiles();
        createSeparator(fileMenu);
        exitAction = createAction(fileMenu, tr("E&xit"), tr("Exit the program."), quitSequence);

        helpMenu = menuBar()->addMenu(tr("&Help"));
        aboutAction = createAction(helpMenu, tr("&About..."), tr("About %1.").arg(AppName), QKeySequence::HelpContents);

        connect(newAction, SIGNAL(triggered()), this, SLOT(newFile()));
        connect(openAction, SIGNAL(triggered()), this, SLOT(openFile()));
        connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile()));
        connect(saveAsAction, SIGNAL(triggered()), this, SLOT(saveFileAs()));
        connect(clearRecentAction, SIGNAL(triggered()), this, SLOT(clearRecentFiles()));
        connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
        connect(aboutAction, SIGNAL(triggered()), this, SLOT(about()));

        QTimer::singleShot(0, this, SLOT(newFile()));
    }
开发者ID:Bananattack,项目名称:overbrew,代码行数:59,代码来源:mainwindow.cpp


示例15: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)

{

    Settings settings;
    settings.s_plot.Xfrom = 0;
    settings.s_plot.Xto = 500;
    settings.s_plot.Yfrom = 0;
    settings.s_plot.Yto = 500;
    settings.s_plot.x_name = "X";
    settings.s_plot.y_name = "Y";


    d_panel = new Panel();
    d_panel->setSettings(settings);

    QWidget *w = new QWidget( this );

    graf = new Graf();

    QHBoxLayout *hLayout = new QHBoxLayout( w );
    hLayout->addWidget( d_panel );
    hLayout->addWidget( graf, 10 );

    setCentralWidget( w );

    updatePlot();

    connect( d_panel, SIGNAL( edited() ), SLOT( updatePlot() ) );

    createAction();
    createToolBar();

}
开发者ID:ChebotarDmytro,项目名称:Graph,代码行数:35,代码来源:mainwindow.cpp


示例16: createAction

void
PikaCriteriaAction::addCriteriaAction(const std::string & name)
{
  MooseSharedPointer<MooseObjectAction> action = createAction("PikaCriteria", name);
  action->getObjectParams().set<MooseEnum>("criteria") = name;
  _awh.addActionBlock(action);
}
开发者ID:brianmoose,项目名称:pika,代码行数:7,代码来源:PikaCriteriaAction.C


示例17: switch

void ActionDialog::on_buttonBox_clicked(QAbstractButton* button)
{
    Command cmd;
    ConfigurationManager *cm;

    switch ( ui->buttonBox->standardButton(button) ) {
    case QDialogButtonBox::Ok:
        createAction();
        break;
    case QDialogButtonBox::Save:
        cmd.name = cmd.cmd = ui->cmdEdit->currentText();
        cmd.input = ui->comboBoxInputFormat->currentText();
        cmd.output = ui->comboBoxOutputFormat->currentText();
        cmd.sep = ui->separatorEdit->text();
        cmd.outputTab = ui->comboBoxOutputTab->currentText();

        cm = ConfigurationManager::instance();
        cm->addCommand(cmd);
        cm->saveSettings();
        QMessageBox::information(
                    this, tr("Command saved"),
                    tr("Command was saved and can be accessed from item menu.\n"
                       "You can set up the command in preferences.") );
        break;
    case QDialogButtonBox::Cancel:
        close();
        break;
    default:
        break;
    }
}
开发者ID:pmros,项目名称:CopyQ,代码行数:31,代码来源:actiondialog.cpp


示例18: QDialog

CreateRepoDialog::CreateRepoDialog(const Account& account,
                                   const QString& worktree,
                                   ReposTab *repos_tab,
                                   QWidget *parent)
    : QDialog(parent),
      path_(worktree),
      request_(NULL),
      account_(account),
      repos_tab_(repos_tab)
{
    setupUi(this);
    setWindowTitle(tr("Create a library"));
    setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

#if defined(Q_OS_MAC)
    layout()->setContentsMargins(6, 6, 6, 6);
    layout()->setSpacing(5);
#endif

    mStatusText->setText("");

    mDirectory->setText(worktree);
    mName->setText(QDir(worktree).dirName());

    connect(mChooseDirBtn, SIGNAL(clicked()), this, SLOT(chooseDirAction()));
    connect(mOkBtn, SIGNAL(clicked()), this, SLOT(createAction()));

    const QRect screen = QApplication::desktop()->screenGeometry();
    move(screen.center() - this->rect().center());
}
开发者ID:Geosparc,项目名称:seafile-client,代码行数:30,代码来源:create-repo-dialog.cpp


示例19: main

int main(int argc, char* argv[])
{
    // Virtual Worldの作成
    WorldPtr world = createWorld();
    RobotPtr robot = createRobot(world);

    // Agentの作成
    ActionPtr        action = createAction(robot);
    DistSensorPtr    sensor = createDistSensor(robot);
    EnvironmentPtr   env    = createEnvironment(sensor);
    ThreadedAgentPtr agent  = createAgent(sensor, action);

    // 初期化
    env->init();
    agent->init();
    robot->init();

    QApplication app(argc, argv);
    MainWindow window;
    window.setWorldModel(world);
    window.setRobotModel(robot);
    window.setEnvironment(env);
    window.setAgent(agent);

    window.show();
    return app.exec();
}
开发者ID:cad-san,项目名称:lightseek,代码行数:27,代码来源:main.cpp


示例20: QTreeWidgetItem

void DiagramToolBox::addItem(DrawingItem* item, const QString& section, const QString& text,
	const QString& iconPath)
{
	if (item)
	{
		QTreeWidgetItem* newItem = nullptr;
		QTreeWidgetItem* sectionItem = nullptr;

		for(int i = 0; !sectionItem && i < mTreeWidget->topLevelItemCount(); i++)
		{
			if (mTreeWidget->topLevelItem(i)->text(0) == section)
				sectionItem = mTreeWidget->topLevelItem(i);
		}

		if (!sectionItem)
		{
			sectionItem = new QTreeWidgetItem();
			sectionItem->setText(0, section);
			sectionItem->setBackground(0, palette().brush(QPalette::Button));
			mTreeWidget->addTopLevelItem(sectionItem);
		}

		newItem = new QTreeWidgetItem(sectionItem);
		newItem->setText(0, text);
		if (!iconPath.isEmpty()) newItem->setIcon(0, QIcon(iconPath));

		QAction* newAction = createAction(text, iconPath, "", item->uniqueKey());
		mItemActions[newItem] = newAction;
	}
}
开发者ID:jaallen85,项目名称:jade-legacy,代码行数:30,代码来源:DiagramToolBox.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ createActions函数代码示例发布时间:2022-05-30
下一篇:
C++ create函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap