Merge remote-tracking branch 'origin/master'
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,4 +4,5 @@
|
||||
/src/ShimLib/ShimLib.c
|
||||
/project/
|
||||
/src/styles/
|
||||
/cmake-build-release/
|
||||
/cmake-build-release/
|
||||
/bin/
|
||||
|
||||
@@ -80,6 +80,7 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
table->setColumnWidth(2,250);
|
||||
table->setColumnWidth(3,120);
|
||||
table->setColumnWidth(4,60);
|
||||
|
||||
contentLayout->addWidget(table);
|
||||
QWidget* spacerLine2= new QWidget(this);
|
||||
spacerLine2->setFixedWidth(2);
|
||||
@@ -89,7 +90,18 @@ SelectFormWidget::SelectFormWidget(QWidget *parent) :
|
||||
EditPatientForm* edit_patient= new EditPatientForm(this);
|
||||
edit_patient->setObjectName("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----------------------------------------------------------------------
|
||||
//table current row selection changing event
|
||||
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));
|
||||
|
||||
initUserList();
|
||||
SQLHelper::Open();
|
||||
}
|
||||
|
||||
void LoginWindow::init()
|
||||
|
||||
15
src/main.cpp
15
src/main.cpp
@@ -3,6 +3,7 @@
|
||||
#include "loginwindow.h"
|
||||
#include "InputObject.h"
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <src/db/SQLHelper.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -25,23 +26,21 @@ int main(int argc, char *argv[])
|
||||
|
||||
//a.installEventFilter(obj);
|
||||
InputObject *obj = new InputObject();
|
||||
|
||||
a.installEventFilter(obj);
|
||||
|
||||
needLogin:
|
||||
LoginWindow l;
|
||||
l.showFullScreen();
|
||||
|
||||
|
||||
SQLHelper::Open();
|
||||
MainWindow w;
|
||||
w.showFullScreen();
|
||||
LoginWindow l;
|
||||
needLogin:
|
||||
l.showFullScreen();
|
||||
int rec = l.exec();
|
||||
if (rec !=QDialog::Accepted )
|
||||
{
|
||||
goto needLogin;
|
||||
}
|
||||
// l.deleteLater();
|
||||
w.centerWidgetShow();
|
||||
|
||||
w.showFullScreen();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
@@ -131,9 +131,18 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
msgDialog->hide();
|
||||
});
|
||||
DeviceManager::Default()->initDevice();
|
||||
centerWidgetHide();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void MainWindow::centerWidgetHide() {
|
||||
ui->centralWidget->hide();
|
||||
}
|
||||
|
||||
void MainWindow::centerWidgetShow() {
|
||||
ui->centralWidget->show();
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ class MainWindow : public QMainWindow
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
void centerWidgetHide();
|
||||
void centerWidgetShow();
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
GUIMessageDialog* msgDialog = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user