GroupAnchorItem::GroupAnchorItem(LauncherObject * p_belongsTo)
: QGraphicsItemGroup(p_belongsTo)
, m_qp_currentUIOwner(p_belongsTo)
{
	setFlag(QGraphicsItem::ItemHasNoContents,true);
	setHandlesChildEvents(false);
}
EffectItemBase::EffectItemBase(KoFilterEffect *effect)
        : QGraphicsRectItem(0), m_effect(effect)
{
    setZValue(1);
    setFlags(QGraphicsItem::ItemIsSelectable);
    setAcceptDrops(true);
    setHandlesChildEvents(true);
}
Exemple #3
0
//-----------------------------------------------------------------------------
// Function: StickyNote::setItemOptions()
//-----------------------------------------------------------------------------
void StickyNote::setItemOptions()
{
    setFlag(ItemIsMovable);
    setFlag(ItemIsSelectable);
    setFlag(ItemIsFocusable);
    setFlag(ItemSendsGeometryChanges);

    setHandlesChildEvents(false);
}
ItemGroup::ItemGroup(QGraphicsItem *parent, QGraphicsScene *scene)
    : QGraphicsItemGroup( parent, scene),
    mScale(QPointF(1.0, 1.0))
{
    setTransform(QTransform(1,0,0,0,1,0,0,0,1));
    setPos(0, 0);
	setTransformOriginPoint(0, 0);
	setRotation(0);

    setFlag(QGraphicsItem::ItemIsMovable);
    setFlag(QGraphicsItem::ItemIsSelectable);
    setHandlesChildEvents(true);
}
Exemple #5
0
RectTool::RectTool(AddingType type, Canvas *canvas) :
	Tool(canvas),
	d(new Data)
{
	d->layerController = canvas->findChild<LayerUIController *>();
	d->updateManager = new CanvasUpdateManager(this);
	connect(d->updateManager, SIGNAL(updateTilesRequested(QPointSet)), this, SIGNAL(requestUpdate(QPointSet)));
	
	// set modes
	
	d->addingType = type;
	
	if (d->addingType == NoAdding)
		d->selectingMode = SelectImmediately;
	else
		d->selectingMode = SelectLater;
	
	// create graphics items
	{
		auto group = new QGraphicsItemGroup();
		group->setHandlesChildEvents(false);
		setGraphicsItem(group);
		
		{
			auto frame = new FrameGraphicsItem(group);
			d->frameItem = frame;
		}
	}
	
	addHandle(Top | Left, 1);
	addHandle(Top | Right, 1);
	addHandle(Bottom | Left, 1);
	addHandle(Bottom | Right, 1);
	addHandle(Top, 0);
	addHandle(Bottom, 0);
	addHandle(Left, 0);
	addHandle(Right, 0);
	
	connect(layerScene(), SIGNAL(selectionChanged(QList<LayerConstRef>,QList<LayerConstRef>)), this, SLOT(updateSelected()));
	connect(layerScene(), SIGNAL(layerChanged(LayerConstRef)), this, SLOT(updateLayer(LayerConstRef)));
	connect(canvas, SIGNAL(transformsChanged(SP<const CanvasTransforms>)), this, SLOT(updateGraphicsItems()));
	updateSelected();
}
Exemple #6
0
Properties::Properties() :
	QObject(),
	QGraphicsRectItem(),
	_target( 0 ),
	_haveToResize( false )
{
	setHandlesChildEvents( true );
	setFlag( QGraphicsItem::ItemIsSelectable, true );

	_menu.addAction( ActionIconProvider().getIconForAction("duplicate"), "Duplicate"     , this, SLOT(duplicateTarget())    );
	_menu.addSeparator();
	_menu.addAction( ActionIconProvider().getIconForAction("forward")  , "Bring On Front", this, SLOT(bringTargetToFront()) );
	_menu.addAction( ActionIconProvider().getIconForAction("backward") , "Send To Back"  , this, SLOT(sendTargetToBack())   );
	_menu.addSeparator();
	_menu.addAction( ActionIconProvider().getIconForAction("delete")   , "Delete"        , this, SLOT(deleteTarget()) );


	_infoIcon   = ActionIconProvider().getIconForAction( "info"   );
	_resizeIcon = ActionIconProvider().getIconForAction( "resize" );
}
Exemple #7
0
Node::Node()
{
    setFlag(ItemIsMovable);
    setFlag(ItemIsSelectable);
    setFlag(ItemSendsGeometryChanges);
    setFlag(QGraphicsItem::ItemClipsChildrenToShape);
    setZValue(2);
    nodeID = -1;
    choose = 0;		// What type of pen style to use when drawing outline.
    lSize = 12;		// Default font size, in points.  CURRENTLY UNUSED.
    nodeDiameter = 1;
    edgeWeight = 1;     // UNUSED IN V 1.1.
    rotation = 0;
    text = new Label(this);
    setHandlesChildEvents(true);
    select = false;
    QScreen * screen = QGuiApplication::primaryScreen();
    logicalDotsPerInchX = screen->logicalDotsPerInchX();
    logicalDotsPerInchY = screen->logicalDotsPerInchY();
}
Exemple #8
0
Letter::Letter(const QFont& font, int size, const QPoint& position)
: m_arrow(0), m_clickable(true), m_position(position) {
	QPainterPath path;
	path.addRoundedRect(0, 0, size, size, 5, 5);
	setPath(path);
	setPen(Qt::NoPen);
	setBrush(Qt::white);
	setHandlesChildEvents(true);
	setZValue(1);

	m_face = new QGraphicsEllipseItem(0.5, 0.5, size - 1, size - 1, this);
	m_face->setPen(QPen(Qt::white, 1));
	m_face->setBrush(Qt::white);

	m_item = new QGraphicsSimpleTextItem(this);
	m_item->setFont(font);
	m_item->setBrush(Qt::black);
	setText("?");

	m_cell = new BeveledRect(size + 3, this);
	m_cell->setPos(-1.5, -1.5);
	m_cell->setFlag(QGraphicsItem::ItemStacksBehindParent);
	m_cell->setColor("#0057ae");
}
GroupAnchorItem::GroupAnchorItem()
: m_qp_currentUIOwner(0)
{
	setHandlesChildEvents(false);
}
Exemple #10
0
/*
 * Name:        editLabel()
 * Purpose:     Change edit flags to specify if the label is editable.
 * Arguments:   boolean
 * Output:      none
 * Modifies:    ItemIsFocusable, ItemIsSelectable, setHandlesChildEvents flags
 * Returns:     none
 * Assumptions: none
 * Bugs:        none
 * Notes:       none
 */
void Node::editLabel(bool edit)
{
    setHandlesChildEvents(!edit);
    text->setFlag(QGraphicsItem::ItemIsFocusable, edit);
    text->setFlag(ItemIsSelectable, edit);
}
dmz::QtCanvasObject::QtCanvasObject (QGraphicsItem *parent) :
      QGraphicsItem (parent) {

   setFlag (ItemIsSelectable, true);
   setHandlesChildEvents (true);
}