|
|
|
@ -563,6 +563,9 @@ void UBGraphicsWidgetItem::injectInlineJavaScript() |
|
|
|
|
|
|
|
|
|
void UBGraphicsWidgetItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) |
|
|
|
|
{ |
|
|
|
|
if(!scene() || !scene()->renderingContext()) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if (scene()->renderingContext() != UBGraphicsScene::Screen) |
|
|
|
|
{ |
|
|
|
|
painter->drawPixmap(0, 0, snapshot()); |
|
|
|
@ -622,52 +625,52 @@ void UBGraphicsWidgetItem::mainFrameLoadFinished (bool ok) |
|
|
|
|
update(boundingRect()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBGraphicsWidgetItem::wheelEvent(QGraphicsSceneWheelEvent *event) |
|
|
|
|
{ |
|
|
|
|
if (Delegate()->weelEvent(event)) |
|
|
|
|
{ |
|
|
|
|
QGraphicsWebView::wheelEvent(event); |
|
|
|
|
event->accept(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QVariant UBGraphicsWidgetItem::itemChange(GraphicsItemChange change, const QVariant &value) |
|
|
|
|
{ |
|
|
|
|
if ((change == QGraphicsItem::ItemSelectedHasChanged) && scene()) { |
|
|
|
|
if (isSelected()) |
|
|
|
|
scene()->setActiveWindow(this); |
|
|
|
|
else |
|
|
|
|
if(scene()->activeWindow() == this) |
|
|
|
|
scene()->setActiveWindow(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QVariant newValue = Delegate()->itemChange(change, value); |
|
|
|
|
return QGraphicsWebView::itemChange(change, newValue); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBGraphicsWidgetItem::resize(qreal w, qreal h) |
|
|
|
|
{ |
|
|
|
|
UBGraphicsWidgetItem::resize(QSizeF(w, h)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsWidgetItem::resize(const QSizeF & pSize) |
|
|
|
|
{ |
|
|
|
|
if (pSize != size()) { |
|
|
|
|
QGraphicsWebView::setMaximumSize(pSize.width(), pSize.height()); |
|
|
|
|
QGraphicsWebView::resize(pSize.width(), pSize.height()); |
|
|
|
|
if (Delegate()) |
|
|
|
|
Delegate()->positionHandles(); |
|
|
|
|
if (scene()) |
|
|
|
|
scene()->setModified(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QSizeF UBGraphicsWidgetItem::size() const |
|
|
|
|
{ |
|
|
|
|
return QGraphicsWebView::size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBGraphicsWidgetItem::wheelEvent(QGraphicsSceneWheelEvent *event) |
|
|
|
|
{ |
|
|
|
|
if (Delegate()->weelEvent(event)) |
|
|
|
|
{ |
|
|
|
|
QGraphicsWebView::wheelEvent(event); |
|
|
|
|
event->accept(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QVariant UBGraphicsWidgetItem::itemChange(GraphicsItemChange change, const QVariant &value) |
|
|
|
|
{ |
|
|
|
|
if ((change == QGraphicsItem::ItemSelectedHasChanged) && scene()) { |
|
|
|
|
if (isSelected()) |
|
|
|
|
scene()->setActiveWindow(this); |
|
|
|
|
else |
|
|
|
|
if(scene()->activeWindow() == this) |
|
|
|
|
scene()->setActiveWindow(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QVariant newValue = Delegate()->itemChange(change, value); |
|
|
|
|
return QGraphicsWebView::itemChange(change, newValue); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBGraphicsWidgetItem::resize(qreal w, qreal h) |
|
|
|
|
{ |
|
|
|
|
UBGraphicsWidgetItem::resize(QSizeF(w, h)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsWidgetItem::resize(const QSizeF & pSize) |
|
|
|
|
{ |
|
|
|
|
if (pSize != size()) { |
|
|
|
|
QGraphicsWebView::setMaximumSize(pSize.width(), pSize.height()); |
|
|
|
|
QGraphicsWebView::resize(pSize.width(), pSize.height()); |
|
|
|
|
if (Delegate()) |
|
|
|
|
Delegate()->positionHandles(); |
|
|
|
|
if (scene()) |
|
|
|
|
scene()->setModified(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QSizeF UBGraphicsWidgetItem::size() const |
|
|
|
|
{ |
|
|
|
|
return QGraphicsWebView::size(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsAppleWidgetItem::UBGraphicsAppleWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent) |
|
|
|
|