Bug with shortcuts in widget fixed.

Now copy/paste can be performed without being grapped by application's actions.
Another bug when removing object fixed (dynamic_cast instead of static_cast) in DelegateItem.
preferencesAboutTextFull
Yimgo 12 years ago
parent 244c5c07b9
commit 9a62370716
  1. 3
      src/domain/UBGraphicsItemDelegate.cpp
  2. 11
      src/domain/UBGraphicsWebView.cpp
  3. 1
      src/domain/UBGraphicsWebView.h

@ -389,9 +389,10 @@ void UBGraphicsItemDelegate::remove(bool canUndo)
scene->removeItem(mFrame);
/* this is performed because when removing delegated from scene while it contains flash content, segfault happens because of QGraphicsScene::removeItem() */
UBGraphicsWebView *mDelegated_casted = static_cast<UBGraphicsWebView*>(mDelegated);
UBGraphicsWebView *mDelegated_casted = dynamic_cast<UBGraphicsWebView*>(mDelegated);
if (mDelegated_casted)
mDelegated_casted->setHtml(QString());
scene->removeItem(mDelegated);
if (canUndo)

@ -51,10 +51,9 @@ QVariant UBGraphicsWebView::itemChange(GraphicsItemChange change, const QVariant
if ((change == QGraphicsItem::ItemSelectedHasChanged) && scene()) {
if (isSelected())
scene()->setActiveWindow(this);
else {
else
if(scene()->activeWindow() == this)
scene()->setActiveWindow(0);
}
}
QVariant newValue = mDelegate->itemChange(change, value);
@ -169,3 +168,11 @@ void UBGraphicsWebView::remove()
if (mDelegate)
mDelegate->remove(true);
}
bool UBGraphicsWebView::event(QEvent *event)
{
if (event->type() == QEvent::ShortcutOverride)
event->accept();
return QGraphicsWebView::event(event);
}

@ -55,6 +55,7 @@ class UBGraphicsWebView: public QGraphicsWebView, public UBItem, public UBResiza
virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
virtual bool event(QEvent *event);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);

Loading…
Cancel
Save