Small cleanup

This commit is contained in:
ArsenArsen 2017-04-29 18:11:18 +02:00
parent a2b973d34e
commit dc5ce7649a
2 changed files with 2 additions and 6 deletions

View File

@ -29,7 +29,7 @@ CropEditor::~CropEditor()
void CropEditor::crop(QRect rect) void CropEditor::crop(QRect rect)
{ {
QPixmap map = QPixmap::grabWidget(view, rect); QPixmap map = view->grab(rect);
QPixmap *cropp = new QPixmap; QPixmap *cropp = new QPixmap;
map.swap(*cropp); map.swap(*cropp);
delete view; delete view;

View File

@ -91,8 +91,6 @@ void CropScene::mouseMoveEvent(QGraphicsSceneMouseEvent *e)
e->accept(); e->accept();
} }
} }
else
QGraphicsScene::mouseMoveEvent(e);
prevButtons = buttons; prevButtons = buttons;
} }
@ -104,7 +102,6 @@ void CropScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *e)
drawingSelection = nullptr; drawingSelection = nullptr;
} }
prevButtons = Qt::NoButton; prevButtons = Qt::NoButton;
QGraphicsScene::mouseReleaseEvent(e);
} }
void CropScene::keyReleaseEvent(QKeyEvent *event) void CropScene::keyReleaseEvent(QKeyEvent *event)
@ -140,10 +137,9 @@ void CropScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *e)
e->accept(); e->accept();
} }
void CropScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *e) void CropScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *)
{ {
done(); done();
QGraphicsScene::mouseDoubleClickEvent(e);
} }
void CropScene::done() void CropScene::done()