some cosmetic

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 869e4cddd0
commit c4f883cdc3
  1. 6
      src/domain/UBGraphicsItemDelegate.cpp
  2. 18
      src/domain/UBGraphicsMediaItem.cpp
  3. 7
      src/domain/UBGraphicsProxyWidget.cpp

@ -363,15 +363,9 @@ bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
if( delegated()->isSelected() ) if( delegated()->isSelected() )
{
// event->accept();
return true; return true;
}
else else
{
// event->ignore();
return false; return false;
}
} }
bool UBGraphicsItemDelegate::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) bool UBGraphicsItemDelegate::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)

@ -68,8 +68,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
haveLinkedImage = true; haveLinkedImage = true;
} }
else if (mediaPath.toLower().contains("audios")) else if (mediaPath.toLower().contains("audios")){
{
mMediaType = mediaType_Audio; mMediaType = mediaType_Audio;
mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
@ -188,8 +187,7 @@ void UBGraphicsMediaItem::hasMediaChanged(bool hasMedia)
{ {
if(hasMedia && mMediaObject->isSeekable()) if(hasMedia && mMediaObject->isSeekable())
{ {
Q_UNUSED(hasMedia); mMediaObject->seek(mInitialPos);
mMediaObject->seek(mInitialPos);
UBGraphicsMediaItemDelegate *med = dynamic_cast<UBGraphicsMediaItemDelegate *>(Delegate()); UBGraphicsMediaItemDelegate *med = dynamic_cast<UBGraphicsMediaItemDelegate *>(Delegate());
if (med) if (med)
med->updateTicker(initialPos()); med->updateTicker(initialPos());
@ -206,9 +204,7 @@ UBGraphicsScene* UBGraphicsMediaItem::scene()
void UBGraphicsMediaItem::activeSceneChanged() void UBGraphicsMediaItem::activeSceneChanged()
{ {
if (UBApplication::boardController->activeScene() != scene()) if (UBApplication::boardController->activeScene() != scene())
{
mMediaObject->pause(); mMediaObject->pause();
}
} }
@ -269,9 +265,7 @@ void UBGraphicsMediaItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{ {
QGraphicsItem *curItem = group->getCurrentItem(); QGraphicsItem *curItem = group->getCurrentItem();
if (curItem && this != curItem) if (curItem && this != curItem)
{
group->deselectCurrentItem(); group->deselectCurrentItem();
}
group->setCurrentItem(this); group->setCurrentItem(this);
this->setSelected(true); this->setSelected(true);
Delegate()->positionHandles(); 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; mShouldMove = false;
if (!Delegate()->mousePressEvent(event)) if (!Delegate()->mousePressEvent(event))
{
event->accept(); event->accept();
}
} }
else else {
{
mShouldMove = (event->buttons() & Qt::LeftButton); mShouldMove = (event->buttons() & Qt::LeftButton);
mMousePressPos = event->scenePos(); mMousePressPos = event->scenePos();
mMouseMovePos = mMousePressPos; mMouseMovePos = mMousePressPos;

@ -116,8 +116,11 @@ void UBGraphicsProxyWidget::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void UBGraphicsProxyWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsProxyWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{ {
Delegate()->mouseReleaseEvent(event); if(Delegate()->mouseReleaseEvent(event)){
QGraphicsProxyWidget::mouseReleaseEvent(event);
}
else
QGraphicsProxyWidget::mouseReleaseEvent(event);
} }
void UBGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event) void UBGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)

Loading…
Cancel
Save