本文整理汇总了C++中setAcceptsHoverEvents函数的典型用法代码示例。如果您正苦于以下问题:C++ setAcceptsHoverEvents函数的具体用法?C++ setAcceptsHoverEvents怎么用?C++ setAcceptsHoverEvents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAcceptsHoverEvents函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:AOSC-Dev,项目名称:qtpanel,代码行数:15,代码来源:applet.cpp
示例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);
}
开发者ID:honsey,项目名称:fztaxedit,代码行数:35,代码来源:stripboard.cpp
示例3: QGraphicsObject
STStatusUserNameView::STStatusUserNameView(QGraphicsItem *parent) :
QGraphicsObject(parent)
{
setCacheMode(DeviceCoordinateCache);
setAcceptsHoverEvents(true);
}
开发者ID:yvt,项目名称:StellaAlpha,代码行数:7,代码来源:ststatususernameview.cpp
示例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();
}
开发者ID:SorinS,项目名称:fop-miniscribus,代码行数:31,代码来源:GraphicsItemEdit.cpp
示例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();
}
开发者ID:mcfrisk,项目名称:kdenlive,代码行数:25,代码来源:guide.cpp
示例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();
}
开发者ID:kehugter,项目名称:Yarock,代码行数:39,代码来源:stream_item.cpp
示例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;
}
开发者ID:jasons8021,项目名称:POSD_ERDiagram,代码行数:7,代码来源:ItemAttribute.cpp
示例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;
}
开发者ID:kehugter,项目名称:Yarock,代码行数:36,代码来源:file_graphicitem.cpp
示例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);
}
开发者ID:djfm,项目名称:CuteSEQ,代码行数:7,代码来源:cell.cpp
示例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();
}
开发者ID:Akira586,项目名称:Cockatrice,代码行数:33,代码来源:abstractcounter.cpp
示例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);
}
开发者ID:BackupTheBerlios,项目名称:flogging,代码行数:8,代码来源:bar.cpp
示例12: QGraphicsItem
// ============================================================================
// Constructor
EditorPoint::EditorPoint(QGraphicsItem* parent)
: QGraphicsItem(parent)
{
setFlags( QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIgnoresTransformations );
setAcceptsHoverEvents( true );
_hover = false;
setZValue( 10.0 ); // some hgih value
}
开发者ID:wot123,项目名称:flyer2d,代码行数:10,代码来源:editorpoint.cpp
示例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);
}
开发者ID:FrozenFeather,项目名称:QSanguoshaForDadao,代码行数:9,代码来源:qsanbutton.cpp
示例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();
}
开发者ID:BIbiLion,项目名称:LSWuqiankun,代码行数:9,代码来源:eobject.cpp
示例15: connect
void InternalToolBox::init()
{
if (m_containment) {
connect(m_containment, SIGNAL(immutabilityChanged(Plasma::ImmutabilityType)),
this, SLOT(immutabilityChanged(Plasma::ImmutabilityType)));
}
setAcceptsHoverEvents(true);
}
开发者ID:walac,项目名称:kde-workspace,代码行数:9,代码来源:internaltoolbox.cpp
示例16: QGraphicsObject
STClearButtonView::STClearButtonView(QGraphicsItem *parent) :
QGraphicsObject(parent),m_size(0,0),
m_drag(false),m_hover(false)
{
setFlag(ItemHasNoContents);
setAcceptsHoverEvents(true);
m_item=new QGraphicsPixmapItem(this);
}
开发者ID:yvt,项目名称:StellaAlpha,代码行数:9,代码来源:stclearbuttonview.cpp
示例17: CardZone
PileZone::PileZone(Player *_p, const QString &_name, bool _isShufflable, bool _contentsKnown, QGraphicsItem *parent)
: CardZone(_p, _name, false, _isShufflable, _contentsKnown, parent)
{
setCacheMode(DeviceCoordinateCache); // Do not move this line to the parent constructor!
setAcceptsHoverEvents(true);
setCursor(Qt::OpenHandCursor);
setTransform(QTransform().translate((float) CARD_WIDTH / 2, (float) CARD_HEIGHT / 2).rotate(90).translate((float) -CARD_WIDTH / 2, (float) -CARD_HEIGHT / 2));
}
开发者ID:BeardAnnihilator,项目名称:Cockatrice,代码行数:9,代码来源:pilezone.cpp
示例18: AbstractCardItem
DeckViewCard::DeckViewCard(const QString &_name, const QString &_originZone, QGraphicsItem *parent)
: AbstractCardItem(_name, 0, -1, parent), originZone(_originZone), dragItem(0)
{
#if QT_VERSION < 0x050000
setAcceptsHoverEvents(true);
#else
setAcceptHoverEvents(true);
#endif
}
开发者ID:DINKIN,项目名称:Cockatrice,代码行数:9,代码来源:deckview.cpp
示例19: setZValue
Chip::Chip(const QColor &color, int x, int y)
{
this->x = x;
this->y = y;
this->color = color;
setZValue((x + y) % 2);
setFlags(ItemIsSelectable | ItemIsMovable);
setAcceptsHoverEvents(true);
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:10,代码来源:chip.cpp
示例20: m_svg
BusyWidget::BusyWidget(Plasma::PopupApplet* parent)
: Plasma::BusyWidget(parent),
m_svg(new Plasma::Svg(this))
{
setAcceptsHoverEvents(true);
m_svg->setImagePath("icons/notification");
m_svg->setContainsMultipleImages(true);
setRunning(false);
}
开发者ID:KDE,项目名称:notificationsurvey,代码行数:10,代码来源:busywidget.cpp
注:本文中的setAcceptsHoverEvents函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论