Commit 023550e6 authored by Ivan Ilin's avatar Ivan Ilin

Sankore-413

parent 33533e50
......@@ -554,7 +554,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
{
QRect rubberRect = mRubberBand->geometry ();
UBGraphicsTextItem* textItem = scene ()->addText ("", mapToScene (rubberRect.topLeft ()));
UBGraphicsTextItem* textItem = scene()->addTextHtml ("", mapToScene (rubberRect.topLeft ()));
event->accept ();
UBDrawingController::drawingController ()->setStylusTool (UBStylusTool::Selector);
......
......@@ -1321,7 +1321,7 @@ UBGraphicsTextItem* UBGraphicsScene::addTextWithFont(const QString& pString, con
return textItem;
}
UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString)
UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString, const QPointF& pTopLeft)
{
UBGraphicsTextItem *textItem = new UBGraphicsTextItem();
textItem->setPlainText("");
......@@ -1341,6 +1341,7 @@ UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString)
textItem->setFocus();
setDocumentUpdated();
textItem->setPos(pTopLeft);
return textItem;
}
......@@ -1356,7 +1357,6 @@ void UBGraphicsScene::addItem(QGraphicsItem* item)
mFastAccessItems << item;
}
void UBGraphicsScene::addItems(const QSet<QGraphicsItem*>& items)
{
setModified(true);
......@@ -1369,7 +1369,6 @@ void UBGraphicsScene::addItems(const QSet<QGraphicsItem*>& items)
mFastAccessItems += items.toList();
}
void UBGraphicsScene::removeItem(QGraphicsItem* item)
{
setModified(true);
......@@ -1427,7 +1426,6 @@ QGraphicsItem* UBGraphicsScene::setAsBackgroundObject(QGraphicsItem* item, bool
item->setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::FixedBackground);
item->setZValue(backgroundLayerStart);
UBApplication::showMessage("ZValue of the background is " + QString::number(item->zValue(), 'f'));
if (pAdaptTransformation)
{
......
......@@ -89,9 +89,9 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
UBGraphicsSvgItem* addSvg(const QUrl& pSvgFileUrl, const QPointF& pPos = QPointF(0, 0));
UBGraphicsTextItem* addText(const QString& pString, const QPointF& pTopLeft = QPointF(0, 0));
UBGraphicsTextItem* addTextWithFont(const QString& pString, const QPointF& pTopLeft = QPointF(0, 0)
UBGraphicsTextItem* addTextWithFont(const QString& pString, const QPointF& pTopLeft = QPointF(0, 0)
, int pointSize = -1, const QString& fontFamily = "", bool bold = false, bool italic = false);
UBGraphicsTextItem* addTextHtml(const QString &pString = QString());
UBGraphicsTextItem* addTextHtml(const QString &pString = QString(), const QPointF& pTopLeft = QPointF(0, 0));
UBGraphicsW3CWidgetItem* addOEmbed(const QUrl& pContentUrl, const QPointF& pPos = QPointF(0, 0));
......
......@@ -203,7 +203,7 @@ UBItem* UBGraphicsTextItem::deepCopy() const
{
UBGraphicsTextItem* copy = new UBGraphicsTextItem();
copy->setPlainText(this->toPlainText());
copy->setHtml(toHtml());
copy->setPos(this->pos());
copy->setZValue(this->zValue());
copy->setTransform(this->transform());
......@@ -211,10 +211,11 @@ UBItem* UBGraphicsTextItem::deepCopy() const
copy->setFlag(QGraphicsItem::ItemIsSelectable, true);
copy->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType));
copy->setData(UBGraphicsItemData::ItemLocked, this->data(UBGraphicsItemData::ItemLocked));
copy->setDefaultTextColor(this->defaultTextColor());
copy->setFont(this->font());
copy->setColorOnDarkBackground(this->colorOnDarkBackground());
copy->setColorOnLightBackground(this->colorOnLightBackground());
copy->setData(UBGraphicsItemData::ItemEditable, data(UBGraphicsItemData::ItemEditable).toBool());
// copy->setDefaultTextColor(this->defaultTextColor());
// copy->setFont(this->font());
// copy->setColorOnDarkBackground(this->colorOnDarkBackground());
// copy->setColorOnLightBackground(this->colorOnLightBackground());
copy->setTextWidth(this->textWidth());
copy->setTextHeight(this->textHeight());
......
......@@ -99,7 +99,9 @@ protected:
}
public:
virtual UBGraphicsItemDelegate *Delegate() const = 0;
virtual void remove() = 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