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->setupUi(this);
|
||||
Manager* manager = new Manager();
|
||||
manager = new Manager();
|
||||
|
||||
}
|
||||
|
||||
@ -39,6 +39,13 @@ void MainWindow::initAppWithDatabaseFile(const QString &dbFileFullPath) {
|
||||
if (dbFileFullPath.isEmpty()) return;
|
||||
}
|
||||
|
||||
void MainWindow::on_addButton_clicked()
|
||||
{
|
||||
std::cout << "add" << std::endl;
|
||||
Record* record = new Record();
|
||||
manager->putRecord(record);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
#include "manager.h"
|
||||
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
@ -18,6 +20,7 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
Manager* manager;
|
||||
Ui::MainWindow *ui;
|
||||
static const QString fileDialogFilterString;
|
||||
|
||||
@ -27,6 +30,7 @@ private slots:
|
||||
void on_actionCreateNewDatabase_triggered();
|
||||
|
||||
void on_actionOpenDatabase_triggered();
|
||||
void on_addButton_clicked();
|
||||
|
||||
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<string>Оконное приложение, управляющее БД</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<widget class="QTableView" name="tableViewEmployees">
|
||||
<widget class="QTableView" name="tableViewRecords">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -37,6 +37,58 @@
|
||||
</rect>
|
||||
</property>
|
||||
</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 class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
|
||||
@ -9,7 +9,7 @@ void Manager::init(){}
|
||||
Record* Manager::getRecord() const{
|
||||
return nullptr;
|
||||
}
|
||||
void Manager::putRecord(){}
|
||||
void Manager::putRecord(Record* record){}
|
||||
void Manager::updateRecord(){}
|
||||
void Manager::deleteRecord(){}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ public:
|
||||
Manager();
|
||||
void init();
|
||||
Record* getRecord() const;
|
||||
void putRecord();
|
||||
void putRecord(Record* record);
|
||||
void updateRecord();
|
||||
void deleteRecord();
|
||||
void connectToDatabase(const QString &dbName);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user