ProgressLabel::ProgressLabel(QGraphicsWidget *parent)
    : QGraphicsWidget(parent),
    m_progress(0)
{
    setAcceptDrops(false);
    setAcceptHoverEvents(false);
    setAcceptedMouseButtons(false);
    init_paint_options();
}
Exemple #2
0
IconBase::IconBase(QGraphicsItem * parent)
    : QGraphicsItem(parent),
      m_highlight(false),
      m_launchMode(DesktopPlugin::SingleClick)
{
    // not yet setFlag(QGraphicsItem::ItemIsMovable);
    setAcceptHoverEvents(true);
    setCursor(Qt::PointingHandCursor);
}
Exemple #3
0
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);//可以接受外部事件,例如鼠标点击
}
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);
}
 Handle(QGraphicsItem *parent = 0)
     : QGraphicsItem(parent)
     , mUnderMouse(false)
 {
     setFlags(QGraphicsItem::ItemIgnoresTransformations |
              QGraphicsItem::ItemIgnoresParentOpacity);
     setAcceptHoverEvents(true);
     setCursor(Qt::ArrowCursor);
 }
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
}
MaskedMouseArea::MaskedMouseArea(QQuickItem *parent)
    : QQuickItem(parent),
      m_pressed(false),
      m_alphaThreshold(0.0),
      m_containsMouse(false)
{
    setAcceptHoverEvents(true);
    setAcceptedMouseButtons(Qt::LeftButton);
}
Exemple #8
0
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);
}
Exemple #9
0
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();
}
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);
}
GraphicsEdgeItem::GraphicsEdgeItem(QGraphicsItem *parent)
	: QGraphicsItem(parent), Communicate()
	, mHaveBorder(true)
{
	setFlag(ItemSendsGeometryChanges);
	setCacheMode(NoCache);
	setAcceptHoverEvents(true);

}
Exemple #12
0
koregui::ShaderDataItem::ShaderDataItem(const kore::ShaderData* data,
                                        QGraphicsItem* parent)
                                      : _data(data),
                                        _mouseover(false),
                                        _op(NULL),
                                        QGraphicsItem(parent) {
  setAcceptHoverEvents(true);
  setCursor(QCursor(Qt::CursorShape::PointingHandCursor));
}
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()));
}
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
}
Exemple #15
0
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);
}
Exemple #16
0
EPGItem::EPGItem( vlc_epg_event_t *data, EPGView *view )
    : m_view( view )
{
    setData( data );
    m_current = false;
    m_boundingRect.setHeight( TRACKS_HEIGHT );
    setFlags( QGraphicsItem::ItemIsSelectable | QGraphicsItem::ItemIsFocusable);
    setAcceptHoverEvents( true );
}
Exemple #17
0
void GpxBlock::unsetCursor()
{
  for (int i = 0; i < _inPorts.size(); i++) 
    _inPorts.at(i)->unsetCursor();
  for (int i = 0; i < _outPorts.size(); i++) 
    _outPorts.at(i)->unsetCursor();
  QGraphicsItem::unsetCursor();
  setAcceptHoverEvents(false);
}
LabelOverlayButton::LabelOverlayButton( QGraphicsItem *parent )
    : QGraphicsItem( parent ),
    m_iconEffect( 0 ),
    m_size( 8 )
{
    setAcceptHoverEvents( true );

    m_iconEffect = new KIconEffect();
}
Exemple #19
0
ItemBase::ItemBase(int size, int x, int y) : m_size(size), m_isResizing(false)
{
    setFlag(QGraphicsItem::ItemIsMovable, true);
    setFlag(QGraphicsItem::ItemIsSelectable, true);
    setFlag(QGraphicsItem::ItemIsFocusable, true);
    setAcceptHoverEvents(true);
    setPos(x, y);
    m_startTime = QTime::currentTime();
}
Exemple #20
0
QNEConnection::QNEConnection(QGraphicsItem *parent) : QGraphicsPathItem(parent)
{
    setPen(QPen(QColor(QRgb(0x2c3e50)), 3));
    setBrush(Qt::NoBrush);
    setZValue(-1);

    setAcceptHoverEvents(true);
    setAcceptTouchEvents(true);
}
Exemple #21
0
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
}
Exemple #22
0
MyPixmapItem::MyPixmapItem(const QPixmap &pixmap, QGraphicsItem *parentItem)
    : QGraphicsPixmapItem(pixmap, parentItem)
{
    setAcceptHoverEvents(true);
    setAcceptedMouseButtons(Qt::LeftButton);
    initFaceBoardPos();
    initEasyTextPos();
    easytext = Sanguosha->getChattingEasyTexts();
}
HandgripItem::HandgripItem(QObject *parentObject, QGraphicsItem *parentItem, int id, int type)
    : QObject(parentObject),
    QGraphicsPathItem(parentItem),
    m_opacityAnimation( new QPropertyAnimation(this, "opacity", this) ),
    m_moving(false),
    m_id(id),
    m_type(type)
{
    setAcceptHoverEvents(true);
    setFlag(QGraphicsItem::ItemIgnoresTransformations,true);

    QRadialGradient radialGrad(0,0,sizeMark,0,0);

    radialGrad.setColorAt( 0.0, QColor(200, 255, 255) );
    if (m_type == ROTATOR)
    {
        radialGrad.setColorAt( 0.0, QColor(255, 50, 0) );
        radialGrad.setColorAt( 1.0, QColor(255, 190, 0) );
    }
    else
    {
        radialGrad.setColorAt( 0.0, QColor(200, 255, 255) );
        radialGrad.setColorAt( 1.0, QColor(31, 197, 193) );
    }

    QBrush b(radialGrad);
    b.setStyle(Qt::RadialGradientPattern);

    QRectF r(0, 0, sizeMark, sizeMark);
    r.moveCenter( QPoint(0, 0) );
    QPainterPath p;
    p.addRoundedRect(r, cornerSize, cornerSize);

    setPath(p);
    setBrush(b);
    setPen( QPen(Qt::black) );

    QPen p2(Qt::red, 1);
    p2.setCosmetic(true);
    m_outerRing.setParentItem(this);
    m_outerRing.setRect( r.adjusted(-sizeMark / 2, -sizeMark / 2, sizeMark / 2, sizeMark / 2) );
    m_outerRing.setPen(p2 );
    m_outerRing.hide();

    // in order to
    connect( m_opacityAnimation,SIGNAL( finished () ),this,SLOT( checkVisibility() ) );

    // select a correct cursor from type
    if (m_type == TRANSLATOR_XY)
        QGraphicsItem::setCursor( QCursor(Qt::SizeAllCursor ) );
    else if (m_type == TRANSLATOR_Y)
        QGraphicsItem::setCursor( QCursor(Qt::SizeVerCursor ) );
    else if (m_type == TRANSLATOR_X)
        QGraphicsItem::setCursor( QCursor(Qt::SizeHorCursor ) );
    else
        QGraphicsItem::setCursor( QCursor( QPixmap(":/editor/editor/cursor_rotate.png") ) );
}
Exemple #24
0
ellipse::ellipse()
{
    mFirstClick = true;
    mSecondClick = false;
    mThirdClick = false;
    mPaintFlag = false;
    setFlags(ItemIsSelectable);
    setAcceptHoverEvents(true);
}
Exemple #25
0
NodeLabel::NodeLabel(Node * parent): QGraphicsObject(parent)
{
    // core only expands if you hover above it, not above the label
    setAcceptHoverEvents(false);
    // cache the label
    setCacheMode(DeviceCoordinateCache);
    // get the text from the node
    setText(parent->getDisplayName());
}
SAGraphicsTitleBarButton::SAGraphicsTitleBarButton(const QColor &color, QGraphicsItem *parent)
    : QGraphicsWidget(parent)
    , mBackgroundColor(color)
{
    setObjectName("theSAGraphicsTitleBarButton");

    setAcceptHoverEvents(true);
    setCacheMode(DeviceCoordinateCache);
}
Exemple #27
0
//-----------------------------------------------------------------------------
// Init
void MyIcon::init()
{
  
  setWindowFrameMargins(0,0,0,0);
  setCursor(Qt::PointingHandCursor);
  setAcceptHoverEvents(true);
  setCacheMode( QGraphicsItem::NoCache );
  
}
BitmapAnnotation::BitmapAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent)
  : ShapeAnnotation(graphicsView, pParent)
{
  // initialize all fields with default values
  initializeFields();
  mIsCustomShape = true;
  parseShapeAnnotation(shape, mpGraphicsView->mpParentProjectTab->mpParentProjectTabWidget->mpParentMainWindow->mpOMCProxy);
  setAcceptHoverEvents(true);
  connect(this, SIGNAL(updateShapeAnnotation()), mpGraphicsView, SLOT(addClassAnnotation()));
}
/*!
    Constructs an empty QGraphicsWebView with parent \a parent.

    \sa load()
*/
QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent)
    : QGraphicsWidget(parent)
    , d(new QGraphicsWebViewPrivate(this))
{
#if QT_VERSION >= 0x040600
    setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true);
#endif
    setAcceptHoverEvents(true);
    setFocusPolicy(Qt::StrongFocus);
}
AgentItem::AgentItem(QGraphicsItem *parent)
		: QGraphicsWidget(parent)
{
	setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable);
	setAcceptHoverEvents(true);
	_hovered=false;
	setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
	setMaximumSize(100,100);
	setMinimumSize(100,100);
}