72 lines
1.1 KiB
C++
Executable File
72 lines
1.1 KiB
C++
Executable File
#ifndef IMAGEVIEWER_H
|
|
#define IMAGEVIEWER_H
|
|
|
|
#include <QMainWindow>
|
|
#include "konaimage.h"
|
|
#include <QDebug>
|
|
|
|
namespace Ui {
|
|
class ImageViewer;
|
|
}
|
|
|
|
class ImageViewer : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
#define ZOOM_IN 1
|
|
#define ZOOM_OUT 2
|
|
|
|
|
|
public:
|
|
explicit ImageViewer(QWidget *parent = 0);
|
|
~ImageViewer();
|
|
void showLoading();
|
|
//void mouseMoveEvent(QMouseEvent *e);
|
|
void keyPressEvent(QKeyEvent* e);
|
|
int getCurrentId() {return currentID;}
|
|
|
|
private:
|
|
QPixmap pix;
|
|
int currentID;
|
|
|
|
public slots:
|
|
void setImage(KonaImage *Ki);
|
|
void move(int dx, int dy);
|
|
void zoom(int mode);
|
|
void checkPos();
|
|
|
|
signals:
|
|
void loadPrev();
|
|
void loadNext();
|
|
|
|
private:
|
|
Ui::ImageViewer *ui;
|
|
};
|
|
|
|
|
|
class EventFilterizer : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit EventFilterizer(QObject *parent = 0);
|
|
void setIv(ImageViewer *Iv) {iv = Iv;}
|
|
|
|
private:
|
|
ImageViewer *iv;
|
|
int lastX;
|
|
int lastY;
|
|
|
|
protected:
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
signals:
|
|
void onMove(int, int);
|
|
void onZoom(int);
|
|
|
|
public slots:
|
|
|
|
};
|
|
|
|
|
|
#endif // IMAGEVIEWER_H
|