本文整理汇总了C++中setAcceptsHoverEvents函数的典型用法代码示例。如果您正苦于以下问题:C++ setAcceptsHoverEvents函数的具体用法?C++ setAcceptsHoverEvents怎么用?C++ setAcceptsHoverEvents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAcceptsHoverEvents函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAcceptsHoverEvents
void Applet::setInteractive(bool interactive)
{
m_interactive = interactive;
if(m_interactive)
{
setAcceptsHoverEvents(true);
setAcceptedMouseButtons(Qt::RightButton | Qt::LeftButton);
}
else
{
setAcceptsHoverEvents(false);
setAcceptedMouseButtons(Qt::RightButton);
}
}
示例2: QGraphicsPathItem
Stripbit::Stripbit(const QPainterPath & path, ConnectorItem * connectorItem, int x, int y, QGraphicsItem * parent = 0)
: QGraphicsPathItem(path, parent)
{
if (SpotFaceCutterCursor == NULL) {
QBitmap bitmap(":resources/images/cursor/spot_face_cutter.bmp");
QBitmap bitmapm(":resources/images/cursor/spot_face_cutter_mask.bmp");
SpotFaceCutterCursor = new QCursor(bitmap, bitmapm, 0, 0);
}
if (MagicWandCursor == NULL) {
QBitmap bitmap(":resources/images/cursor/magic_wand.bmp");
QBitmap bitmapm(":resources/images/cursor/magic_wand_mask.bmp");
MagicWandCursor = new QCursor(bitmap, bitmapm, 0, 0);
}
setZValue(-999); // beneath connectorItems
setPen(Qt::NoPen);
// TODO: don't hardcode this color
setBrush(QColor(0xbc, 0x94, 0x51)); // QColor(0xc4, 0x9c, 0x59)
m_right = NULL;
m_x = x;
m_y = y;
m_connectorItem = connectorItem;
m_inHover = m_removed = false;
setAcceptsHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, false);
}
示例3: QGraphicsObject
STStatusUserNameView::STStatusUserNameView(QGraphicsItem *parent) :
QGraphicsObject(parent)
{
setCacheMode(DeviceCoordinateCache);
setAcceptsHoverEvents(true);
}
示例4: QGraphicsItem
TextLayer::TextLayer(const int layer_id , QGraphicsItem *parent , QGraphicsScene *scene )
: QGraphicsItem(parent,scene),evesum(0),modus(Show),border(1.),currentprintrender(false),
hi(Metric("30px")),wi(Metric("110px")),bgcolor(QColor(Qt::white)),SwapLockBreak(false),
bordercolor(QColor(Qt::red)),Rotate(0),check_view_area_time(0),ActionHover(false),
format(DIV_ABSOLUTE),mount(new TextController)
{
mount->q = this;
setAcceptsHoverEvents(true);
wisub_border = wi + border;
history.clear();
id = layer_id;
setAcceptDrops(true);
setFlag(QGraphicsItem::ItemIsSelectable,true);
setFlag(QGraphicsItem::ItemIsFocusable,true);
setFlag(QGraphicsItem::ItemIsMovable,false);
setSelected(false);
_doc = new QTextDocument();
_doc->setHtml(tr("<p>Write your text<p>"));
QTextFrame *Tframe = _doc->rootFrame();
QTextFrameFormat rootformats = Tframe->frameFormat();
rootformats.setWidth(wi);
rootformats.setBorder(0);
Tframe->setFrameFormat(rootformats);
_doc->setPageSize(QSizeF(wi,hi));
DLayout = _doc->documentLayout();
setDocument(_doc);
mount->txtControl()->document()->toHtml().size(); /* connect all */
setZValue(1.99999);
RestoreMoveAction();
init();
}
示例5: QGraphicsLineItem
Guide::Guide(CustomTrackView *view, GenTime pos, QString label, double height) :
QGraphicsLineItem(),
m_position(pos),
m_label(label),
m_view(view),
m_pen(QPen())
{
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIgnoresTransformations);
#if QT_VERSION >= 0x040600
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
#endif
setToolTip(label);
setLine(0, 0, 0, height);
if (m_position < GenTime()) m_position = GenTime();
setPos(m_position.frames(m_view->fps()), 0);
m_pen.setWidthF(0);
m_pen.setColor(QColor(0, 0, 200, 180));
//m_pen.setCosmetic(true);
setPen(m_pen);
setZValue(999);
setAcceptsHoverEvents(true);
const QFontMetrics metric = m_view->fontMetrics();
m_width = metric.width(' ' + m_label + ' ') + 2;
prepareGeometryChange();
}
示例6: setAcceptsHoverEvents
/*
********************************************************************************
* *
* StreamGraphicItem *
* -> with image *
* *
********************************************************************************
*/
StreamGraphicItem::StreamGraphicItem()
{
#if QT_VERSION < 0x050000
setAcceptsHoverEvents(true);
#else
setAcceptHoverEvents(true);
#endif
setAcceptDrops(false);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsMovable, false);
setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
//! option configuration
opt.widget = 0;
opt.palette = QApplication::palette();
opt.font = QApplication::font();
opt.font.setStyleStrategy(QFont::PreferAntialias);
opt.fontMetrics = QFontMetrics(opt.font);
opt.showDecorationSelected = true;
opt.decorationPosition = QStyleOptionViewItem::Left;
opt.decorationAlignment = Qt::AlignCenter;
opt.displayAlignment = Qt::AlignLeft|Qt::AlignVCenter;
opt.locale.setNumberOptions(QLocale::OmitGroupSeparator);
opt.state |= QStyle::State_Active;
opt.state |= QStyle::State_Enabled;
opt.state &= ~QStyle::State_Selected;
opt.rect = boundingRect().toRect();
}
示例7: ItemNode
ItemAttribute::ItemAttribute( int erModelID, int sx, int sy, QString attributeText ) : ItemNode( erModelID, sx, sy, PARAMETER_ATTRIBUTE, attributeText )
{
setPath();
setFlags(QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsMovable);
setAcceptsHoverEvents(true);
_isPrimaryKey = false;
}
示例8: setAcceptsHoverEvents
/*
********************************************************************************
* *
* DirectoryGraphicItem *
* *
********************************************************************************
*/
DirectoryGraphicItem::DirectoryGraphicItem()
{
#if QT_VERSION < 0x050000
setAcceptsHoverEvents(true);
#else
setAcceptHoverEvents(true);
#endif
setAcceptDrops(false);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsMovable, false);
setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
//! option configuration
opt.widget = 0;
opt.palette = QApplication::palette();
opt.font = QApplication::font();
opt.fontMetrics = QFontMetrics(opt.font);
opt.showDecorationSelected = true;
opt.decorationPosition = QStyleOptionViewItem::Top;
opt.displayAlignment = Qt::AlignCenter;
opt.locale.setNumberOptions(QLocale::OmitGroupSeparator);
opt.state |= QStyle::State_Active;
opt.state |= QStyle::State_Enabled;
opt.state &= ~QStyle::State_Selected;
isSymbLink = false;
}
示例9: _scene
Cell::Cell(ChunkScene *scene, int row, int col, int x, int y, int w, int h, const QString ¬e_name, QColor bg)
:QGraphicsRectItem(x,y,w,h), _scene(scene), _row(row), _col(col), _note_name(note_name), _bg(bg)
{
setPen(QPen(QColor(210,210,210)));
setBrush(QBrush(_bg));
setAcceptsHoverEvents(true);
}
示例10: QGraphicsItem
AbstractCounter::AbstractCounter(Player *_player, int _id, const QString &_name, bool _shownInCounterArea, int _value, QGraphicsItem *parent)
: QGraphicsItem(parent), player(_player), id(_id), name(_name), value(_value), hovered(false), aDec(0), aInc(0), dialogSemaphore(false), deleteAfterDialog(false), shownInCounterArea(_shownInCounterArea)
{
#if QT_VERSION < 0x050000
setAcceptsHoverEvents(true);
#else
setAcceptHoverEvents(true);
#endif
if (player->getLocal()) {
menu = new QMenu(name);
aSet = new QAction(this);
connect(aSet, SIGNAL(triggered()), this, SLOT(setCounter()));
menu->addAction(aSet);
menu->addSeparator();
for (int i = -10; i <= 10; ++i)
if (i == 0)
menu->addSeparator();
else {
QAction *aIncrement = new QAction(QString(i < 0 ? "%1" : "+%1").arg(i), this);
if (i == -1)
aDec = aIncrement;
else if (i == 1)
aInc = aIncrement;
aIncrement->setData(i);
connect(aIncrement, SIGNAL(triggered()), this, SLOT(incrementCounter()));
menu->addAction(aIncrement);
}
} else
menu = 0;
retranslateUi();
}
示例11: m_block
BarText::BarText (BlockInfo & bi, QColor const & color, int x, int y, int w, int h, int tid, int tid_offs)
: m_block(bi)
, m_x(x), m_y(y), m_w(w), m_h(h), m_color(color)
, m_tid(tid), m_tid_offs(tid_offs)
{
setZValue((x + y) % 2);
setAcceptsHoverEvents(true);
}
示例12: QGraphicsItem
// ============================================================================
// Constructor
EditorPoint::EditorPoint(QGraphicsItem* parent)
: QGraphicsItem(parent)
{
setFlags( QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIgnoresTransformations );
setAcceptsHoverEvents( true );
_hover = false;
setZValue( 10.0 ); // some hgih value
}
示例13: QGraphicsObject
QSanButton::QSanButton(QGraphicsItem *parent): QGraphicsObject(parent)
{
_m_state = S_STATE_UP;
_m_style = S_STYLE_PUSH;
_m_mouseEntered = false;
setSize(QSize(0, 0));
setAcceptsHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
}
示例14: QGraphicsItem
EObject::EObject(qreal w,qreal h,qreal m, QGraphicsItem *parent)
:width(w),height(h),margin(m), QGraphicsItem(parent)
{
setAcceptDrops(true);
setAcceptsHoverEvents(true);
setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable);
createResizeFocus();
}
示例15: connect
void InternalToolBox::init()
{
if (m_containment) {
connect(m_containment, SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)),
this, SLOT(immutabilityChanged(Plasma::ImmutabilityType)));
}
setAcceptsHoverEvents(true);
}