Commit 9a5cc5b8 authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

SANKORE-909

 Write text : Select the text
parent 13163fef
......@@ -403,3 +403,20 @@ void UBGraphicsTextItemDelegate::scaleTextSize(qreal multiplyer)
{
ChangeTextSize(multiplyer, scaleSize);
}
QVariant UBGraphicsTextItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
{
if (change == QGraphicsItem::ItemSelectedChange)
{
if (delegated()->isSelected())
{
QTextCursor c = delegated()->textCursor();
if (c.hasSelection())
{
c.clearSelection();
delegated()->setTextCursor(c);
}
}
}
return UBGraphicsItemDelegate::itemChange(change, value);
}
\ No newline at end of file
......@@ -40,6 +40,8 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
virtual ~UBGraphicsTextItemDelegate();
bool isEditable();
void scaleTextSize(qreal multiplyer);
virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
public slots:
void contentsChanged();
......
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