2017-04-23 15:05:48 +02:00
|
|
|
#include "cropview.hpp"
|
|
|
|
|
|
|
|
CropView::CropView(QGraphicsScene *scene) : QGraphicsView(scene)
|
|
|
|
{
|
|
|
|
setFrameShape(QFrame::NoFrame); // Time taken to solve: A george99g and 38 minutes.
|
|
|
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
|
|
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
2017-05-01 18:43:54 +02:00
|
|
|
setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
|
|
|
|
setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::HighQualityAntialiasing);
|
2017-05-01 19:58:19 +02:00
|
|
|
setCursor(QCursor(Qt::CrossCursor));
|
2017-04-23 15:05:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CropView::keyPressEvent(QKeyEvent *e)
|
|
|
|
{
|
|
|
|
if (e->key() == Qt::Key_Escape)
|
|
|
|
{
|
|
|
|
close();
|
|
|
|
e->accept();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
QGraphicsView::keyPressEvent(e);
|
|
|
|
}
|