Widget duplication fixed.

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

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

Loading…
Cancel
Save