#ifndef MAINIMAGEGRAPHICSVIEW_H
#define MAINIMAGEGRAPHICSVIEW_H

#include <QtGui>

namespace Ui{
    class MainImageGraphicsView;
}

class MainImageGraphicsView : public QGraphicsView{
    Q_OBJECT
public:
    MainImageGraphicsView(QWidget *parent) : QGraphicsView(parent){
    this->setScene(&s);
    this->show();
    }

    ~MainImageGraphicsView(){}

    bool setImageFilePath(QString fileName){
        s.clear();
        if(!p.load(fileName)){return false;}
        p = p.scaled(this->size(), Qt::KeepAspectRatio);
        s.addPixmap(p);
        return true;}
private:
    QPixmap p;
    QGraphicsScene s;
};

#endif // MAINIMAGEGRAPHICSVIEW_H
