KShare/cropeditor/cropview.cpp
ArsenArsen a2b973d34e This commit contains fixes and a broken attempt to make drawing.
Segfaults are real on this one. Basically, when I call this virtual method on a field which containts a pointer to a derived class from a pure virtual one the program segfaults. Please help.
2017-04-29 17:35:42 +02:00

21 lines
561 B
C++

#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);
// setWindowFlags(Qt::WindowStaysOnTopHint | Qt::CustomizeWindowHint);
}
void CropView::keyPressEvent(QKeyEvent *e)
{
if (e->key() == Qt::Key_Escape)
{
close();
e->accept();
return;
}
QGraphicsView::keyPressEvent(e);
}