Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MainWindow::wheelEvent(QWheelEvent *event)
- {
- qDebug() << "MyWidget::wheelEvent() INIT";
- int numDegrees = event->delta() / 8;
- int numSteps = numDegrees / 15;
- if (event->orientation() == Qt::Horizontal) {
- //scrollHorizontally(numSteps);
- qDebug() << "MyWidget::wheelEvent() numSteps: " << numSteps;
- } else {
- //scrollVertically(numSteps);
- qDebug() << "MyWidget::wheelEvent() numSteps: " << numSteps;
- }
- zoom = zoom + (numSteps * 10);
- qDebug() << "MyWidget::wheelEvent() zoom: " << zoom;
- if (zoom < 700)
- zoom = 700;
- else if (zoom > 2400)
- zoom = 2400;
- ui->widget->zoomView(zoom);
- event->accept();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement