tychoBCGEN  0.5
 All Data Structures Namespaces Files Functions Variables
viewing.cpp
Go to the documentation of this file.
1 
4 #include "mainwindow.h"
5 #include "ui_mainwindow.h"
6 #include <QFileDialog>
7 #include <QPixmap>
8 #include <QString>
9 #include <QGraphicsScene>
10 #include <QWheelEvent>
11 #include <QScrollBar>
12 #include <QScrollArea>
13 
14 
16 
17  ui->graphicsView->fitInView(image.rect(), Qt::KeepAspectRatio);
18  ui->graphicsView->setAlignment(Qt::AlignTop);
19 
20 }
21 
23 
24  ui->graphicsView->resetTransform();
25  ui->graphicsView->setAlignment(Qt::AlignTop);
26 }
27 
28 
30 
31  qreal zoomfactor;
32 
33  zoomfactor = (100.0 + ui->zoom_factor->text().toDouble())/100.0;
34 
35  if (image.isNull()==false) ui->graphicsView->scale(zoomfactor,zoomfactor);
36 
37 }
38 
39 
41 
42  qreal zoomfactor;
43 
44  zoomfactor = (100.0 + ui->zoom_factor->text().toDouble())/100.0;
45 
46  zoomfactor = 1.0/zoomfactor;
47 
48  if (image.isNull()==false) ui->graphicsView->scale(zoomfactor,zoomfactor);
49 
50 }
51