Subversion Repositories OpenInventory

Rev

Rev 167 | 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
 
182 pingvin 46
void IconForm::on_pushButton_2_clicked(){          //    " "
165 pingvin 47
 
182 pingvin 48
    QPixmap pix_tmp;
49
    Pixmap = pix_tmp;
50
    ui->label->setPixmap(Pixmap);
51
    IconForm::fdataIsChanged = true;
52
 
53
   }
54
 
55
 
56
 
57
 
165 pingvin 58
void IconForm::setPixmap (QPixmap newPixmap){
59
Pixmap = newPixmap;
60
  ui->label->setPixmap(Pixmap);
61
 
62
}
63
 
64
 
65
QPixmap IconForm::pixmap (){
66
    return Pixmap;
67
}
167 pingvin 68
 
69
 
70
bool IconForm::dataIsChanged(){
71
    return IconForm::fdataIsChanged;
72
}
73
 
74
 
75
// void IconForm::clearPixmap(){}