|
|
@ -89,6 +89,8 @@ QVariant UBGraphicsTextItem::itemChange(GraphicsItemChange change, const QVarian |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
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.
|
|
|
|
// scene()->itemAt(pos) returns 0 if pos is not over text, but over text item, but mouse press comes.
|
|
|
|
// It is a cludge...
|
|
|
|
// It is a cludge...
|
|
|
|
if (UBStylusTool::Play == UBDrawingController::drawingController()->stylusTool()) |
|
|
|
if (UBStylusTool::Play == UBDrawingController::drawingController()->stylusTool()) |
|
|
@ -145,7 +147,6 @@ void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) |
|
|
|
|
|
|
|
|
|
|
|
if (mMultiClickState == 1) |
|
|
|
if (mMultiClickState == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// setTextInteractionFlags(Qt::TextEditorInteraction);
|
|
|
|
|
|
|
|
QGraphicsTextItem::mousePressEvent(event); |
|
|
|
QGraphicsTextItem::mousePressEvent(event); |
|
|
|
setFocus(); |
|
|
|
setFocus(); |
|
|
|
} |
|
|
|
} |
|
|
@ -355,3 +356,9 @@ void UBGraphicsTextItem::documentSizeChanged(const QSizeF & newSize) |
|
|
|
{ |
|
|
|
{ |
|
|
|
resize(newSize.width(), newSize.height()); |
|
|
|
resize(newSize.width(), newSize.height()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsTextItem::setHtml(const QString &text) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QGraphicsTextItem::setHtml(text); |
|
|
|
|
|
|
|
setTextInteractionFlags(Qt::NoTextInteraction); |
|
|
|
|
|
|
|
} |
|
|
|