SANKORE-909

Write text : Select the text
preferencesAboutTextFull
Anatoly Mihalchenko 12 years ago
parent 13163fef30
commit 9a5cc5b8d2
  1. 17
      src/domain/UBGraphicsTextItemDelegate.cpp
  2. 2
      src/domain/UBGraphicsTextItemDelegate.h

@ -403,3 +403,20 @@ void UBGraphicsTextItemDelegate::scaleTextSize(qreal multiplyer)
{ {
ChangeTextSize(multiplyer, scaleSize); 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);
}

@ -40,6 +40,8 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
virtual ~UBGraphicsTextItemDelegate(); virtual ~UBGraphicsTextItemDelegate();
bool isEditable(); bool isEditable();
void scaleTextSize(qreal multiplyer); void scaleTextSize(qreal multiplyer);
virtual QVariant itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value);
public slots: public slots:
void contentsChanged(); void contentsChanged();

Loading…
Cancel
Save