diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 0a68af2d..b868f459 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -363,15 +363,9 @@ bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event) { Q_UNUSED(event); if( delegated()->isSelected() ) - { -// event->accept(); return true; - } else - { -// event->ignore(); return false; - } } bool UBGraphicsItemDelegate::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index 3396b93f..cec3c15e 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -68,8 +68,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte haveLinkedImage = true; } - else if (mediaPath.toLower().contains("audios")) - { + else if (mediaPath.toLower().contains("audios")){ mMediaType = mediaType_Audio; mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); @@ -188,8 +187,7 @@ void UBGraphicsMediaItem::hasMediaChanged(bool hasMedia) { if(hasMedia && mMediaObject->isSeekable()) { - Q_UNUSED(hasMedia); - mMediaObject->seek(mInitialPos); + mMediaObject->seek(mInitialPos); UBGraphicsMediaItemDelegate *med = dynamic_cast(Delegate()); if (med) med->updateTicker(initialPos()); @@ -206,9 +204,7 @@ UBGraphicsScene* UBGraphicsMediaItem::scene() void UBGraphicsMediaItem::activeSceneChanged() { if (UBApplication::boardController->activeScene() != scene()) - { mMediaObject->pause(); - } } @@ -269,9 +265,7 @@ void UBGraphicsMediaItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { QGraphicsItem *curItem = group->getCurrentItem(); if (curItem && this != curItem) - { group->deselectCurrentItem(); - } group->setCurrentItem(this); this->setSelected(true); Delegate()->positionHandles(); @@ -280,16 +274,12 @@ void UBGraphicsMediaItem::mousePressEvent(QGraphicsSceneMouseEvent *event) } } - if (parentItem() && parentItem()->type() == UBGraphicsGroupContainerItem::Type) - { + if (parentItem() && parentItem()->type() == UBGraphicsGroupContainerItem::Type) { mShouldMove = false; if (!Delegate()->mousePressEvent(event)) - { event->accept(); - } } - else - { + else { mShouldMove = (event->buttons() & Qt::LeftButton); mMousePressPos = event->scenePos(); mMouseMovePos = mMousePressPos; diff --git a/src/domain/UBGraphicsProxyWidget.cpp b/src/domain/UBGraphicsProxyWidget.cpp index 4b4c2aa4..490bae04 100644 --- a/src/domain/UBGraphicsProxyWidget.cpp +++ b/src/domain/UBGraphicsProxyWidget.cpp @@ -116,8 +116,11 @@ void UBGraphicsProxyWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsProxyWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - Delegate()->mouseReleaseEvent(event); - QGraphicsProxyWidget::mouseReleaseEvent(event); + if(Delegate()->mouseReleaseEvent(event)){ + + } + else + QGraphicsProxyWidget::mouseReleaseEvent(event); } void UBGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)