Merge branch 'master' of http://localhost:3000/kradchen/GUI
This commit is contained in:
74
cfgs/usct-product
Normal file
74
cfgs/usct-product
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"login": {
|
||||||
|
"defaultUser": "usct"
|
||||||
|
},
|
||||||
|
"general": {
|
||||||
|
"defaultlanguage": "en_US",
|
||||||
|
"language": "zh_CN;en_US",
|
||||||
|
"institutionName": "",
|
||||||
|
"institutionAddr": "",
|
||||||
|
"lockscreen": "30"
|
||||||
|
},
|
||||||
|
"protocol": {
|
||||||
|
"default": "RSTAND",
|
||||||
|
"lists": "LSTAND;RSTAND;LONE;RONE"
|
||||||
|
},
|
||||||
|
"storagepolicy": {
|
||||||
|
"mininum": "85"
|
||||||
|
},
|
||||||
|
"lastlogin": {
|
||||||
|
"password": "",
|
||||||
|
"remember": "false",
|
||||||
|
"usercode": ""
|
||||||
|
},
|
||||||
|
"worklist": {
|
||||||
|
"ae": "",
|
||||||
|
"ip": "",
|
||||||
|
"name": "",
|
||||||
|
"port": ""
|
||||||
|
},
|
||||||
|
"pacs": {
|
||||||
|
"ae": "",
|
||||||
|
"ip": "",
|
||||||
|
"name": "",
|
||||||
|
"port": ""
|
||||||
|
},
|
||||||
|
"recon": {
|
||||||
|
"ae": "",
|
||||||
|
"ip": "",
|
||||||
|
"name": "",
|
||||||
|
"port": ""
|
||||||
|
},
|
||||||
|
"address": {
|
||||||
|
"device": "eth0",
|
||||||
|
"dhcp": "true",
|
||||||
|
"ip": "",
|
||||||
|
"mask": "",
|
||||||
|
"ae": "",
|
||||||
|
"name": "",
|
||||||
|
"port": "",
|
||||||
|
"additional": [{
|
||||||
|
"ip": "",
|
||||||
|
"netmask": ""
|
||||||
|
}, {
|
||||||
|
"ip": "",
|
||||||
|
"netmask": ""
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"routing": {
|
||||||
|
"defaultgateway": "",
|
||||||
|
"routingtable": [{
|
||||||
|
"destination": "",
|
||||||
|
"gateway": "",
|
||||||
|
"netmask": ""
|
||||||
|
}, {
|
||||||
|
"destination": "",
|
||||||
|
"gateway": "",
|
||||||
|
"netmask": ""
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
"worklistfilter": {
|
||||||
|
"default": "Today",
|
||||||
|
"lists": "Today;Recent3Days;ThisWeek;ThisMonth"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,8 @@
|
|||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include "src/components/VerticalTextToolButton.h"
|
#include "src/components/VerticalTextToolButton.h"
|
||||||
|
|
||||||
|
#include <QScroller>
|
||||||
|
|
||||||
#define ADD_CENTER_ITEM(row,col,text)\
|
#define ADD_CENTER_ITEM(row,col,text)\
|
||||||
item = new QTableWidgetItem(text);\
|
item = new QTableWidgetItem(text);\
|
||||||
item->setTextAlignment(Qt::AlignmentFlag::AlignCenter);\
|
item->setTextAlignment(Qt::AlignmentFlag::AlignCenter);\
|
||||||
@@ -61,7 +63,7 @@ SelectFormWidget::SelectFormWidget(QWidget* parent) :
|
|||||||
|
|
||||||
//Init content widget
|
//Init content widget
|
||||||
QHBoxLayout* contentLayout = new QHBoxLayout();
|
QHBoxLayout* contentLayout = new QHBoxLayout();
|
||||||
contentLayout->setContentsMargins(5,5,0,5);
|
contentLayout->setContentsMargins(5, 5, 0, 5);
|
||||||
this->ui->contentWidget->setLayout(contentLayout);
|
this->ui->contentWidget->setLayout(contentLayout);
|
||||||
// TableView for patient
|
// TableView for patient
|
||||||
QTableView* table = new SlideableTableView(this);
|
QTableView* table = new SlideableTableView(this);
|
||||||
@@ -72,7 +74,9 @@ SelectFormWidget::SelectFormWidget(QWidget* parent) :
|
|||||||
table->verticalHeader()->setDefaultSectionSize(38);
|
table->verticalHeader()->setDefaultSectionSize(38);
|
||||||
table->horizontalHeader()->setStretchLastSection(true);
|
table->horizontalHeader()->setStretchLastSection(true);
|
||||||
//data from SQLITE
|
//data from SQLITE
|
||||||
|
//
|
||||||
|
//avoid pan comsumed by tableview!
|
||||||
|
table->viewport()->ungrabGesture(Qt::PanGesture);
|
||||||
|
|
||||||
auto model = SQLHelper::getTable("Patient");
|
auto model = SQLHelper::getTable("Patient");
|
||||||
model->setFilter("Flag=0");
|
model->setFilter("Flag=0");
|
||||||
@@ -114,21 +118,21 @@ SelectFormWidget::SelectFormWidget(QWidget* parent) :
|
|||||||
edit_patient->hide();
|
edit_patient->hide();
|
||||||
contentLayout->addWidget(edit_patient);
|
contentLayout->addWidget(edit_patient);
|
||||||
|
|
||||||
auto *btnShowEdit = new VerticalTextToolButton(this);
|
auto* btnShowEdit = new VerticalTextToolButton(this);
|
||||||
btnShowEdit->setObjectName("showeditBtn");
|
btnShowEdit->setObjectName("showeditBtn");
|
||||||
btnShowEdit->setIcon(QIcon(":/icons/edit.png"));
|
btnShowEdit->setIcon(QIcon(":/icons/edit.png"));
|
||||||
btnShowEdit->setIconSize(QSize(30, 30));
|
btnShowEdit->setIconSize(QSize(30, 30));
|
||||||
btnShowEdit->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
btnShowEdit->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
|
||||||
btnShowEdit->setFixedHeight(225);
|
btnShowEdit->setFixedHeight(225);
|
||||||
// btnShowEdit->setVerticalText("E\nd\ni\nt\nP\na\nn\ne\nl");
|
// btnShowEdit->setVerticalText("E\nd\ni\nt\nP\na\nn\ne\nl");
|
||||||
btnShowEdit->setVerticalText("Patient Detail");
|
btnShowEdit->setVerticalText("Patient Detail");
|
||||||
contentLayout->addWidget(btnShowEdit);
|
contentLayout->addWidget(btnShowEdit);
|
||||||
contentLayout->setAlignment(btnShowEdit, Qt::AlignmentFlag::AlignTop);
|
contentLayout->setAlignment(btnShowEdit, Qt::AlignmentFlag::AlignTop);
|
||||||
connect(btnShowEdit,&QToolButton::clicked,[=](){
|
connect(btnShowEdit, &QToolButton::clicked, [=]() {
|
||||||
edit_patient->show();
|
edit_patient->show();
|
||||||
btnShowEdit->hide();
|
btnShowEdit->hide();
|
||||||
});
|
});
|
||||||
connect(edit_patient, &EditPatientForm::hideBtnClicked, [=](){
|
connect(edit_patient, &EditPatientForm::hideBtnClicked, [=]() {
|
||||||
edit_patient->hide();
|
edit_patient->hide();
|
||||||
btnShowEdit->show();
|
btnShowEdit->show();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ int main(int argc, char* argv[])
|
|||||||
//QObject::connect(obj, SIGNAL(touchScreen()), Locker::Instance(), SLOT(refreshTimer()));
|
//QObject::connect(obj, SIGNAL(touchScreen()), Locker::Instance(), SLOT(refreshTimer()));
|
||||||
QList<Qt::GestureType> gestures;
|
QList<Qt::GestureType> gestures;
|
||||||
gestures << Qt::SwipeGesture;
|
gestures << Qt::SwipeGesture;
|
||||||
|
gestures << Qt::PanGesture;
|
||||||
w.grabGestures(gestures);
|
w.grabGestures(gestures);
|
||||||
|
|
||||||
QStringList app_args = a.arguments();
|
QStringList app_args = a.arguments();
|
||||||
|
|||||||
@@ -303,30 +303,55 @@ bool MainWindow::gestureEvent(QGestureEvent* event)
|
|||||||
//qCDebug(lcExample) << "gestureEvent():" << event;
|
//qCDebug(lcExample) << "gestureEvent():" << event;
|
||||||
if (QGesture* swipe = event->gesture(Qt::SwipeGesture))
|
if (QGesture* swipe = event->gesture(Qt::SwipeGesture))
|
||||||
swipeTriggered(static_cast<QSwipeGesture*>(swipe));
|
swipeTriggered(static_cast<QSwipeGesture*>(swipe));
|
||||||
//else if (QGesture* pan = event->gesture(Qt::PanGesture))
|
if (QGesture* pan = event->gesture(Qt::PanGesture))
|
||||||
//panTriggered(static_cast<QPanGesture*>(pan));
|
panTriggered(static_cast<QPanGesture*>(pan));
|
||||||
//if (QGesture* pinch = event->gesture(Qt::PinchGesture))
|
//if (QGesture* pinch = event->gesture(Qt::PinchGesture))
|
||||||
//pinchTriggered(static_cast<QPinchGesture*>(pinch));
|
//pinchTriggered(static_cast<QPinchGesture*>(pinch));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void MainWindow::swipeTriggered(QSwipeGesture* gesture)
|
|
||||||
|
void MainWindow::panTriggered(QPanGesture* gesture)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (gesture->state() == Qt::GestureFinished) {
|
if (gesture->state() == Qt::GestureFinished) {
|
||||||
if (gesture->horizontalDirection() == QSwipeGesture::Right) {
|
QPointF delta = gesture->offset();
|
||||||
int index = tab->currentIndex();
|
int index = tab->currentIndex();
|
||||||
|
if (delta.x() > 50) {
|
||||||
|
|
||||||
index--;
|
index--;
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
tab->setCurrentIndex(index);
|
tab->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (gesture->horizontalDirection() == QSwipeGesture::Left) {
|
if (delta.x() < -50)
|
||||||
int index = tab->currentIndex();
|
{
|
||||||
index++;
|
index++;
|
||||||
if (index < tab->count()) {
|
if (index < tab->count()) {
|
||||||
tab->setCurrentIndex(index);
|
tab->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
qDebug() << "panTriggered" << index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void MainWindow::swipeTriggered(QSwipeGesture* gesture)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (gesture->state() == Qt::GestureFinished) {
|
||||||
|
//if (gesture->horizontalDirection() == QSwipeGesture::Right) {
|
||||||
|
// int index = tab->currentIndex();
|
||||||
|
// index--;
|
||||||
|
// if (index >= 0) {
|
||||||
|
// tab->setCurrentIndex(index);
|
||||||
|
// }
|
||||||
|
|
||||||
|
//}
|
||||||
|
//if (gesture->horizontalDirection() == QSwipeGesture::Left) {
|
||||||
|
// int index = tab->currentIndex();
|
||||||
|
// index++;
|
||||||
|
// if (index < tab->count()) {
|
||||||
|
// tab->setCurrentIndex(index);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
if (gesture->verticalDirection() == QSwipeGesture::Down) {
|
if (gesture->verticalDirection() == QSwipeGesture::Down) {
|
||||||
if (debugMode)
|
if (debugMode)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ class GUIMessageDialog;
|
|||||||
class QTabWidget;
|
class QTabWidget;
|
||||||
class QGestureEvent;
|
class QGestureEvent;
|
||||||
class QSwipeGesture;
|
class QSwipeGesture;
|
||||||
|
class QPanGesture;
|
||||||
class QDockWidget;
|
class QDockWidget;
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
@@ -41,6 +42,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
bool gestureEvent(QGestureEvent* event);
|
bool gestureEvent(QGestureEvent* event);
|
||||||
void swipeTriggered(QSwipeGesture*);
|
void swipeTriggered(QSwipeGesture*);
|
||||||
|
void panTriggered(QPanGesture*);
|
||||||
void loadStyleSheet(const QString& sheetName);
|
void loadStyleSheet(const QString& sheetName);
|
||||||
cJSON* json_root = nullptr;
|
cJSON* json_root = nullptr;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user