您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Delegate函数代码示例

51自学网 2021-06-01 20:26:27
  C++
这篇教程C++ Delegate函数代码示例写得很实用,希望能帮到您。

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

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

示例1: mouseMoveEvent

void UBGraphicsTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event){    if (!Delegate() || !Delegate()->mouseMoveEvent(event))    {        QGraphicsTextItem::mouseMoveEvent(event);    }}
开发者ID:zhgn,项目名称:OpenBoard,代码行数:7,


示例2: QGraphicsTextItem

UBGraphicsTextItem::UBGraphicsTextItem(QGraphicsItem * parent) :    QGraphicsTextItem(parent)    , UBGraphicsItem()    , mMultiClickState(0)    , mLastMousePressTime(QTime::currentTime()){    setDelegate(new UBGraphicsTextItemDelegate(this, 0));    // TODO claudio remove this because in contrast with the fact the frame should be created on demand.    Delegate()->createControls();    Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);    Delegate()->setUBFlag(GF_FLIPPABLE_ALL_AXIS, false);    Delegate()->setUBFlag(GF_REVOLVABLE, true);    mTypeTextHereLabel = tr("<Type Text Here>");    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly    setFlag(QGraphicsItem::ItemIsSelectable, true);    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);    setTextInteractionFlags(Qt::TextEditorInteraction);    setUuid(QUuid::createUuid());    connect(document(), SIGNAL(contentsChanged()), Delegate(), SLOT(contentsChanged()));    connect(document(), SIGNAL(undoCommandAdded()), this, SLOT(undoCommandAdded()));    connect(document()->documentLayout(), SIGNAL(documentSizeChanged(const QSizeF &)),            this, SLOT(documentSizeChanged(const QSizeF &)));}
开发者ID:zhgn,项目名称:OpenBoard,代码行数:34,


示例3: Delegate

void UBGraphicsTextItem::setSelected(bool selected){    if(selected){        Delegate()->createControls();        Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::Resizing);    }    QGraphicsTextItem::setSelected(selected);}
开发者ID:zhgn,项目名称:OpenBoard,代码行数:8,


示例4: setTextWidth

void UBGraphicsTextItem::resize(qreal w, qreal h){    setTextWidth(w);    setTextHeight(h);    if (Delegate())        Delegate()->positionHandles();}
开发者ID:zhgn,项目名称:OpenBoard,代码行数:8,


示例5: Delegate

voidIMenuListener::Events::RemoveListener(IMenuListener::Pointer l){  if (l.IsNull()) return;  menuAboutToShow -= Delegate(l.GetPointer(), &IMenuListener::MenuAboutToShow);  menuAboutToHide -= Delegate(l.GetPointer(), &IMenuListener::MenuAboutToHide);}
开发者ID:AGrafmint,项目名称:MITK,代码行数:9,


示例6: IMenuPage

InstructionsMenuPage::InstructionsMenuPage(Menu *menu, SaveGameManager *savedGames) : IMenuPage(menu){	this->savedGames = savedGames;		menuButton = new Input_Button();	if(AppConfig::Instance().IsIpad())	{		menuButton->SetSpriteAndBounds(12, 15, CR::AssetList::menu_menu_buttons);		menuButton->DesignSize(69,30);	}	else		menuButton->SetSpriteAndBounds(12, 11, CR::AssetList::menu_menu_buttons);	menuButton->SetSoundOn(true);	menuButton->OnClicked += Delegate(this, &InstructionsMenuPage::OnMenuButtonClicked);	input_objects.push_back(menuButton);		nextButton = new Input_Button();	if(AppConfig::Instance().IsIpad())	{		nextButton->SetSpriteAndBounds(394, 268, CR::AssetList::button_next);		nextButton->DesignSize(78,47);	}	else		nextButton->SetSpriteAndBounds(420, 277, CR::AssetList::button_next);	nextButton->SetSoundOn(true);	nextButton->OnClicked += Delegate(this, &InstructionsMenuPage::OnNextButtonClicked);	input_objects.push_back(nextButton);		prevButton = new Input_Button();	if(AppConfig::Instance().IsIpad())	{		prevButton->SetSpriteAndBounds(394, 268, CR::AssetList::button_previous);		prevButton->DesignSize(78,47);	}	else		prevButton->SetSpriteAndBounds(420, 277, CR::AssetList::button_previous);	prevButton->SetSoundOn(true);	prevButton->OnClicked += Delegate(this, &InstructionsMenuPage::OnPrevButtonClicked);	prevButton->Disabled(true);	input_objects.push_back(prevButton);		instructions01 = graphics_engine->CreateSprite1();	instructions01->SetImage(CR::AssetList::menu_instructions_01);	instructions01->SetPositionAbsalute(240, 160);	if(AppConfig::Instance().IsIpad())		instructions01->SetDesignSize(480,320);		instructions02 = graphics_engine->CreateSprite1();	instructions02->SetImage(CR::AssetList::menu_instructions_02);	instructions02->SetPositionAbsalute(240, 160);	if(AppConfig::Instance().IsIpad())		instructions02->SetDesignSize(480,320);		currPage = 1;}
开发者ID:shoematt,项目名称:BladeofBetrayal,代码行数:55,


示例7: Delegate

voidIControlListener::Events::RemoveListener(IControlListener::Pointer l){  if (l.IsNull()) return;  movedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlMoved);  resizedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlResized);  activatedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlActivated);  destroyedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlDestroyed);}
开发者ID:test-fd301,项目名称:MITK,代码行数:11,


示例8: Delegate

voidIWindowListener::Events::RemoveListener(IWindowListener::Pointer listener){  if (listener.IsNull()) return;  windowActivated -= Delegate(listener.GetPointer(), &IWindowListener::WindowActivated);  windowDeactivated -= Delegate(listener.GetPointer(), &IWindowListener::WindowDeactivated);  windowClosed -= Delegate(listener.GetPointer(), &IWindowListener::WindowClosed);  windowOpened -= Delegate(listener.GetPointer(), &IWindowListener::WindowOpened);}
开发者ID:test-fd301,项目名称:MITK,代码行数:11,


示例9: Delegate

voidIWindowListener::Events::RemoveListener(IWindowListener* listener){  if (listener == nullptr) return;  windowActivated -= Delegate(listener, &IWindowListener::WindowActivated);  windowDeactivated -= Delegate(listener, &IWindowListener::WindowDeactivated);  windowClosed -= Delegate(listener, &IWindowListener::WindowClosed);  windowOpened -= Delegate(listener, &IWindowListener::WindowOpened);}
开发者ID:151706061,项目名称:MITK,代码行数:11,


示例10: Delegate

QVariant UBGraphicsCurtainItem::itemChange(GraphicsItemChange change, const QVariant &value){    QVariant newValue = value;    if (Delegate())    {        newValue = Delegate()->itemChange(change, value);    }    return QGraphicsRectItem::itemChange(change, newValue);}
开发者ID:199901,项目名称:Sankore-3.1,代码行数:12,


示例11: Delegate

voidIPartListener::Events::AddListener(IPartListener::Pointer l){  if (l.IsNull()) return;  Types t = l->GetPartEventTypes();  if (t & ACTIVATED)    partActivated += Delegate(l.GetPointer(), &IPartListener::PartActivated);  if (t & BROUGHT_TO_TOP)    partBroughtToTop += Delegate(l.GetPointer(), &IPartListener::PartBroughtToTop);  if (t & CLOSED)    partClosed += Delegate(l.GetPointer(), &IPartListener::PartClosed);  if (t & DEACTIVATED)    partDeactivated += Delegate(l.GetPointer(), &IPartListener::PartDeactivated);  if (t & OPENED)    partOpened += Delegate(l.GetPointer(), &IPartListener::PartOpened);  if (t & HIDDEN)    partHidden += Delegate(l.GetPointer(), &IPartListener::PartHidden);  if (t & VISIBLE)    partVisible += Delegate(l.GetPointer(), &IPartListener::PartVisible);  if (t & INPUT_CHANGED)    partInputChanged += Delegate(l.GetPointer(), &IPartListener::PartInputChanged);}
开发者ID:AGrafmint,项目名称:MITK,代码行数:25,


示例12: Delegate

void UBGraphicsPathItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event){    if(mMultiClickState == 0){        Delegate()->mouseMoveEvent(event);        UBAbstractGraphicsPathItem::mouseMoveEvent(event);    }}
开发者ID:fincom,项目名称:Sankore-3.1,代码行数:7,


示例13: prepareGeometryChange

void UBEditableGraphicsRegularShapeItem::updateHandle(UBAbstractHandle *handle){    prepareGeometryChange();    Delegate()->showFrame(false);    QPointF diff = handle->pos() - path().boundingRect().topLeft();    qreal maxSize = handle->radius() * 4;    if(diff.x() < maxSize) {        handle->setX(handle->pos().x() + (maxSize - diff.x()));    }    if(diff.y() < maxSize) {        handle->setY(handle->pos().y() + (maxSize - diff.y()));    }    updatePath(handle->pos());    if(hasGradient()) {        QLinearGradient g(path().boundingRect().topLeft(), path().boundingRect().topRight());        g.setColorAt(0, brush().gradient()->stops().at(0).second);        g.setColorAt(1, brush().gradient()->stops().at(1).second);        setBrush(g);    }}
开发者ID:hethi,项目名称:Sankore-3.1,代码行数:30,


示例14: QGraphicsPixmapItem

UBGraphicsPixmapItem::UBGraphicsPixmapItem(QGraphicsItem* parent)    : QGraphicsPixmapItem(parent){    setDelegate(new UBGraphicsItemDelegate(this, 0, true, false, true, true));    Delegate()->init();    Delegate()->setFlippable(true);    Delegate()->setRotatable(true);    setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object);    setTransformationMode(Qt::SmoothTransformation);    setData(UBGraphicsItemData::itemLayerType, QVariant(itemLayerType::ObjectItem)); //Necessary to set if we want z value to be assigned correctly    setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);    setUuid(QUuid::createUuid()); //more logical solution is in creating uuid for element in element's constructor}
开发者ID:Ascaf0,项目名称:Sankore-3.1,代码行数:16,


示例15: Delegate

void UBAbstractEditableGraphicsShapeItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event){    if(mMultiClickState == 0){        Delegate()->mouseMoveEvent(event);        UBAbstractGraphicsItem::mouseMoveEvent(event);    }}
开发者ID:hethi,项目名称:Sankore-3.1,代码行数:7,


示例16: XO

bool EffectChangePitch::Process(){#if USE_SBSMS   if (mUseSBSMS)   {      double pitchRatio = 1.0 + m_dPercentChange / 100.0;      EffectSBSMS proxy;      proxy.mProxyEffectName = XO("High Quality Pitch Change");      proxy.setParameters(1.0, pitchRatio);      return Delegate(proxy, mUIParent, false);   }   else#endif   {      mSoundTouch = std::make_unique<SoundTouch>();      IdentityTimeWarper warper;      mSoundTouch->setPitchSemiTones((float)(m_dSemitonesChange));#ifdef USE_MIDI      // Pitch shifting note tracks is currently only supported by SoundTouchEffect      // and non-real-time-preview effects require an audio track selection.      //      // Note: m_dSemitonesChange is private to ChangePitch because it only      // needs to pass it along to mSoundTouch (above). I added mSemitones      // to SoundTouchEffect (the super class) to convey this value      // to process Note tracks. This approach minimizes changes to existing      // code, but it would be cleaner to change all m_dSemitonesChange to      // mSemitones, make mSemitones exist with or without USE_MIDI, and      // eliminate the next line:      mSemitones = m_dSemitonesChange;#endif      return EffectSoundTouch::ProcessWithTimeWarper(warper);   }}
开发者ID:MindFy,项目名称:audacity,代码行数:34,


示例17: Delegate

void ClothDemo::InitializeDebugGui(){	stiffness = 1;	restlength = 3;	tearlength = 10;	frameSolvesPerFrame = 1;	this->gridDisplay->ClickAndDrag = true;	VerticalDebugMenu::WatchFloatSlider("Rest Length", &restlength, 0.5f, 10.0f);	VerticalDebugMenu::WatchFloatSlider("Stiffness", &stiffness, 0.0f, 1.25f);	VerticalDebugMenu::WatchFloatSlider("Solves/Frame", &frameSolvesPerFrame, 1, 4);	Delegate f = Delegate();	f.bind(this, &ClothDemo::ResetParticles);	VerticalDebugMenu::WatchButton("Reset", f);		for(uint r = 0; r < DIMENSION; r++)	{		for(uint c = 0; c < DIMENSION; c++)		{			points[r][c] = ClothP();			if(r > 0) links_up[r][c] = ClothLink(&points[r - 1][c], &points[r][c], &restlength, &tearlength, &stiffness);			if(c > 0) links_left[r][c] = ClothLink(&points[r][c - 1], &points[r][c], &restlength, &tearlength, &stiffness);			DemoWindow::WatchPoint(&points[r][c].position, &points[r][c].imass, Qt::red);		}	}	ResetParticles();}
开发者ID:kevinteynor,项目名称:bsgd_engine,代码行数:33,


示例18: setDefaultTextColor

void UBGraphicsTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget){    QColor color = UBSettings::settings()->isDarkBackground() ? mColorOnDarkBackground : mColorOnLightBackground;    setDefaultTextColor(color);    // Never draw the rubber band, we draw our custom selection with the DelegateFrame    QStyleOptionGraphicsItem styleOption = QStyleOptionGraphicsItem(*option);    styleOption.state &= ~QStyle::State_Selected;    styleOption.state &= ~QStyle::State_HasFocus;    QGraphicsTextItem::paint(painter, &styleOption, widget);    if (widget == UBApplication::boardController->controlView()->viewport() &&            !isSelected() && toPlainText().isEmpty())    {        QFontMetrics fm(font());        setTextWidth(fm.width(mTypeTextHereLabel));        painter->setFont(font());        painter->setPen(UBSettings::paletteColor);        painter->drawText(boundingRect(), Qt::AlignCenter, mTypeTextHereLabel);        setTextInteractionFlags(Qt::NoTextInteraction);    }    Delegate()->postpaint(painter, option, widget);}
开发者ID:zhgn,项目名称:OpenBoard,代码行数:25,


示例19: UBEditableGraphicsPolygonItem

UBEditableGraphicsLineItem::UBEditableGraphicsLineItem(QGraphicsItem* parent)    : UBEditableGraphicsPolygonItem(parent){    // Line has Stroke and Fill capabilities :    Delegate()->setCanReturnInCreationMode(false);    initializeStrokeProperty();    initializeFillingProperty();    UBFreeHandle *startHandle = new UBFreeHandle;    UBFreeHandle *endHandle = new UBFreeHandle;    endHandle->setId(1);    startHandle->setParentItem(this);    endHandle->setParentItem(this);    startHandle->setEditableObject(this);    endHandle->setEditableObject(this);    startHandle->hide();    endHandle->hide();    mHandles.push_back(startHandle);    mHandles.push_back(endHandle);    mIsMagnetic = true;}
开发者ID:lanxiaziyi,项目名称:Sankore-3.1,代码行数:27,


示例20: UBGraphicsItemPlayAudioAction

void UBGraphicsPathItem::copyItemParameters(UBItem *copy) const{    UBGraphicsPathItem *cp = dynamic_cast<UBGraphicsPathItem*>(copy);    if (cp)    {        cp->setPath(QPainterPath(this->path()));        cp->setTransform(this->transform());        cp->setTransformOriginPoint(this->transformOriginPoint());        cp->setFlag(QGraphicsItem::ItemIsMovable, true);        cp->setFlag(QGraphicsItem::ItemIsSelectable, true);        cp->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType));        cp->setData(UBGraphicsItemData::ItemLocked, this->data(UBGraphicsItemData::ItemLocked));        cp->setFlag(QGraphicsItem::ItemIsFocusable, true);        if(Delegate()->action()){            if(Delegate()->action()->linkType() == eLinkToAudio){                UBGraphicsItemPlayAudioAction* audioAction = dynamic_cast<UBGraphicsItemPlayAudioAction*>(Delegate()->action());                UBGraphicsItemPlayAudioAction* action = new UBGraphicsItemPlayAudioAction(audioAction->fullPath());                cp->Delegate()->setAction(action);            }            else                cp->Delegate()->setAction(Delegate()->action());        }        if (hasFillingProperty())            cp->mFillingProperty = new UBFillProperty(*fillingProperty());        if (hasStrokeProperty())            cp->mStrokeProperty = new UBStrokeProperty(*strokeProperty());        cp->mClosed = this->mClosed;        for(int i = 0; i < mHandles.size(); i++){            UBFreeHandle *handle = new UBFreeHandle();            handle->setParentItem(cp);            handle->setEditableObject(cp);            handle->setPos(mHandles.at(i)->pos());            handle->setId(mHandles.at(i)->getId());            handle->hide();            cp->mHandles.push_back(handle);        }    }}
开发者ID:fincom,项目名称:Sankore-3.1,代码行数:47,


示例21: Delegate

voidICommandCategoryListener::Events::RemoveListener(ICommandCategoryListener* l){  if (l == nullptr) return;  categoryChanged -= Delegate(l, &ICommandCategoryListener::CategoryChanged);}
开发者ID:151706061,项目名称:MITK,代码行数:8,


示例22: Delegate

voidISelectionListener::Events::RemoveListener(ISelectionListener::Pointer listener){  if (listener.IsNull()) return;  this->selectionChanged -= Delegate(listener.GetPointer(), &ISelectionListener::SelectionChanged);}
开发者ID:david-guerrero,项目名称:MITK,代码行数:8,


示例23: Delegate

voidISelectionChangedListener::Events::AddListener(ISelectionChangedListener* listener){  if (listener == nullptr) return;  this->selectionChanged += Delegate(listener, &ISelectionChangedListener::SelectionChanged);}
开发者ID:151706061,项目名称:MITK,代码行数:8,


示例24: Delegate

voidICommandListener::Events::RemoveListener(ICommandListener::Pointer l){  if (l.IsNull()) return;  commandChanged -= Delegate(l.GetPointer(), &ICommandListener::CommandChanged);}
开发者ID:david-guerrero,项目名称:MITK,代码行数:8,


示例25: Delegate

voidIPropertyChangeListener::Events::RemoveListener(IPropertyChangeListener::Pointer listener){  if (listener.IsNull()) return;  this->propertyChange -= Delegate(listener.GetPointer(), &IPropertyChangeListener::PropertyChange);}
开发者ID:AGrafmint,项目名称:MITK,代码行数:8,


示例26: Delegate

voidIHandlerListener::Events::RemoveListener(IHandlerListener::Pointer l){  if (l.IsNull()) return;  handlerChanged -= Delegate(l.GetPointer(), &IHandlerListener::HandlerChanged);}
开发者ID:test-fd301,项目名称:MITK,代码行数:8,


示例27: Delegate

voidISelectionListener::Events::RemoveListener(ISelectionListener* listener){  if (listener == NULL) return;  this->selectionChanged -= Delegate(listener, &ISelectionListener::SelectionChanged);}
开发者ID:ghisvail,项目名称:MITK,代码行数:8,


示例28: IMenuPage

SpecialsMenuPage::SpecialsMenuPage(Menu *menu, SaveGameManager *savedGames) : IMenuPage(menu){	this->menu = menu;	this->savedGames = savedGames;	this->backButton = new Input_Button();	if(AppConfig::Instance().IsIpad())		backButton->SetSpriteAndBounds(12, 15, CR::AssetList::specials_backButton);	else		backButton->SetSpriteAndBounds(12, 11, CR::AssetList::specials_backButton);	if(AppConfig::Instance().IsIpad())		backButton->DesignSize(69,30);	backButton->SetSoundOn(true);	input_objects.push_back(backButton);	showSelectionSprite = false;	selectionSprite = graphics_engine->CreateSprite1();	selectionSprite->SetImage(CR::AssetList::specials_selector);	if(AppConfig::Instance().IsIpad())		selectionSprite->SetDesignSize(456,31);	medalFontSprite = graphics_engine->CreateSprite1();	medalFontSprite->SetImage(CR::AssetList::SpecialMedalFont);	if(AppConfig::Instance().IsIpad())		medalFontSprite->SetDesignSize(12,11);	// Survival Run (Unlocked)	survivalRunUnlockedSprite = graphics_engine->CreateSprite1();	survivalRunUnlockedSprite->SetPositionAbsalute(10,10);	survivalRunUnlockedSprite->SetImage(CR::AssetList::specials_lockedUnlockedTag);	this->showSurvivalRunUnlockedSprite = savedGames->GetSaveGameInfo().bonusInfo.BonusLevel1;	if(AppConfig::Instance().IsIpad())		survivalRunUnlockedSprite->SetDesignSize(98,8);	// Speed Boost (Toggle)	speedBoostToggle = new Input_Toggle();	speedBoostToggle->SetSprite(CR::AssetList::options_on_off);	if(AppConfig::Instance().IsIpad())		speedBoostToggle->SetPosition(417, 103);	else		speedBoostToggle->SetPosition(407, 105);	speedBoostToggle->SetTouchBounds(0, 91, 480, 30);	speedBoostToggle->OnToggled += Delegate(this, &SpecialsMenuPage::OnToggledSpeedBoost);	speedBoostToggle->ToggleOn(savedGames->GetSaveGameInfo().bonusToggles[1]);	speedBoostToggle->SetSoundOn(true);	if(AppConfig::Instance().IsIpad())		speedBoostToggle->DesignSize(65,10);	input_objects.push_back(speedBoostToggle);	//gamerGirlToggle = new Input_Toggle();	//gamerGirlToggle->SetSprite(CR::AssetList::options_on_off);	//gamerGirlToggle->SetPosition(405, 300);	//gamerGirlToggle->SetTouchBounds(360, 115, 90, 58);	//gamerGirlToggle->OnToggled += Delegate(this, &SpecialsMenuPage::OnToggledGamerGirl);	//gamerGirlToggle->ToggleOn(settingsInfo.musicOn);	//gamerGirlToggle->SetSoundOn(true);	//input_objects.push_back(gamerGirlToggle);}
开发者ID:shoematt,项目名称:BladeofBetrayal,代码行数:58,



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


C++ DeleteAll函数代码示例
C++ DelayUs函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。