return;
}
int diff = 1;
+ if (m_selectedItem->type() == 8) {
+ QGraphicsTextItem *t = static_cast<QGraphicsTextItem *>(m_selectedItem);
+ if (t->textInteractionFlags() & Qt::TextEditorInteraction) {
+ QGraphicsScene::keyPressEvent(keyEvent);
+ return;
+ }
+ }
if (keyEvent->modifiers() & Qt::ControlModifier) diff = 10;
switch (keyEvent->key()) {
case Qt::Key_Left:
bool hasSelected = false;
if (m_tool == TITLE_SELECT) {
- foreach(QGraphicsItem* g, list) {
+ foreach(QGraphicsItem *g, list) {
kDebug() << " - - CHECKING ITEM Z:" << g->zValue() << ", TYPE: " << g->type();
// check is there is a selected item in list
if (g->zValue() > -1000 && g->isSelected()) {
t->setTextInteractionFlags(Qt::NoTextInteraction);
setCursor(Qt::ClosedHandCursor);
} else if (item->type() == 3 || item->type() == 13 || item->type() == 7) {
- QRectF r = item->boundingRect();
+ QRectF r;
+ if (m_selectedItem->type() == 3) {
+ r = ((QGraphicsRectItem*)m_selectedItem)->rect();
+ } else r = m_selectedItem->boundingRect();
+
r.translate(item->scenePos());
if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {
resizeMode = TopLeft;
if (m_selectedItem && e->buttons() & Qt::LeftButton) {
if (m_selectedItem->type() == 3 || m_selectedItem->type() == 13 || m_selectedItem->type() == 7) {
- QRectF newrect = m_selectedItem->boundingRect();
+ QRectF newrect;
+ if (m_selectedItem->type() == 3) {
+ newrect = ((QGraphicsRectItem*)m_selectedItem)->rect();
+ } else newrect = m_selectedItem->boundingRect();
+
QPointF newpoint = e->scenePos();
//newpoint -= m_selectedItem->scenePos();
switch (resizeMode) {
m_selectedItem->moveBy(diff.x(), diff.y());
break;
}
- if (m_selectedItem->type() == 3) {
+ if (m_selectedItem->type() == 3 && resizeMode != NoResize) {
QGraphicsRectItem *gi = (QGraphicsRectItem*)m_selectedItem;
gi->setRect(newrect);
}
p += QPoint(-2, -2);
resizeMode = NoResize;
bool itemFound = false;
- foreach(QGraphicsItem* g, items(QRectF(p , QSizeF(4, 4)).toRect())) {
+ foreach(const QGraphicsItem* g, items(QRectF(p , QSizeF(4, 4)).toRect())) {
if ((g->type() == 13 || g->type() == 7) && g->zValue() > -1000) {
// image or svg item
setCursor(Qt::OpenHandCursor);
break;
} else if (g->type() == 3 && g->zValue() > -1000) {
- QRectF r = g->boundingRect();
+ QRectF r = ((QGraphicsRectItem*)g)->rect();
r.translate(g->scenePos());
itemFound = true;
if ((r.toRect().topLeft() - e->scenePos().toPoint()).manhattanLength() < 6 / zoom) {