Merge remote-tracking branch 'origin/master'
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@
|
|||||||
/project/
|
/project/
|
||||||
/src/styles/
|
/src/styles/
|
||||||
/cmake-build-release/
|
/cmake-build-release/
|
||||||
|
/bin/
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
|||||||
table->setColumnWidth(2,250);
|
table->setColumnWidth(2,250);
|
||||||
table->setColumnWidth(3,120);
|
table->setColumnWidth(3,120);
|
||||||
table->setColumnWidth(4,60);
|
table->setColumnWidth(4,60);
|
||||||
|
|
||||||
contentLayout->addWidget(table);
|
contentLayout->addWidget(table);
|
||||||
QWidget* spacerLine2= new QWidget(this);
|
QWidget* spacerLine2= new QWidget(this);
|
||||||
spacerLine2->setFixedWidth(2);
|
spacerLine2->setFixedWidth(2);
|
||||||
@@ -89,7 +90,18 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
|||||||
EditPatientForm* edit_patient= new EditPatientForm(this);
|
EditPatientForm* edit_patient= new EditPatientForm(this);
|
||||||
edit_patient->setObjectName("edit_patient");
|
edit_patient->setObjectName("edit_patient");
|
||||||
contentLayout->addWidget(edit_patient);
|
contentLayout->addWidget(edit_patient);
|
||||||
|
//select default row 0
|
||||||
|
if (model->rowCount()>0)
|
||||||
|
{
|
||||||
|
table->selectRow(0);
|
||||||
|
currentRow=0;
|
||||||
|
PatientInformation pat;
|
||||||
|
#define ADD_PATIENT_PROPERTY(val)\
|
||||||
|
pat. val = model->data(model->index(currentRow,PatientInformationEnum:: val)).toString();
|
||||||
|
EDIT_PATIENT()
|
||||||
|
#undef ADD_PATIENT_PROPERTY
|
||||||
|
edit_patient->setPatientInformation(&pat);
|
||||||
|
}
|
||||||
//events----------------------------------------------------------------------
|
//events----------------------------------------------------------------------
|
||||||
//table current row selection changing event
|
//table current row selection changing event
|
||||||
connect(table,&QTableView::clicked,[=](const QModelIndex & modelIndex){
|
connect(table,&QTableView::clicked,[=](const QModelIndex & modelIndex){
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ void LoginWindow::initUi()
|
|||||||
m_pVMainLayout->addSpacerItem(new QSpacerItem(20,20,QSizePolicy::Minimum,QSizePolicy::Expanding));
|
m_pVMainLayout->addSpacerItem(new QSpacerItem(20,20,QSizePolicy::Minimum,QSizePolicy::Expanding));
|
||||||
|
|
||||||
initUserList();
|
initUserList();
|
||||||
SQLHelper::Open();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginWindow::init()
|
void LoginWindow::init()
|
||||||
|
|||||||
15
src/main.cpp
15
src/main.cpp
@@ -3,6 +3,7 @@
|
|||||||
#include "loginwindow.h"
|
#include "loginwindow.h"
|
||||||
#include "InputObject.h"
|
#include "InputObject.h"
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
|
#include <src/db/SQLHelper.h>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -25,23 +26,21 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
//a.installEventFilter(obj);
|
//a.installEventFilter(obj);
|
||||||
InputObject *obj = new InputObject();
|
InputObject *obj = new InputObject();
|
||||||
|
|
||||||
a.installEventFilter(obj);
|
a.installEventFilter(obj);
|
||||||
|
SQLHelper::Open();
|
||||||
needLogin:
|
|
||||||
LoginWindow l;
|
|
||||||
l.showFullScreen();
|
|
||||||
|
|
||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
|
w.showFullScreen();
|
||||||
|
LoginWindow l;
|
||||||
|
needLogin:
|
||||||
|
l.showFullScreen();
|
||||||
int rec = l.exec();
|
int rec = l.exec();
|
||||||
if (rec !=QDialog::Accepted )
|
if (rec !=QDialog::Accepted )
|
||||||
{
|
{
|
||||||
goto needLogin;
|
goto needLogin;
|
||||||
}
|
}
|
||||||
// l.deleteLater();
|
// l.deleteLater();
|
||||||
|
w.centerWidgetShow();
|
||||||
|
|
||||||
w.showFullScreen();
|
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,9 +131,18 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
msgDialog->hide();
|
msgDialog->hide();
|
||||||
});
|
});
|
||||||
DeviceManager::Default()->initDevice();
|
DeviceManager::Default()->initDevice();
|
||||||
|
centerWidgetHide();
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::centerWidgetHide() {
|
||||||
|
ui->centralWidget->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::centerWidgetShow() {
|
||||||
|
ui->centralWidget->show();
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ class MainWindow : public QMainWindow
|
|||||||
public:
|
public:
|
||||||
explicit MainWindow(QWidget *parent = nullptr);
|
explicit MainWindow(QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
void centerWidgetHide();
|
||||||
|
void centerWidgetShow();
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
GUIMessageDialog* msgDialog = nullptr;
|
GUIMessageDialog* msgDialog = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user