コード例 #1
0
SceneHandlerItem::SceneHandlerItem(Scene* scene) :
Super(nullptr, itemStyles().get())
{
	// It should be possible to click inside the item. This happens when the user clicks on an "empty" space in the scene
	// as this item is automatically moved to that empty spot before the click is processed.
	setSize(3,3);
	setItemCategory(Scene::MenuItemCategory);
	scene->addItem(this);

	// Make sure this item is behind all others.
	setZValue(Item::LAYER_DEFAULT_Z - 1);
}
コード例 #2
0
ファイル: RootItem.cpp プロジェクト: helandre/Envision
RootItem::RootItem(NodeType *node, int purpose) : ItemWithNode<Item>(nullptr, node, itemStyles().get()), item_(nullptr)
{
	setFlag(QGraphicsItem::ItemHasNoContents);
	setItemCategory(Scene::CodeItemCategory);
	setPurpose(purpose);
}