This commit is contained in:
Krad
2022-02-14 09:57:21 +08:00
5 changed files with 145 additions and 39 deletions

74
cfgs/usct-product Normal file
View 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"
}
}

View File

@@ -20,6 +20,8 @@
#include <QSortFilterProxyModel>
#include "src/components/VerticalTextToolButton.h"
#include <QScroller>
#define ADD_CENTER_ITEM(row,col,text)\
item = new QTableWidgetItem(text);\
item->setTextAlignment(Qt::AlignmentFlag::AlignCenter);\
@@ -72,7 +74,9 @@ SelectFormWidget::SelectFormWidget(QWidget* parent) :
table->verticalHeader()->setDefaultSectionSize(38);
table->horizontalHeader()->setStretchLastSection(true);
//data from SQLITE
//
//avoid pan comsumed by tableview!
table->viewport()->ungrabGesture(Qt::PanGesture);
auto model = SQLHelper::getTable("Patient");
model->setFilter("Flag=0");

View File

@@ -72,6 +72,7 @@ int main(int argc, char* argv[])
//QObject::connect(obj, SIGNAL(touchScreen()), Locker::Instance(), SLOT(refreshTimer()));
QList<Qt::GestureType> gestures;
gestures << Qt::SwipeGesture;
gestures << Qt::PanGesture;
w.grabGestures(gestures);
QStringList app_args = a.arguments();

View File

@@ -303,30 +303,55 @@ bool MainWindow::gestureEvent(QGestureEvent* event)
//qCDebug(lcExample) << "gestureEvent():" << event;
if (QGesture* swipe = event->gesture(Qt::SwipeGesture))
swipeTriggered(static_cast<QSwipeGesture*>(swipe));
//else if (QGesture* pan = event->gesture(Qt::PanGesture))
//panTriggered(static_cast<QPanGesture*>(pan));
if (QGesture* pan = event->gesture(Qt::PanGesture))
panTriggered(static_cast<QPanGesture*>(pan));
//if (QGesture* pinch = event->gesture(Qt::PinchGesture))
//pinchTriggered(static_cast<QPinchGesture*>(pinch));
return true;
}
void MainWindow::swipeTriggered(QSwipeGesture* gesture)
void MainWindow::panTriggered(QPanGesture* gesture)
{
if (gesture->state() == Qt::GestureFinished) {
if (gesture->horizontalDirection() == QSwipeGesture::Right) {
QPointF delta = gesture->offset();
int index = tab->currentIndex();
if (delta.x() > 50) {
index--;
if (index >= 0) {
tab->setCurrentIndex(index);
}
}
if (gesture->horizontalDirection() == QSwipeGesture::Left) {
int index = tab->currentIndex();
if (delta.x() < -50)
{
index++;
if (index < tab->count()) {
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 (debugMode)
{

View File

@@ -15,6 +15,7 @@ class GUIMessageDialog;
class QTabWidget;
class QGestureEvent;
class QSwipeGesture;
class QPanGesture;
class QDockWidget;
class MainWindow : public QMainWindow
@@ -41,6 +42,7 @@ protected:
private:
bool gestureEvent(QGestureEvent* event);
void swipeTriggered(QSwipeGesture*);
void panTriggered(QPanGesture*);
void loadStyleSheet(const QString& sheetName);
cJSON* json_root = nullptr;