Fix for text items still being editable even when marked as non-editable

preferencesAboutTextFull
Craig Watson 8 years ago
parent c8c2685838
commit ee9965ac9e
  1. 3
      src/domain/UBGraphicsTextItem.cpp

@ -102,7 +102,6 @@ QVariant UBGraphicsTextItem::itemChange(GraphicsItemChange change, const QVarian
void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
setTextInteractionFlags(Qt::TextEditorInteraction);
// scene()->itemAt(pos) returns 0 if pos is not over text, but over text item, but mouse press comes.
// It is a cludge...
@ -138,6 +137,8 @@ void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
if (!data(UBGraphicsItemData::ItemEditable).toBool())
return;
setTextInteractionFlags(Qt::TextEditorInteraction);
int elapsed = mLastMousePressTime.msecsTo(QTime::currentTime());
if (elapsed < UBApplication::app()->doubleClickInterval())

Loading…
Cancel
Save