Commit 9a623707 authored by Yimgo's avatar Yimgo

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.
parent 244c5c07
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment