Sankore-413

preferencesAboutTextFull
Ivan Ilin 13 years ago
parent 33533e50f9
commit 023550e644
  1. 2
      src/board/UBBoardView.cpp
  2. 6
      src/domain/UBGraphicsScene.cpp
  3. 2
      src/domain/UBGraphicsScene.h
  4. 11
      src/domain/UBGraphicsTextItem.cpp
  5. 2
      src/domain/UBItem.h

@ -554,7 +554,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
{ {
QRect rubberRect = mRubberBand->geometry (); QRect rubberRect = mRubberBand->geometry ();
UBGraphicsTextItem* textItem = scene ()->addText ("", mapToScene (rubberRect.topLeft ())); UBGraphicsTextItem* textItem = scene()->addTextHtml ("", mapToScene (rubberRect.topLeft ()));
event->accept (); event->accept ();
UBDrawingController::drawingController ()->setStylusTool (UBStylusTool::Selector); UBDrawingController::drawingController ()->setStylusTool (UBStylusTool::Selector);

@ -1321,7 +1321,7 @@ UBGraphicsTextItem* UBGraphicsScene::addTextWithFont(const QString& pString, con
return textItem; return textItem;
} }
UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString) UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString, const QPointF& pTopLeft)
{ {
UBGraphicsTextItem *textItem = new UBGraphicsTextItem(); UBGraphicsTextItem *textItem = new UBGraphicsTextItem();
textItem->setPlainText(""); textItem->setPlainText("");
@ -1341,6 +1341,7 @@ UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString)
textItem->setFocus(); textItem->setFocus();
setDocumentUpdated(); setDocumentUpdated();
textItem->setPos(pTopLeft);
return textItem; return textItem;
} }
@ -1356,7 +1357,6 @@ void UBGraphicsScene::addItem(QGraphicsItem* item)
mFastAccessItems << item; mFastAccessItems << item;
} }
void UBGraphicsScene::addItems(const QSet<QGraphicsItem*>& items) void UBGraphicsScene::addItems(const QSet<QGraphicsItem*>& items)
{ {
setModified(true); setModified(true);
@ -1369,7 +1369,6 @@ void UBGraphicsScene::addItems(const QSet<QGraphicsItem*>& items)
mFastAccessItems += items.toList(); mFastAccessItems += items.toList();
} }
void UBGraphicsScene::removeItem(QGraphicsItem* item) void UBGraphicsScene::removeItem(QGraphicsItem* item)
{ {
setModified(true); setModified(true);
@ -1427,7 +1426,6 @@ QGraphicsItem* UBGraphicsScene::setAsBackgroundObject(QGraphicsItem* item, bool
item->setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::FixedBackground); item->setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::FixedBackground);
item->setZValue(backgroundLayerStart); item->setZValue(backgroundLayerStart);
UBApplication::showMessage("ZValue of the background is " + QString::number(item->zValue(), 'f'));
if (pAdaptTransformation) if (pAdaptTransformation)
{ {

@ -91,7 +91,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
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); , 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)); UBGraphicsW3CWidgetItem* addOEmbed(const QUrl& pContentUrl, const QPointF& pPos = QPointF(0, 0));

@ -203,7 +203,7 @@ UBItem* UBGraphicsTextItem::deepCopy() const
{ {
UBGraphicsTextItem* copy = new UBGraphicsTextItem(); UBGraphicsTextItem* copy = new UBGraphicsTextItem();
copy->setPlainText(this->toPlainText()); copy->setHtml(toHtml());
copy->setPos(this->pos()); copy->setPos(this->pos());
copy->setZValue(this->zValue()); copy->setZValue(this->zValue());
copy->setTransform(this->transform()); copy->setTransform(this->transform());
@ -211,10 +211,11 @@ UBItem* UBGraphicsTextItem::deepCopy() const
copy->setFlag(QGraphicsItem::ItemIsSelectable, true); copy->setFlag(QGraphicsItem::ItemIsSelectable, true);
copy->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType)); copy->setData(UBGraphicsItemData::ItemLayerType, this->data(UBGraphicsItemData::ItemLayerType));
copy->setData(UBGraphicsItemData::ItemLocked, this->data(UBGraphicsItemData::ItemLocked)); copy->setData(UBGraphicsItemData::ItemLocked, this->data(UBGraphicsItemData::ItemLocked));
copy->setDefaultTextColor(this->defaultTextColor()); copy->setData(UBGraphicsItemData::ItemEditable, data(UBGraphicsItemData::ItemEditable).toBool());
copy->setFont(this->font()); // copy->setDefaultTextColor(this->defaultTextColor());
copy->setColorOnDarkBackground(this->colorOnDarkBackground()); // copy->setFont(this->font());
copy->setColorOnLightBackground(this->colorOnLightBackground()); // copy->setColorOnDarkBackground(this->colorOnDarkBackground());
// copy->setColorOnLightBackground(this->colorOnLightBackground());
copy->setTextWidth(this->textWidth()); copy->setTextWidth(this->textWidth());
copy->setTextHeight(this->textHeight()); copy->setTextHeight(this->textHeight());

@ -99,7 +99,9 @@ protected:
} }
public: public:
virtual UBGraphicsItemDelegate *Delegate() const = 0; virtual UBGraphicsItemDelegate *Delegate() const = 0;
virtual void remove() = 0; virtual void remove() = 0;
}; };

Loading…
Cancel
Save