addButton actionListener created
This commit is contained in:
parent
f21b270cef
commit
58d04899a0
@ -15,7 +15,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
, ui(new Ui::MainWindow)
|
, ui(new Ui::MainWindow)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
Manager* manager = new Manager();
|
manager = new Manager();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,6 +39,13 @@ void MainWindow::initAppWithDatabaseFile(const QString &dbFileFullPath) {
|
|||||||
if (dbFileFullPath.isEmpty()) return;
|
if (dbFileFullPath.isEmpty()) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_addButton_clicked()
|
||||||
|
{
|
||||||
|
std::cout << "add" << std::endl;
|
||||||
|
Record* record = new Record();
|
||||||
|
manager->putRecord(record);
|
||||||
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
#include "manager.h"
|
||||||
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
namespace Ui { class MainWindow; }
|
namespace Ui { class MainWindow; }
|
||||||
@ -18,6 +20,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Manager* manager;
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
static const QString fileDialogFilterString;
|
static const QString fileDialogFilterString;
|
||||||
|
|
||||||
@ -27,6 +30,7 @@ private slots:
|
|||||||
void on_actionCreateNewDatabase_triggered();
|
void on_actionCreateNewDatabase_triggered();
|
||||||
|
|
||||||
void on_actionOpenDatabase_triggered();
|
void on_actionOpenDatabase_triggered();
|
||||||
|
void on_addButton_clicked();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<string>Оконное приложение, управляющее БД</string>
|
<string>Оконное приложение, управляющее БД</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralWidget">
|
<widget class="QWidget" name="centralWidget">
|
||||||
<widget class="QTableView" name="tableViewEmployees">
|
<widget class="QTableView" name="tableViewRecords">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -37,6 +37,58 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="ToolGroup">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>249</x>
|
||||||
|
<y>369</y>
|
||||||
|
<width>541</width>
|
||||||
|
<height>41</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>GroupBox</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="addButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>26</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Add</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="deleteButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>80</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>26</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Delete</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="editButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>160</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>26</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Edit</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menuBar">
|
<widget class="QMenuBar" name="menuBar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
|
|||||||
@ -9,7 +9,7 @@ void Manager::init(){}
|
|||||||
Record* Manager::getRecord() const{
|
Record* Manager::getRecord() const{
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
void Manager::putRecord(){}
|
void Manager::putRecord(Record* record){}
|
||||||
void Manager::updateRecord(){}
|
void Manager::updateRecord(){}
|
||||||
void Manager::deleteRecord(){}
|
void Manager::deleteRecord(){}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ public:
|
|||||||
Manager();
|
Manager();
|
||||||
void init();
|
void init();
|
||||||
Record* getRecord() const;
|
Record* getRecord() const;
|
||||||
void putRecord();
|
void putRecord(Record* record);
|
||||||
void updateRecord();
|
void updateRecord();
|
||||||
void deleteRecord();
|
void deleteRecord();
|
||||||
void connectToDatabase(const QString &dbName);
|
void connectToDatabase(const QString &dbName);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user