forked from magnocube/POV-Globe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
slide.h
48 lines (38 loc) · 1022 Bytes
/
slide.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef SLIDE_H
#define SLIDE_H
#include <QPushButton>
#include <QPixmap>
#include <QGraphicsScene>
#include <QPainter>
#include <QImageWriter>
#include <QDebug>
#include <QFileDialog>
class Slide : public QPushButton
{
Q_OBJECT
public:
explicit Slide(QWidget *parent = nullptr, QGraphicsScene *myS = new QGraphicsScene(),const QString oName = "",int width = 256, int height = 128);
QString getObjetName();
QImage getImage();
QGraphicsScene *getScene();
void setScene(QGraphicsScene* i);
void setImage(QImage i);
QString myObjectName;
void safe();
QString safeToDisk(QString path);
private:
QPixmap myIconPixmap;
QGraphicsScene *myScene;
QImage myImage;
QImage myScaledImageForDisplaying;
int minimumSlideSizeWidth, minimumSlideSizeHeight;
int resolutionX;
int resolutionY;
protected:
void paintEvent(QPaintEvent* event);
void mousePressEvent(QMouseEvent *e);
signals:
void onClick(QString name);
public slots:
};
#endif // SLIDE_H