Scroll implemented

This commit is contained in:
Sonaion
2019-12-16 19:23:56 +01:00
parent 1c29d564c7
commit 67a72fe487
14 changed files with 75 additions and 13 deletions

View File

@@ -19,7 +19,7 @@
PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget *parent)
:QWidget(parent){
//test yout tool here and reset after accomplished test
this->Tool = nullptr;
this->Tool = new IntelliToolRechteck(this, &colorPicker);
this->setUp(maxWidth, maxHeight);
//tetsing
this->addLayer(200,200,0,0,ImageType::Shaped_Image);
@@ -234,6 +234,14 @@ void PaintingArea::mouseReleaseEvent(QMouseEvent *event){
update();
}
void PaintingArea::wheelEvent(QWheelEvent *event){
QPoint numDegrees = event->angleDelta() / 8;
if(!numDegrees.isNull()){
QPoint numSteps = numDegrees / 15;
Tool->onWheelScrolled(numSteps.y()*-1);
}
}
// QPainter provides functions to draw on the widget
// The QPaintEvent is sent to widgets that need to
// update themselves