-
Notifications
You must be signed in to change notification settings - Fork 0
/
displaywidgetimages.h
54 lines (43 loc) · 1.42 KB
/
displaywidgetimages.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
49
50
51
52
53
54
#pragma once
#ifndef DISPLAYWIDGETIMAGES_H
#define DISPLAYWIDGETIMAGES_H
#include <QPushButton>
#include <QLabel>
#include "displaywidgetbase.h"
#include <medialistwidget.h>
#include <QSqlRecord>
class DisplayWidgetImages : public DisplayWidgetBase
{
Q_OBJECT
Q_PROPERTY(QVariant Value READ getValue WRITE setValue)
public:
DisplayWidgetImages(MyField newField, bool editable=false,QWidget *parent=0);
~DisplayWidgetImages();
QVariant getValue();
void setValue(QVariant newValue);
inline QSizePolicy sizePolicy(){
return QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding);
}
inline QSize sizeHint() const{
QSize widgetSize = ImagesDisplay->sizeHint();
widgetSize.scale(widgetSize.width()*1,widgetSize.height()*4,Qt::IgnoreAspectRatio);
qDebug()<<"The reccomended size is: "<<widgetSize;
return widgetSize;
}
private:
QLabel *lblNonEditImage=new QLabel();
QLabel *lblEditImage=new QLabel();
MediaListWidget *ImagesDisplay;
MediaListWidget *ImagesEdit;
QPushButton *AddImages = new QPushButton("Add Images");
QPushButton *RemoveImages= new QPushButton("Remove Images");
QVector<QSqlRecord> value;
void updateImages();
void retrieveValue();
private slots:
void addImages();
void removeImages();
void imagesChanged();
};
//Q_DECLARE_METATYPE(QVector<QSqlRecord>);
#endif // DISPLAYWIDGETIMAGES_H