本文整理汇总了C++中MouseEventWithHitTestResults::targetNode方法的典型用法代码示例。如果您正苦于以下问题:C++ MouseEventWithHitTestResults::targetNode方法的具体用法?C++ MouseEventWithHitTestResults::targetNode怎么用?C++ MouseEventWithHitTestResults::targetNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MouseEventWithHitTestResults
的用法示例。
在下文中一共展示了MouseEventWithHitTestResults::targetNode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: passWidgetMouseDownEventToWidget
bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
{
// Figure out which view to send the event to.
if (!event.targetNode() || !event.targetNode()->renderer() || !event.targetNode()->renderer()->isWidget())
return false;
return passMouseDownEventToWidget(toRenderWidget(event.targetNode()->renderer())->widget());
}
示例2: passWidgetMouseDownEventToWidget
bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
{
// Figure out which view to send the event to.
RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : nullptr;
if (!is<RenderWidget>(target))
return false;
return passMouseDownEventToWidget(downcast<RenderWidget>(*target).widget());
}
示例3: passWidgetMouseDownEventToWidget
bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
{
// Figure out which view to send the event to.
RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
if (!target || !target->isWidget())
return false;
return passMouseDownEventToWidget(static_cast<RenderWidget*>(target)->widget());
}
示例4: passMousePressEventToSubframe
bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
{
// If we're clicking into a frame that is selected, the frame will appear
// greyed out even though we're clicking on the selection. This looks
// really strange (having the whole frame be greyed out), so we deselect the
// selection.
IntPoint p = m_frame->view()->windowToContents(mev.event().pos());
if (m_frame->selection()->contains(p)) {
VisiblePosition visiblePos(
mev.targetNode()->renderer()->positionForPoint(mev.localPoint()));
Selection newSelection(visiblePos);
if (m_frame->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection);
}
subframe->eventHandler()->handleMousePressEvent(mev.event());
return true;
}
示例5: passSubframeEventToSubframe
bool FrameGdk::passSubframeEventToSubframe(MouseEventWithHitTestResults& mev, Frame*)
{
if (mev.targetNode() == 0)
return true;
return false;
}