Commit 63e5e8ec authored by Clément Fauconnier's avatar Clément Fauconnier

fixed autocompletion error in hasSelection()

parent 6f6ad00d
......@@ -386,7 +386,7 @@ void UBGraphicsTextItemDelegate::pickColor()
curCursor.mergeCharFormat(format);
delegated()->setTextCursor(curCursor);
if (!curCursor.hasComplexSelection())
if (!curCursor.hasSelection())
UBGraphicsTextItem::lastUsedTextColor = selectedColor;
delegated()->setSelected(true);
......
......@@ -556,6 +556,15 @@ void UBGraphicsWidgetItem::sendJSLeaveEvent()
page()->mainFrame()->evaluateJavaScript("if(widget && widget.onleave) { widget.onleave();}");
}
void UBGraphicsWidgetItem::sendJSResizeEvent()
{
if (page() && page()->mainFrame())
{
page()->mainFrame()->evaluateJavaScript("if(widget && widget.onresize) { widget.onresize();}");
page()->mainFrame()->evaluateJavaScript("if(window && window.onresize) { window.onresize();}");
}
}
void UBGraphicsWidgetItem::injectInlineJavaScript()
{
if (!sInlineJavaScriptLoaded) {
......@@ -654,6 +663,7 @@ void UBGraphicsWidgetItem::resize(qreal w, qreal h)
void UBGraphicsWidgetItem::resize(const QSizeF & pSize)
{
sendJSResizeEvent();
if (pSize != size()) {
QGraphicsWebView::setMaximumSize(pSize.width(), pSize.height());
QGraphicsWebView::resize(pSize.width(), pSize.height());
......
......@@ -165,6 +165,7 @@ class UBGraphicsWidgetItem : public QGraphicsWebView, public UBItem, public UBRe
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
virtual void sendJSEnterEvent();
virtual void sendJSLeaveEvent();
virtual void sendJSResizeEvent();
virtual void injectInlineJavaScript();
virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
......
......@@ -44,8 +44,7 @@
#include "core/memcheck.h"
UBGraphicsWidgetItemDelegate::UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType)
: UBGraphicsItemDelegate(pDelegated, 0, GF_COMMON
| GF_RESPECT_RATIO)
: UBGraphicsItemDelegate(pDelegated, 0, GF_SCALABLE_Y_AXIS)
, freezeAction(0)
, setAsToolAction(0)
{
......
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