Subversion Repositories OpenInventory

Rev

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

Rev Author Line No. Line
24 pingvin 1
#include "classeditor.h"
2
#include "ui_classeditor.h"
3
 
4
ClassEditor::ClassEditor(QWidget *parent) :
5
    QMainWindow(parent),
6
    ui(new Ui::ClassEditor)
7
{
8
    ui->setupUi(this);
9
//    settdialog = new SettingsDialog(this);
10
    settdialog.show();
11
    sql.setDatabaseName(tr("an_db"));
35 pingvin 12
    field = new TableField(tr(""), this);
38 pingvin 13
    field->setNotNull(true);
35 pingvin 14
    field->setDefaultValue(tr(""));
33 pingvin 15
 
38 pingvin 16
    table = new SqlTable (tr("NewTable"), this);
17
    table->setName(tr("NewTable"));
39 pingvin 18
    table->fields().at(0)->setNotNull(true);
19
    if (!(table->setPrimaryKey(tr("ID")))) {
20
         ui->label_3->setText(table->lastError());
21
    }
22
    else  ui->label_3->setText(table->primaryKey());
23
    table->append(field);
24
 
25
    field = new TableField(tr(""), this);
26
    field->setNotNull(true);
27
    field->setDefaultValue(tr(""));
28
    table->append(field);
29
 
38 pingvin 30
    ui->label_2->setText(table->name());
31
    ui->label->setText(table->fields().at(0)->sqlString());
39 pingvin 32
    ui->label_4->setText(table->sqlString());
33
    ui->lineEdit->insert(table->sqlString());
38 pingvin 34
 
24 pingvin 35
}
36
 
37
ClassEditor::~ClassEditor()
38
{
39
    delete ui;
38 pingvin 40
 //    delete field;
24 pingvin 41
   // delete settdialog;
42
}
43
 
44
void ClassEditor::changeEvent(QEvent *e)
45
{
46
    QMainWindow::changeEvent(e);
47
    switch (e->type()) {
48
    case QEvent::LanguageChange:
49
        ui->retranslateUi(this);
50
        break;
51
    default:
52
        break;
53
    }
54
}