Merge branch 'develop' of github.com:Sankore/Sankore-3.1 into develop

preferencesAboutTextFull
Anatoly Mihalchenko 12 years ago
commit 4b6bb08b9b
  1. 3
      src/board/UBBoardView.cpp
  2. 14
      src/domain/UBGraphicsGroupContainerItem.cpp
  3. 2
      src/domain/UBGraphicsGroupContainerItem.h
  4. 2
      src/domain/UBGraphicsScene.cpp
  5. 14
      src/frameworks/UBCoreGraphicsScene.cpp

@ -528,6 +528,8 @@ Here we determines cases when items should to get mouse press event at pressing
return true; return true;
case DelegateButton::Type: case DelegateButton::Type:
return true;
case UBGraphicsMediaItem::Type: case UBGraphicsMediaItem::Type:
return false; return false;
@ -1123,6 +1125,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
else else
{ {
if (isUBItem(movingItem) && if (isUBItem(movingItem) &&
DelegateButton::Type != movingItem->type() &&
QGraphicsSvgItem::Type != movingItem->type() && QGraphicsSvgItem::Type != movingItem->type() &&
UBGraphicsDelegateFrame::Type != movingItem->type() && UBGraphicsDelegateFrame::Type != movingItem->type() &&
UBToolWidget::Type != movingItem->type() && UBToolWidget::Type != movingItem->type() &&

@ -79,6 +79,8 @@ void UBGraphicsGroupContainerItem::addToGroup(QGraphicsItem *item)
item->setPos(mapFromItem(item, 0, 0)); item->setPos(mapFromItem(item, 0, 0));
item->scene()->removeItem(item); item->scene()->removeItem(item);
if (corescene())
corescene()->removeItemFromDeletion(item);
item->setParentItem(this); item->setParentItem(this);
// removing position from translation component of the new transform // removing position from translation component of the new transform
@ -225,6 +227,18 @@ void UBGraphicsGroupContainerItem::destroy() {
remove(); remove();
} }
void UBGraphicsGroupContainerItem::clearSource()
{
foreach(QGraphicsItem *child, childItems())
{
UBGraphicsItem *item = dynamic_cast<UBGraphicsItem *>(child);
if (item)
{
item->clearSource();
}
}
}
void UBGraphicsGroupContainerItem::mousePressEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsGroupContainerItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
if (mDelegate->mousePressEvent(event)) { if (mDelegate->mousePressEvent(event)) {

@ -39,6 +39,8 @@ public:
virtual void setUuid(const QUuid &pUuid); virtual void setUuid(const QUuid &pUuid);
void destroy(); void destroy();
virtual void clearSource();
protected: protected:
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);

@ -1375,7 +1375,7 @@ UBGraphicsGroupContainerItem *UBGraphicsScene::createGroup(QList<QGraphicsItem *
} }
foreach (QGraphicsItem *chItem, childItems) { foreach (QGraphicsItem *chItem, childItems) {
groupItem->addToGroup(chItem); groupItem->addToGroup(chItem);
mFastAccessItems.removeAll(item); mFastAccessItems.removeAll(chItem);
} }
} else { } else {
groupItem->addToGroup(item); groupItem->addToGroup(item);

@ -53,6 +53,8 @@ UBCoreGraphicsScene::~UBCoreGraphicsScene()
void UBCoreGraphicsScene::addItem(QGraphicsItem* item) void UBCoreGraphicsScene::addItem(QGraphicsItem* item)
{ {
addItemToDeletion(item);
if (item->type() == UBGraphicsGroupContainerItem::Type && item->childItems().count()) { if (item->type() == UBGraphicsGroupContainerItem::Type && item->childItems().count()) {
foreach (QGraphicsItem *curItem, item->childItems()) { foreach (QGraphicsItem *curItem, item->childItems()) {
removeItemFromDeletion(curItem); removeItemFromDeletion(curItem);
@ -80,17 +82,7 @@ bool UBCoreGraphicsScene::deleteItem(QGraphicsItem* item)
{ {
if(mItemsToDelete.contains(item)) if(mItemsToDelete.contains(item))
{ {
UBGraphicsItem* item_casted = 0; UBGraphicsItem *item_casted = dynamic_cast<UBGraphicsItem *>(item);
switch (item->type())
{
case UBGraphicsMediaItem::Type:
item_casted = dynamic_cast<UBGraphicsMediaItem*>(item);
break;
case UBGraphicsW3CWidgetItem::Type:
item_casted = dynamic_cast<UBGraphicsWidgetItem*>(item);
break;
}
if (0 != item_casted) if (0 != item_casted)
item_casted->clearSource(); item_casted->clearSource();

Loading…
Cancel
Save