image_view.hh 882 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// Document layout viewer.
//
// Copyright (C) 2009 Florent D'Halluin.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//

#ifndef   	IMAGE_VIEW_HH_
# define   	IMAGE_VIEW_HH_

# include <QtGui>

class ImageView
  : public QGraphicsView
{
  Q_OBJECT

public:
  ImageView(QGraphicsScene* scene);
  ~ImageView();

  void wheelEvent(QWheelEvent* event);
Florent D'Halluin's avatar
Florent D'Halluin committed
30
31
32
33
34
35
36
37
  void keyPressEvent(QKeyEvent *event);

  // Call after changing the scale.
  void scaleUpdate();

signals:
  // Scale is approximate.
  void scaleUpdated(qreal scale);
38
39
40
};

#endif	    /* !IMAGE_VIEW_HH_ */