Subversion Repositories OpenInventory

Rev

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

Rev Author Line No. Line
29 pingvin 1
/************************************************************************************
2
**  MySQL       
3
** MySQL class contains methods for working with databases
4
**
5
**
6
*************************************************************************************/
7
 
8
 
9
 
10
 
11
 
12
 
13
#ifndef MYSQL_H
14
#define MYSQL_H
15
 
38 pingvin 16
#include "settingsdialog.h"
17
#include "tablefield.h"
18
#include "sqltable.h"
19
 
29 pingvin 20
#include <QObject>
21
#include <QtGui>
22
#include <QMainWindow>
23
#include <QString>
24
#include <QtSql>
25
#include <QSqlTableModel>
26
#include <QTableView>
27
#include <QSqlDriverPlugin>
28
#include <QIcon>
29
#include <QVariant>
30
#include <QProcess>
31
#include <QByteArray>
32
 
33
 
34
class MySql : public QObject
35
{
36
Q_OBJECT
37
public:
38
    explicit MySql(QObject *parent = 0);
39
 
44 pingvin 40
    bool connect(); //    
41 pingvin 41
 
29 pingvin 42
signals:
43
 
44
public slots:
45
 
46
private:
41 pingvin 47
    QString sqlDatabaseName; //     ,     
48
    QString sqlUserName; //      
49
    QString sqlPassword; //      
50
    QString sqlHostName; //    ,     
29 pingvin 51
    QSqlDatabase db;
52
 
53
protected:
54
 
55
public:
41 pingvin 56
    void setDatabaseName(QString dbname);
57
    void setUserName(QString uname);
58
    void setPassword(QString passwrd);
59
    void setHostName(QString hname);
44 pingvin 60
    bool createTable(SqlTable* table); //     
61
    QString mysqlLastError;
62
    QString lasError();
42 pingvin 63
 
29 pingvin 64
};
65
 
66
#endif // MYSQL_H