本文整理汇总了C++中setAcceptHoverEvents函数的典型用法代码示例。如果您正苦于以下问题:C++ setAcceptHoverEvents函数的具体用法?C++ setAcceptHoverEvents怎么用?C++ setAcceptHoverEvents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAcceptHoverEvents函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QGraphicsWidget
ProgressLabel::ProgressLabel(QGraphicsWidget *parent)
: QGraphicsWidget(parent),
m_progress(0)
{
setAcceptDrops(false);
setAcceptHoverEvents(false);
setAcceptedMouseButtons(false);
init_paint_options();
}
示例2: QGraphicsItem
IconBase::IconBase(QGraphicsItem * parent)
: QGraphicsItem(parent),
m_highlight(false),
m_launchMode(DesktopPlugin::SingleClick)
{
// not yet setFlag(QGraphicsItem::ItemIsMovable);
setAcceptHoverEvents(true);
setCursor(Qt::PointingHandCursor);
}
示例3: setZValue
Chip::Chip(int x, int y)//新建“障碍物”item函数
{
this->x = x;//确定新建item的坐标x
this->y = y;//确定新建item的坐标y
this->color = color;//选择颜色
setZValue((x + y) % 2);//确定该item位于scene的层数
setFlags(ItemIsSelectable | ItemIsMovable);//障碍物item可被选中和可移动
setAcceptHoverEvents(true);//可以接受外部事件,例如鼠标点击
}
示例4: TextureRendererItem
VideoRendererItem::VideoRendererItem(QQuickItem *parent)
: TextureRendererItem(parent), d(new Data(this)) {
setFlag(ItemAcceptsDrops, true);
d->mposd = new MpOsdItem(this);
d->letterbox = new LetterboxItem(this);
setZ(-1);
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::AllButtons);
}
示例5: Handle
Handle(QGraphicsItem *parent = 0)
: QGraphicsItem(parent)
, mUnderMouse(false)
{
setFlags(QGraphicsItem::ItemIgnoresTransformations |
QGraphicsItem::ItemIgnoresParentOpacity);
setAcceptHoverEvents(true);
setCursor(Qt::ArrowCursor);
}
示例6: setFlag
GraphicsWidgetBase::GraphicsWidgetBase() {
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsFocusable, true);
setAcceptHoverEvents(true);
#if(QT_VERSION >= QT_VERSION_CHECK(4,5,0))
setOpacity(0.8);
#endif
}
示例7: QQuickItem
MaskedMouseArea::MaskedMouseArea(QQuickItem *parent)
: QQuickItem(parent),
m_pressed(false),
m_alphaThreshold(0.0),
m_containsMouse(false)
{
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
}
示例8: GridSnap
Pinhead::Pinhead(QGraphicsItem *parent, QPoint p, int pointIndex, JunctionStyle style) :
GridSnap(GS120), pointIndex(pointIndex), style(JunctionStyleUnknown)
{
setParentItem(parent);
setPos(p.x(), p.y());
setJunction(style);
// setFlags(ItemStacksBehindParent);
setAcceptHoverEvents(true);
}
示例9: arrowSize_
Edge::Edge(NodeGui *src, NodeGui *tar)
:srcN_(src),tarN_(tar), arrowSize_(5), fixedColor_(false), edgeColor_(Qt::black),lineStyle_(Qt::SolidLine)
{
setCursor(Qt::ArrowCursor);
setAcceptHoverEvents(true);
src->addEdge(this);
tar->addEdge(this);
adjust();
}
示例10: m_priv_ptr
DefaultTableComponent::DefaultTableComponent(const QRectF &a_rect,
LayoutType type,
QGraphicsItem *parent)
: UIKit::TableViewItem(a_rect, parent),
m_priv_ptr(new PrivateTableComponent) {
m_priv_ptr->m_current_geometry = a_rect;
m_priv_ptr->m_current_item_selection = false;
m_priv_ptr->m_current_item_visibility = true;
m_priv_ptr->m_current_layout_type = type;
m_priv_ptr->m_layout_base = new QGraphicsWidget(this);
m_priv_ptr->m_layout_base->setGeometry(a_rect);
m_priv_ptr->m_linear_layout =
new QGraphicsLinearLayout(m_priv_ptr->m_layout_base);
m_priv_ptr->m_image_view_widget =
new UIKit::ImageView(m_priv_ptr->m_layout_base);
m_priv_ptr->m_image_view_widget->set_pixmap(
UIKit::Theme::instance()->drawable("setup-wizard.png", "hdpi"));
m_priv_ptr->m_label_widget = new UIKit::Label(m_priv_ptr->m_layout_base);
m_priv_ptr->m_option_button = new UIKit::Button(m_priv_ptr->m_layout_base);
connect(m_priv_ptr->m_image_view_widget, SIGNAL(clicked()), this,
SLOT(onClicked()));
connect(m_priv_ptr->m_label_widget, SIGNAL(clicked()), this,
SLOT(onClicked()));
connect(m_priv_ptr->m_option_button, SIGNAL(clicked()), this,
SLOT(onClicked()));
if (type == kGridLayout) {
m_priv_ptr->m_linear_layout->setOrientation(Qt::Vertical);
m_priv_ptr->m_linear_layout->addItem(m_priv_ptr->m_image_view_widget);
m_priv_ptr->m_linear_layout->addItem(m_priv_ptr->m_label_widget);
m_priv_ptr->m_linear_layout->addItem(m_priv_ptr->m_option_button);
m_priv_ptr->m_label_widget->set_size(QSize(64, a_rect.height()));
m_priv_ptr->m_option_button->hide();
} else {
m_priv_ptr->m_label_widget->set_size(QSize(150, a_rect.height()));
// d->m_image_view_widget->setSize(QSizeF(48.0, 48.0));
m_priv_ptr->m_linear_layout->setOrientation(Qt::Horizontal);
m_priv_ptr->m_linear_layout->addItem(m_priv_ptr->m_image_view_widget);
m_priv_ptr->m_linear_layout->addItem(m_priv_ptr->m_label_widget);
m_priv_ptr->m_linear_layout->addItem(m_priv_ptr->m_option_button);
}
setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton);
setFlag(QGraphicsItem::ItemIsMovable, false);
setFlag(QGraphicsItem::ItemIsFocusable, true);
setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
setFiltersChildEvents(false);
setAcceptTouchEvents(true);
setAcceptHoverEvents(true);
}
示例11: QGraphicsItem
GraphicsEdgeItem::GraphicsEdgeItem(QGraphicsItem *parent)
: QGraphicsItem(parent), Communicate()
, mHaveBorder(true)
{
setFlag(ItemSendsGeometryChanges);
setCacheMode(NoCache);
setAcceptHoverEvents(true);
}
示例12: _data
koregui::ShaderDataItem::ShaderDataItem(const kore::ShaderData* data,
QGraphicsItem* parent)
: _data(data),
_mouseover(false),
_op(NULL),
QGraphicsItem(parent) {
setAcceptHoverEvents(true);
setCursor(QCursor(Qt::CursorShape::PointingHandCursor));
}
示例13: ShapeAnnotation
PolygonAnnotation::PolygonAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent)
: ShapeAnnotation(graphicsView, pParent)
{
// initialize all fields with default values
initializeFields();
mIsCustomShape = true;
setAcceptHoverEvents(true);
connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}
示例14: QQuickItem
QQuickPinchArea::QQuickPinchArea(QQuickItem *parent)
: QQuickItem(*(new QQuickPinchAreaPrivate), parent)
{
Q_D(QQuickPinchArea);
d->init();
#ifdef Q_OS_OSX
setAcceptHoverEvents(true); // needed to enable touch events on mouse hover.
#endif
}
示例15: QGraphicsObject
QSanButton::QSanButton(QGraphicsItem *parent) : QGraphicsObject(parent)
{
_m_state = S_STATE_UP;
_m_style = S_STYLE_PUSH;
_m_mouseEntered = false;
setSize(QSize(0, 0));
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
}