Subversion Repositories OpenInventory

Rev

Rev 165 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
163 pingvin 1
#include "iconform.h"
2
#include "ui_iconform.h"
165 pingvin 3
#include "classeditor.h"
163 pingvin 4
 
165 pingvin 5
 
163 pingvin 6
IconForm::IconForm(QWidget *parent) :
7
    QWidget(parent),
8
    ui(new Ui::IconForm)
9
{
10
    ui->setupUi(this);
167 pingvin 11
    IconForm::fdataIsChanged = false;
163 pingvin 12
}
13
 
14
IconForm::~IconForm()
15
{
16
    delete ui;
17
}
18
 
19
void IconForm::changeEvent(QEvent *e)
20
{
21
    QWidget::changeEvent(e);
22
    switch (e->type()) {
23
    case QEvent::LanguageChange:
24
        ui->retranslateUi(this);
25
        break;
26
    default:
27
        break;
28
    }
29
}
165 pingvin 30
 
31
 
32
void IconForm::on_pushButton_clicked(){          //    " "
33
 
34
    QString  fileName;
35
        fileName = QFileDialog::getOpenFileName(this,
36
         tr("Open Image"), "", tr("Image Files (*.png *.jpg *.bmp)"));
37
 
38
    if (fileName.isEmpty()) return;
39
    Pixmap.load(fileName);
40
 
41
    ui->label->setPixmap(Pixmap);
167 pingvin 42
    IconForm::fdataIsChanged = true;
165 pingvin 43
//    IconForm::close();
44
}
45
 
46
 
47
void IconForm::setPixmap (QPixmap newPixmap){
48
Pixmap = newPixmap;
49
  ui->label->setPixmap(Pixmap);
50
 
51
}
52
 
53
 
54
QPixmap IconForm::pixmap (){
55
    return Pixmap;
56
}
167 pingvin 57
 
58
 
59
bool IconForm::dataIsChanged(){
60
    return IconForm::fdataIsChanged;
61
}
62
 
63
 
64
// void IconForm::clearPixmap(){}