Widget duplication fixed.

preferencesAboutTextFull
Yimgo 12 years ago
parent cb7a0a3807
commit 28bd956726
  1. 11
      src/domain/UBGraphicsWidgetItem.cpp
  2. 2
      src/domain/UBGraphicsWidgetItem.h

@ -44,7 +44,7 @@
bool UBGraphicsWidgetItem::sInlineJavaScriptLoaded = false; bool UBGraphicsWidgetItem::sInlineJavaScriptLoaded = false;
QStringList UBGraphicsWidgetItem::sInlineJavaScripts; QStringList UBGraphicsWidgetItem::sInlineJavaScripts;
UBGraphicsWidgetItem::UBGraphicsWidgetItem(QGraphicsItem *parent, int widgetType) UBGraphicsWidgetItem::UBGraphicsWidgetItem(const QUrl &pWidgetUrl, QGraphicsItem *parent)
: UBGraphicsWebView(parent) : UBGraphicsWebView(parent)
, mInitialLoadDone(false) , mInitialLoadDone(false)
, mIsFreezable(true) , mIsFreezable(true)
@ -52,6 +52,7 @@ UBGraphicsWidgetItem::UBGraphicsWidgetItem(QGraphicsItem *parent, int widgetType
, mLoadIsErronous(false) , mLoadIsErronous(false)
, mCanBeContent(0) , mCanBeContent(0)
, mCanBeTool(0) , mCanBeTool(0)
, mWidgetUrl(pWidgetUrl)
, mIsFrozen(false) , mIsFrozen(false)
, mIsTakingSnapshot(false) , mIsTakingSnapshot(false)
, mShouldMoveWidget(false) , mShouldMoveWidget(false)
@ -83,7 +84,7 @@ UBGraphicsWidgetItem::UBGraphicsWidgetItem(QGraphicsItem *parent, int widgetType
viewPalette.setBrush(QPalette::Window, QBrush(Qt::transparent)); viewPalette.setBrush(QPalette::Window, QBrush(Qt::transparent));
setPalette(viewPalette); setPalette(viewPalette);
UBGraphicsWidgetItemDelegate* delegate = new UBGraphicsWidgetItemDelegate(this, widgetType); UBGraphicsWidgetItemDelegate* delegate = new UBGraphicsWidgetItemDelegate(this);
delegate->init(); delegate->init();
setDelegate(delegate); setDelegate(delegate);
} }
@ -621,7 +622,7 @@ void UBGraphicsWidgetItem::mainFrameLoadFinished (bool ok)
UBGraphicsAppleWidgetItem::UBGraphicsAppleWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent) UBGraphicsAppleWidgetItem::UBGraphicsAppleWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent)
: UBGraphicsWidgetItem(parent) : UBGraphicsWidgetItem(pWidgetUrl, parent)
{ {
QString path = pWidgetUrl.toLocalFile(); QString path = pWidgetUrl.toLocalFile();
@ -699,7 +700,7 @@ QString UBGraphicsW3CWidgetItem::sNPAPIWrappperConfigTemplate;
QMap<QString, QString> UBGraphicsW3CWidgetItem::sNPAPIWrapperTemplates; QMap<QString, QString> UBGraphicsW3CWidgetItem::sNPAPIWrapperTemplates;
UBGraphicsW3CWidgetItem::UBGraphicsW3CWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent) UBGraphicsW3CWidgetItem::UBGraphicsW3CWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent)
: UBGraphicsWidgetItem(parent) : UBGraphicsWidgetItem(pWidgetUrl, parent)
, mW3CWidgetAPI(0) , mW3CWidgetAPI(0)
{ {
QString path = pWidgetUrl.toLocalFile(); QString path = pWidgetUrl.toLocalFile();
@ -861,7 +862,7 @@ void UBGraphicsW3CWidgetItem::setUuid(const QUuid &pUuid)
UBItem* UBGraphicsW3CWidgetItem::deepCopy() const UBItem* UBGraphicsW3CWidgetItem::deepCopy() const
{ {
UBGraphicsW3CWidgetItem *copy = new UBGraphicsW3CWidgetItem(QGraphicsWebView::url(), parentItem()); UBGraphicsW3CWidgetItem *copy = new UBGraphicsW3CWidgetItem(mWidgetUrl, parentItem());
copy->setPos(this->pos()); copy->setPos(this->pos());
copy->setTransform(this->transform()); copy->setTransform(this->transform());

@ -43,7 +43,7 @@ class UBGraphicsWidgetItem : public UBGraphicsWebView
Q_OBJECT Q_OBJECT
public: public:
UBGraphicsWidgetItem(QGraphicsItem *parent = 0, int widgetType = 0); UBGraphicsWidgetItem(const QUrl &pWidgetUrl = QUrl(), QGraphicsItem *parent = 0);
~UBGraphicsWidgetItem(); ~UBGraphicsWidgetItem();
virtual void initialize(); virtual void initialize();

Loading…
Cancel
Save