35 lines
683 B
C++
35 lines
683 B
C++
#ifndef WIDGET_H
|
|
#define WIDGET_H
|
|
|
|
#include <QGridLayout>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QPushButton>
|
|
#include <QSqlDatabase>
|
|
#include <QTextEdit>
|
|
#include <QWidget>
|
|
|
|
class Widget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Widget(QWidget *parent = nullptr);
|
|
~Widget();
|
|
|
|
private:
|
|
QSqlDatabase _db;
|
|
QGridLayout *_grid = nullptr;
|
|
QLabel *_countId = nullptr;
|
|
QLabel *_nameLabel = nullptr;
|
|
QLineEdit *_nameEdit = nullptr;
|
|
QLabel *_textLabel = nullptr;
|
|
QTextEdit *_textEdit = nullptr;
|
|
QPushButton *_addBtn = nullptr;
|
|
quint64 count = 0;
|
|
public slots:
|
|
void init(const QSqlDatabase &);
|
|
void addRecord();
|
|
};
|
|
#endif // WIDGET_H
|