这篇教程C++ AddAction函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AddAction函数的典型用法代码示例。如果您正苦于以下问题:C++ AddAction函数的具体用法?C++ AddAction怎么用?C++ AddAction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AddAction函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AddActionvoid WatchWidget::CreateWidgets(){ m_toolbar = new QToolBar; m_toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_table = new QTableWidget; m_table->setColumnCount(5); m_table->verticalHeader()->setHidden(true); m_table->setContextMenuPolicy(Qt::CustomContextMenu); m_table->setSelectionMode(QAbstractItemView::SingleSelection); m_load = AddAction(m_toolbar, tr("Load"), this, &WatchWidget::OnLoad); m_save = AddAction(m_toolbar, tr("Save"), this, &WatchWidget::OnSave); m_load->setEnabled(false); m_save->setEnabled(false); auto* layout = new QVBoxLayout; layout->addWidget(m_toolbar); layout->addWidget(m_table); QWidget* widget = new QWidget; widget->setLayout(layout); setWidget(widget);}
开发者ID:MikeRavenelle,项目名称:dolphin,代码行数:27,
示例2: valuevoid kexInputKey::InitActions(void) { kexStr actionDef; kexKeyMap *keys; kexArray<kexHashKey> *list; kexStr name; int value; if( !gameManager.GameDef() || !gameManager.GameDef()->GetString("actionDef", actionDef) || !(keys = defManager.FindDefEntry(actionDef))) { common.Warning("kexInputKey::InitActions: No input action definition found/n"); return; } list = keys->GetHashList(); for(int i = 0; i < keys->GetHashSize(); i++) { for(unsigned int j = 0; j < list[i].Length(); j++) { name = list[i][j].GetName(); if(!keys->GetInt(name, value)) { common.Warning("kexInputKey::InitActions: entry %s contains non-integer value (%s)/n", name.c_str(), list[i][j].GetString()); continue; } AddAction((byte)value, (kexStr("+") + name).c_str()); AddAction((byte)value, (kexStr("-") + name).c_str()); } }}
开发者ID:svkaiser,项目名称:TurokEX,代码行数:30,
示例3: QMenuvoid WatchWidget::ShowContextMenu(){ QMenu* menu = new QMenu(this); if (m_table->selectedItems().size()) { auto row_variant = m_table->selectedItems()[0]->data(Qt::UserRole); if (!row_variant.isNull()) { int row = row_variant.toInt(); if (row >= 0) { // i18n: This kind of "watch" is used for watching emulated memory. // It's not related to timekeeping devices. AddAction(menu, tr("&Delete Watch"), this, [this, row] { DeleteWatch(row); }); AddAction(menu, tr("&Add Memory Breakpoint"), this, [this, row] { AddWatchBreakpoint(row); }); } } } menu->addSeparator(); AddAction(menu, tr("Update"), this, &WatchWidget::Update); menu->exec(QCursor::pos());}
开发者ID:MikeRavenelle,项目名称:dolphin,代码行数:29,
示例4: QWidgetIcecastFilterWidget::IcecastFilterWidget(QWidget* parent) : QWidget(parent), ui_(new Ui_IcecastFilterWidget), menu_(new QMenu(tr("Display options"), this)), sort_mode_mapper_(new QSignalMapper(this)) { ui_->setupUi(this); // Icons ui_->options->setIcon(IconLoader::Load("configure")); // Options actions QActionGroup* group = new QActionGroup(this); AddAction(group, ui_->action_sort_genre_popularity, IcecastModel::SortMode_GenreByPopularity); AddAction(group, ui_->action_sort_genre_alphabetically, IcecastModel::SortMode_GenreAlphabetical); AddAction(group, ui_->action_sort_station, IcecastModel::SortMode_StationAlphabetical); // Options menu menu_->setIcon(ui_->options->icon()); menu_->addActions(group->actions()); ui_->options->setMenu(menu_); connect(sort_mode_mapper_, SIGNAL(mapped(int)), SLOT(SortModeChanged(int)));}
开发者ID:Aceler,项目名称:Clementine,代码行数:26,
示例5: QWidgetIcecastFilterWidget::IcecastFilterWidget(QWidget *parent) : QWidget(parent), ui_(new Ui_IcecastFilterWidget), sort_mode_mapper_(new QSignalMapper(this)){ ui_->setupUi(this); // Icons ui_->options->setIcon(IconLoader::Load("configure")); // Options actions QActionGroup* group = new QActionGroup(this); AddAction(group, ui_->action_sort_genre_popularity, IcecastModel::SortMode_GenreByPopularity); AddAction(group, ui_->action_sort_genre_alphabetically, IcecastModel::SortMode_GenreAlphabetical); AddAction(group, ui_->action_sort_station, IcecastModel::SortMode_StationAlphabetical); // Options menu QMenu* options_menu = new QMenu(this); options_menu->addActions(group->actions()); ui_->options->setMenu(options_menu); connect(sort_mode_mapper_, SIGNAL(mapped(int)), SLOT(SortModeChanged(int)));#ifdef Q_OS_DARWIN delete ui_->filter; MacLineEdit* lineedit = new MacLineEdit(this); ui_->horizontalLayout->insertWidget(1, lineedit); filter_ = lineedit;#else filter_ = ui_->filter;#endif}
开发者ID:ximion,项目名称:Clementine-LibDanceTag,代码行数:32,
示例6: addMenuvoid MenuBar::AddFileMenu(){ QMenu* file_menu = addMenu(tr("&File")); m_open_action = AddAction(file_menu, tr("&Open..."), this, &MenuBar::Open, QKeySequence(QStringLiteral("Ctrl+O"))); m_exit_action = AddAction(file_menu, tr("E&xit"), this, &MenuBar::Exit, QKeySequence(QStringLiteral("Alt+F4")));}
开发者ID:t27duck,项目名称:dolphin,代码行数:8,
示例7: tVesselsSettingsMenuCommon//-----------------------------------------------------------------------------//! Create menu from common actions //-----------------------------------------------------------------------------tVesselsSettingsMenuLowrance::tVesselsSettingsMenuLowrance( QWidget* parent ): tVesselsSettingsMenuCommon( parent ){ SetTitle( tr( "Vessels", "TITLE" ) ); tDistanceUnits distanceUnits = (tDistanceUnits)tUnitsSettings::Instance()->Units( UNITS_DISTANCE ); // Must match tVesselsSettings.cpp QStringList lengthOptions; lengthOptions << tr( "Off" ); if ( distanceUnits == UNITS_DISTANCE_NAUTICAL_MILES ) { lengthOptions << tr( "1 NM", "nautical miles" ); lengthOptions << tr( "10 NM", "nautical miles" ); lengthOptions << tr( "100 NM", "nautical miles" ); } else if ( distanceUnits == UNITS_DISTANCE_KILOMETERS ) { lengthOptions << tr( "1 km", "kilometers" ); lengthOptions << tr( "10 km", "kilometers" ); lengthOptions << tr( "100 km", "kilometers" ); } else if ( distanceUnits == UNITS_DISTANCE_MILES ) { lengthOptions << tr( "1 mile", "miles" ); lengthOptions << tr( "10 miles", "miles" ); lengthOptions << tr( "100 miles", "miles" ); } lengthOptions << tr( "1 min", "minutes" ) << tr( "2 min", "minutes" ) << tr( "10 min", "minutes" ) << tr( "30 min", "minutes" ) << tr( "60 min", "minutes" ) << tr( "120 min", "minutes" ); int initialIndex = 0; if ( m_VesselsSettings.ExtensionLines() && m_VesselsSettings.CourseExtensionConfig() != tVesselsSettings::Extension_Infinite ) { initialIndex = static_cast<int>( m_VesselsSettings.CourseExtensionConfig() ) + 1; //Plus one to step over "Off" } m_pCourseExtensionAct = new tListAction( tr( "Course extension" ), lengthOptions, initialIndex ); Connect( m_pCourseExtensionAct, SIGNAL( ValueFinalised( int ) ), this, SLOT( OnCourseExtensionFinalised( int ) ) ); // HDS 5x (sonar-only) doesn't fully expose AIS, but does have MARPA // MARPA only really needs the course extension and dangerous vessels menu items if( tProductSettings::Instance().AISAllowed() ) { AddAction( m_pSetMMSIAct ); AddAction( m_pHideIconsAct ); } AddAction( m_pCourseExtensionAct ); AddAction( m_pDangerousVesselsAct );}
开发者ID:dulton,项目名称:53_hero,代码行数:61,
示例8: AddActionvoid __fastcall TReconcileErrorForm::InitReconcileActions() { AddAction(raSkip); AddAction(raCancel); AddAction(raCorrect); if (FCurColIdx > 0) { AddAction(raRefresh); AddAction(raMerge); } ActionGroup->ItemIndex = 0;}
开发者ID:SkylineNando,项目名称:Delphi,代码行数:10,
示例9: SetTitleDemoOcclusion::DemoOcclusion(){ SetTitle("Occlusion Demo"); AddAction('1', "Increase Occlusion", std::bind(&DemoOcclusion::OcclusionInc, this)); AddAction('2', "Decrease Occlusion", std::bind(&DemoOcclusion::OcclusionDec, this)); OccludeValue = 0; YSE::System().occlusionCallback(OcclusionFunction); sound.create("..//TestResources//pulse1.ogg", nullptr, true); sound.occlusion(true); sound.play();}
开发者ID:yvanvds,项目名称:yse-soundengine,代码行数:13,
示例10: tCZoneSettingsMenuCommon//-----------------------------------------------------------------------------//! Create menu from common actions //-----------------------------------------------------------------------------tCZoneSettingsMenuSimrad::tCZoneSettingsMenuSimrad( QWidget* parent ): tCZoneSettingsMenuCommon( parent ){ SetTitle( "CZone" ); // don't need to translate brand name AddAction( m_pSetBatteryFullAction ); AddAction( m_pShowOnStartupAction ); AddAction( m_pBacklightAction ); AddSeparator(); AddAction( m_pSetDipswitchAction );// AddAction( m_pReclaimAction );}
开发者ID:dulton,项目名称:53_hero,代码行数:16,
示例11: AddActionvoid MenuBar::AddStateLoadMenu(QMenu* emu_menu){ m_state_load_menu = emu_menu->addMenu(tr("&Load State")); AddAction(m_state_load_menu, tr("Load State from File"), this, &MenuBar::StateLoad); AddAction(m_state_load_menu, tr("Load State from Selected Slot"), this, &MenuBar::StateLoadSlot); m_state_load_slots_menu = m_state_load_menu->addMenu(tr("Load State from Slot")); AddAction(m_state_load_menu, tr("Undo Load State"), this, &MenuBar::StateLoadUndo); for (int i = 1; i <= 10; i++) { QAction* action = m_state_load_slots_menu->addAction(QStringLiteral("")); connect(action, &QAction::triggered, this, [=]() { emit StateLoadSlotAt(i); }); }}
开发者ID:t27duck,项目名称:dolphin,代码行数:15,
示例12: GetNodebool CCharShape::RotateNode (size_t node_name, int axis, ETR_DOUBLE angle) { TCharNode *node = GetNode (node_name); if (node == NULL) return false; if (axis > 3) return false; TMatrix<4, 4> rotMatrix; char caxis = '0'; switch (axis) { case 1: caxis = 'x'; break; case 2: caxis = 'y'; break; case 3: caxis = 'z'; break; } rotMatrix.SetRotationMatrix(angle, caxis); node->trans = node->trans * rotMatrix; rotMatrix.SetRotationMatrix(-angle, caxis); node->invtrans = rotMatrix * node->invtrans; if (newActions && useActions) AddAction (node_name, axis, NullVec3, angle); return true;}
开发者ID:dbluelle,项目名称:pandora-extremetuxracer,代码行数:28,
示例13: StartupPlugin/* Handles startup.*/static AIErr StartupPlugin ( SPInterfaceMessage* message ){ AIErr error = kNoErr; error = AcquireSuites( message->d.basic ); if (!error) { // Allocate our globals - Illustrator will keep track of these. error = message->d.basic->AllocateBlock( sizeof(Globals), (void **) &g ); if ( !error ) { message->d.globals = g; } } if (!error) { error = AddMenu(message); } if (!error) { error = AddFilter(message); } if (!error) { error = AddTool(message); } if (!error) { error = AddAction(message); } ReleaseSuites( message->d.basic ); return error;}
开发者ID:btempleton,项目名称:sg-aics3mac-plugins,代码行数:28,
示例14: AddActionQAction* NodeInstanceWidget::AddActionDelete(){ return AddAction( tr("Delete"), [this](){ deleteLater(); emit DeleteNodeInstance(mNodeInstance); });}
开发者ID:jschmidt42,项目名称:nim,代码行数:7,
示例15: GetNodebool CCharShape::RotateNode (size_t node_name, int axis, double angle) { TCharNode *node = GetNode (node_name); if (node == NULL) return false; if (axis > 3) return false; TMatrix rotMatrix; char caxis = '0'; switch (axis) { case 1: caxis = 'x'; break; case 2: caxis = 'y'; break; case 3: caxis = 'z'; break; } MakeRotationMatrix (rotMatrix, angle, caxis); MultiplyMatrices (node->trans, node->trans, rotMatrix); MakeRotationMatrix (rotMatrix, -angle, caxis); MultiplyMatrices (node->invtrans, rotMatrix, node->invtrans); if (newActions && useActions) AddAction (node_name, axis, NullVec, angle); return true;}
开发者ID:ktan2020,项目名称:extremetuxracer-win32,代码行数:28,
示例16: AddActionvoid OMenu :: AddAction (OEHAction *action ){ if ( action ) AddAction(action->get_qaction());}
开发者ID:BackupTheBerlios,项目名称:openaqua-svn,代码行数:7,
示例17: SetupActionslogical OMenu :: SetupActions (OEHAction *action ){ QAction *before_action = NULL; OEHAction *oeh_action = NULL; OPopupMenu *sub_menu = NULL; int count = 0; int indx0 = 0; logical term = NO;BEGINSEQ if( !qwidget ) ERROR if( !action || !action->get_childs() ) ERROR if ( !qwidget->actions().isEmpty() ) before_action = qwidget->actions().first(); count = action->get_childs()->size(); menu_action = action; qwidget->setObjectName(action->GetName()); while ( indx0 < count ) { oeh_action = action->get_childs()->at(indx0++); if ( oeh_action->IsSeparated() ) AddSeparator(before_action); if ( !oeh_action->get_childs() || oeh_action->get_childs()->size() <= 0 ) AddAction(oeh_action->get_qaction(),before_action); else if ( oeh_action->IsGrouped() ) AddActions(&oeh_action->get_group()->actions(),before_action); else AddMenu(oeh_action,before_action); }RECOVER term = YES;ENDSEQ return(term);}
开发者ID:BackupTheBerlios,项目名称:openaqua-svn,代码行数:35,
示例18: InitNewSTDMETHODIMP CPropertyChoice::AddActionsByCLSID (CALPCLSID *pcaClsIds){HRESULT hr = E_FAIL; if (!m_fIsInitialized) { hr = InitNew(); if (FAILED(hr)) return hr; }// hinzufügen der einzelnen Aktionen for (ULONG i = 0; i < pcaClsIds -> cElems; i++) { try { WPropertyAction WAct (*(pcaClsIds -> ppElems[i])); // throws hr { WPersistStreamInit Init = WAct; // throws hr hr = Init -> InitNew(); if (FAILED(hr)) _com_issue_error(hr); } hr = AddAction (WAct); if (FAILED(hr)) _com_issue_error(hr); } catch (_com_error& hr) { return _COM_ERROR(hr); } } return NOERROR;}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:30,
示例19: ASSERT/// /brief serialize current object state for redo action/// /param size - sizeof(IHashString*)/// /param param - pointer to IHashString with name of object to serializeDWORD CUndoRedoComponent::OnRedoSaveObject(DWORD size, void *param){ ASSERT(m_pCurrentCommandData != NULL); VERIFY_MESSAGE_SIZE(size, sizeof(IHashString*)); IHashString *pObjectName = GetName(param); if (pObjectName == NULL) { return MSG_ERROR; } DWORD res = m_DependantProcessors.ProcessObject(pObjectName, false); if (MSG_HANDLED != res) { return res; } IUndoRedoAction *pAction = new CObjectSerializeAction(pObjectName); res = AddAction(pAction, false); if (res != MSG_HANDLED) { delete pAction; } return res;}
开发者ID:klhurley,项目名称:ElementalEngine2,代码行数:28,
示例20: definednsresult nsEudoraFilters::AddMailboxAction(const char* pMailboxPath, bool isTransfer){ nsresult rv; nsCString nameHierarchy;#if defined(XP_WIN) nsCString filePath; m_pLocation->GetNativePath(filePath); int32_t index = filePath.RFindChar('//'); if (index >= 0) filePath.SetLength(index); if (!nsEudoraWin32::GetMailboxNameHierarchy(filePath, pMailboxPath, nameHierarchy)) return NS_ERROR_INVALID_ARG;#endif#ifdef XP_MACOSX nameHierarchy = pMailboxPath;#endif nsCOMPtr<nsIMsgFolder> folder; rv = GetMailboxFolder(nameHierarchy.get(), getter_AddRefs(folder)); nsAutoCString folderURI; if (NS_SUCCEEDED(rv)) rv = folder->GetURI(folderURI); if (NS_FAILED(rv)) return NS_ERROR_INVALID_ARG; rv = AddAction(isTransfer? (nsMsgRuleActionType)nsMsgFilterAction::MoveToFolder : (nsMsgRuleActionType)nsMsgFilterAction::CopyToFolder, 0, 0, 0, nullptr, folderURI.get()); if (NS_SUCCEEDED(rv) && isTransfer) m_hasTransfer = true; return rv;}
开发者ID:MoonchildProductions,项目名称:FossaMail,代码行数:34,
示例21: AddTrayButtonAction/** Add a action to a tray button. */void AddTrayButtonAction(TrayComponentType *cp, const char *action, int mask){ TrayButtonType *bp = (TrayButtonType*)cp->object; AddAction(&bp->actions, action, mask);}
开发者ID:kuailexs,项目名称:jwm,代码行数:8,
示例22: AddClockAction/** Add an action to a clock. */void AddClockAction(TrayComponentType *cp, const char *action, int mask){ ClockType *clock = (ClockType*)cp->object; AddAction(&clock->actions, action, mask);}
开发者ID:JamesLinus,项目名称:jwm,代码行数:8,
示例23: AddActionvoid AttentionMessage::AddDontShowAgain(){ auto id = m_id; AddAction( MSW_OR_OTHER(_("Don't show again"), _("Don't Show Again")), [id]{ AddToBlacklist(id); });}
开发者ID:benpope82,项目名称:poedit,代码行数:8,
示例24: CRollbackActionUnregistervoid CRollbackInfo::AddActionUnregister(CString sFile){ // Set up information CRollbackActionBase * pAction = new CRollbackActionUnregister(sFile); // Add to array AddAction(pAction);}
开发者ID:Bitfall,项目名称:AppWhirr-client,代码行数:8,
示例25: CRollbackActionCopyvoid CRollbackInfo::AddActionCopy(CString sOldLocation, CString sNewLocation){ // Set up information CRollbackActionBase * pAction = new CRollbackActionCopy(sOldLocation, sNewLocation); // Add to array AddAction(pAction);}
开发者ID:Bitfall,项目名称:AppWhirr-client,代码行数:8,
示例26: Actionvoid State::MeltWith(State *s) { // copy actions of s to state Action *a; for (Action *action = s->firstAction; action != NULL; action = action->next) { a = new Action(action->typ, action->sym, action->tc); a->AddTargets(action); AddAction(a); }}
开发者ID:Kampbell,项目名称:coco-r-cpp,代码行数:8,
注:本文中的AddAction函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AddAnchor函数代码示例 C++ Actor_Set_Goal_Number函数代码示例 |