Compare commits
76 Commits
8ffaf0f54f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ccded404a | |||
| 8ab2ba82c0 | |||
| 7e993e2a77 | |||
| c5f64d5a6b | |||
| 69828cbb54 | |||
| cac2b0b341 | |||
| cdb542eb88 | |||
| 87f0b2d34b | |||
| 2869d15a26 | |||
| bdcee52537 | |||
| 13e4fd22fb | |||
| 1311b3ee41 | |||
| e24034d65a | |||
| d1d37cce03 | |||
| 75ef0be3cc | |||
| 783971a4bd | |||
| 29178e2e39 | |||
| 7d331f1760 | |||
| 17cd657ff1 | |||
| 034fdb33ae | |||
| 84e020c26e | |||
| bbc85f17b3 | |||
| 8ab55f9e73 | |||
| 8dba3771c6 | |||
| 281d41769a | |||
| 2200e0e22f | |||
| 2bcefa52d4 | |||
| 1aee19e19e | |||
| 1f189d8036 | |||
| 7dc8b59aa2 | |||
| e53ad5903c | |||
| d78da30964 | |||
| a72e1e657d | |||
| 615e83ce3c | |||
| 85daf3be65 | |||
| a40a56b260 | |||
| 8d3c88df70 | |||
| e8406eb972 | |||
| 986e3cdfea | |||
| b37d200823 | |||
| 5122686119 | |||
| cbe3be40b9 | |||
| 4c89cb3e19 | |||
| 2f06dbc3e5 | |||
| ffd5932c72 | |||
| 33b4071251 | |||
| 6f4e11d448 | |||
| 3e020719b0 | |||
| 45ad0e67aa | |||
| 9ba7a28d79 | |||
| d4d6534204 | |||
| 1f3e167cc7 | |||
| 9d5f7fc796 | |||
| caf362554a | |||
| fe31214665 | |||
| b9e7314042 | |||
| e94d92aeec | |||
| a25057fa35 | |||
| e57bbaf79f | |||
| 8a68ef046d | |||
| 13eef834b9 | |||
| fb49dac74f | |||
| 51f7c2a47c | |||
| ab2982a00b | |||
| 5d1c1b6c98 | |||
| 6cd4db6d95 | |||
| 146435f74a | |||
| 67613e3068 | |||
| 3149499fba | |||
| 4701869d39 | |||
| 19fd6cd93b | |||
| c7deb85b31 | |||
| 1bd1ddba88 | |||
| f6528367d6 | |||
| 3dc5980093 | |||
| e21be2e33b |
BIN
bin/Qt5Sql.dll
Normal file
131
bin/defaultstyle.qss
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
/*title对应的qss 以及主窗口framewindows的背景*/
|
||||||
|
QWidget#title,#FrameWindow{background-color:#ffffff;}
|
||||||
|
QLabel#titleDes{font-size: 45px;font-weight: 500;font-family: 思源黑体;color:#0D9DDB;background-color: transparent;}
|
||||||
|
QLabel#titleSystemName{font-size: 45px;font-weight: 500;font-family: 思源黑体;color:#555555;background-color: transparent;}
|
||||||
|
QPushButton#titleBtn{border-image:url(:/image/icon_exit.png);border-radius: 40px;background-color: #EEF7FD;}
|
||||||
|
QPushButton#titleBtn:hover{border-image:url(:/image/icon_exit_hover.png);border-radius: 40px;}
|
||||||
|
QPushButton#titleBtn:pressed{border-image:url(:/image/icon_exit_checked.png);border-radius: 40px;}
|
||||||
|
|
||||||
|
MainBtn{border-image:url(:/image/index_bg_setting.png);background-color: transparent;}
|
||||||
|
MainBtn:hover{border-image:url(:/image/index_bg_setting_hover.png);}
|
||||||
|
MainBtn:pressed{border-image:url(:/image/index_bg_setting_checked.png);}
|
||||||
|
|
||||||
|
QLabel#MainTxt{font-size: 60px;font-weight: 500;color:white;background-color: transparent;}
|
||||||
|
QLabel#MainTxtEn{font-size: 60px;font-weight:normal;color:white;background-color: transparent;}
|
||||||
|
|
||||||
|
QWidget#parasetting{background-color:white;border-radius: 10px;}
|
||||||
|
/*导联方案*/
|
||||||
|
|
||||||
|
QLabel#labSchemeNum,#labSchemePoints,#labSchemePointsparam{font-family: 思源黑体;font-size: 26px;font-weight: 500;color:#054578;}
|
||||||
|
QLabel#labScheme{font-family: 思源黑体;font-size: 32px;font-weight: 500;color: #0D9DDB;}
|
||||||
|
QLabel#labDesShec{font-family: Source Han Sans;font-size: 16px;font-weight: 500;color: #999999;}
|
||||||
|
QLabel#labhospitalName,#labSection,#labUserNum,#labDataBaseName,#labUser,#labpasswd,#labRepasswd{font-family: Source Han Sans;font-size: 28px;font-weight: normal;color: #555555;}
|
||||||
|
/*填写病历*/
|
||||||
|
QLabel#labStar{color:red;}
|
||||||
|
QLabel#labCheckNum{font-family: Source Han Sans;font-size: 28px;font-weight: normal;color: #555555;}
|
||||||
|
QRadioButton#labCheckNum{font-family: Source Han Sans;font-size: 28px;font-weight: normal;color: #555555;}
|
||||||
|
QLineEdit
|
||||||
|
{
|
||||||
|
border:1px solid #cccccc;
|
||||||
|
background: #F5F7F9;
|
||||||
|
border-radius: 12px;
|
||||||
|
width: 400px;
|
||||||
|
font-family: Source Han Sans;font-size: 28px;font-weight: normal;color: #999999;
|
||||||
|
height: 60px;padding: 5px 20px;
|
||||||
|
}
|
||||||
|
/*病历管理*/
|
||||||
|
QHeaderView::section{font-family: 思源黑体;font-size: 28px;font-weight: 500;color: #054578;}
|
||||||
|
QLineEdit:hover
|
||||||
|
{
|
||||||
|
border: 1px solid #298DFF;
|
||||||
|
border-radius: 3px;
|
||||||
|
background-color: #F2F2F2;
|
||||||
|
color: #298DFF;
|
||||||
|
selection-background-color: #298DFF;
|
||||||
|
selection-color: #F2F2F2;
|
||||||
|
}
|
||||||
|
QTableWidget
|
||||||
|
{
|
||||||
|
font-family: Source Han Sans;
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
QLineEdit[echoMode="2"]
|
||||||
|
{
|
||||||
|
lineedit-password-character: 9679;
|
||||||
|
lineedit-password-mask-delay: 2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit:disabled
|
||||||
|
{
|
||||||
|
border: 1px solid #CDCDCD;
|
||||||
|
background-color: #CDCDCD;
|
||||||
|
color: #B4B4B4;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit:read-only
|
||||||
|
{
|
||||||
|
background-color: #CDCDCD;
|
||||||
|
color: #F2F2F2;
|
||||||
|
}
|
||||||
|
QTextEdit
|
||||||
|
{
|
||||||
|
color: black;
|
||||||
|
background-color: white;
|
||||||
|
border:1px solid black;
|
||||||
|
}
|
||||||
|
QGroupBox
|
||||||
|
{
|
||||||
|
background-color: #4F4F4F;
|
||||||
|
border: 1px solid #969696;
|
||||||
|
color: rgb(13,157,219);
|
||||||
|
border-radius: 5px;
|
||||||
|
margin-top: 2ex;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#ok,#cancel
|
||||||
|
{
|
||||||
|
font-family: 思源黑体;
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #0D9DDB;
|
||||||
|
border:1px solid black;
|
||||||
|
background: background: #FFFFFF;;
|
||||||
|
border-radius:12px;
|
||||||
|
padding:7px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QPushButton#open
|
||||||
|
{
|
||||||
|
background: white;
|
||||||
|
border-radius:10px;
|
||||||
|
padding:7px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#open
|
||||||
|
:hover
|
||||||
|
{
|
||||||
|
background: rgb(85, 85, 85);
|
||||||
|
border-radius:10px;
|
||||||
|
padding:7px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#open
|
||||||
|
:pressed
|
||||||
|
{
|
||||||
|
background: rgb(80, 80, 80);
|
||||||
|
border-radius:10px;
|
||||||
|
padding:7px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPushButton#open
|
||||||
|
:checked
|
||||||
|
{
|
||||||
|
background: #0d9ddb;
|
||||||
|
border-radius:10px;
|
||||||
|
padding:7px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BIN
bin/sqldrivers/qsqlite.dll
Normal file
BIN
bin/sqldrivers/qsqlited.dll
Normal file
BIN
bin/sqldrivers/qsqlodbc.dll
Normal file
BIN
bin/sqldrivers/qsqlodbcd.dll
Normal file
BIN
bin/sqldrivers/qsqlpsql.dll
Normal file
BIN
bin/sqldrivers/qsqlpsqld.dll
Normal file
418
xyylMCWEACSystem/MoveButton.cpp
Normal file
@@ -0,0 +1,418 @@
|
|||||||
|
#pragma execution_character_set("utf-8")
|
||||||
|
|
||||||
|
#include "MoveButton.h"
|
||||||
|
#include "qpainter.h"
|
||||||
|
#include "qevent.h"
|
||||||
|
#include "qtimer.h"
|
||||||
|
#include "qdebug.h"
|
||||||
|
|
||||||
|
MoveButton::MoveButton(QWidget *parent) : QWidget(parent)
|
||||||
|
{
|
||||||
|
text = "";
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
|
||||||
|
borderOutColorStart = QColor(255, 255, 255);
|
||||||
|
borderOutColorEnd = QColor(166, 166, 166);
|
||||||
|
|
||||||
|
borderInColorStart = QColor(166, 166, 166);
|
||||||
|
borderInColorEnd = QColor(255, 255, 255);
|
||||||
|
|
||||||
|
bgColor = QColor(100, 184, 255);
|
||||||
|
|
||||||
|
showRect = false;
|
||||||
|
showOverlay = true;
|
||||||
|
overlayColor = QColor(255, 255, 255);
|
||||||
|
|
||||||
|
canMove = false;
|
||||||
|
this->installEventFilter(this);
|
||||||
|
|
||||||
|
timerAlarm = new QTimer(this);
|
||||||
|
connect(timerAlarm, SIGNAL(timeout()), this, SLOT(alarm()));
|
||||||
|
timerAlarm->setInterval(500);
|
||||||
|
|
||||||
|
//setFont(QFont("Arial", 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MoveButton::eventFilter(QObject *watched, QEvent *event)
|
||||||
|
{
|
||||||
|
if (canMove) {
|
||||||
|
static QPoint lastPnt;
|
||||||
|
static bool pressed = false;
|
||||||
|
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||||
|
|
||||||
|
if (mouseEvent->type() == QEvent::MouseButtonPress) {
|
||||||
|
if (this->rect().contains(mouseEvent->pos()) && (mouseEvent->button() == Qt::LeftButton)) {
|
||||||
|
lastPnt = mouseEvent->pos();
|
||||||
|
pressed = true;
|
||||||
|
}
|
||||||
|
} else if (mouseEvent->type() == QEvent::MouseMove && pressed) {
|
||||||
|
int dx = mouseEvent->pos().x() - lastPnt.x();
|
||||||
|
int dy = mouseEvent->pos().y() - lastPnt.y();
|
||||||
|
this->move(this->x() + dx, this->y() + dy);
|
||||||
|
} else if (mouseEvent->type() == QEvent::MouseButtonRelease && pressed) {
|
||||||
|
pressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QWidget::eventFilter(watched, event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::paintEvent(QPaintEvent *)
|
||||||
|
{
|
||||||
|
int width = this->width();
|
||||||
|
int height = this->height();
|
||||||
|
int side = qMin(width, height);
|
||||||
|
|
||||||
|
//绘制准备工作,启用反锯齿,平移坐标轴中心,等比例缩放
|
||||||
|
QPainter painter(this);
|
||||||
|
painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
|
||||||
|
|
||||||
|
if (showRect) {
|
||||||
|
//绘制矩形区域
|
||||||
|
painter.setPen(Qt::NoPen);
|
||||||
|
painter.setBrush(bgColor);
|
||||||
|
painter.drawRoundedRect(this->rect(), 5, 5);
|
||||||
|
|
||||||
|
//绘制文字
|
||||||
|
if (!text.isEmpty()) {
|
||||||
|
QFont font;
|
||||||
|
font.setPixelSize(side - 20);
|
||||||
|
painter.setFont(font);
|
||||||
|
painter.setPen(textColor);
|
||||||
|
painter.drawText(this->rect(), Qt::AlignCenter, text);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
painter.translate(width / 2, height / 2);
|
||||||
|
painter.scale(side / 200.0, side / 200.0);
|
||||||
|
|
||||||
|
//绘制外边框
|
||||||
|
drawBorderOut(&painter);
|
||||||
|
//绘制内边框
|
||||||
|
drawBorderIn(&painter);
|
||||||
|
//绘制内部指示颜色
|
||||||
|
drawBg(&painter);
|
||||||
|
//绘制居中文字
|
||||||
|
drawText(&painter);
|
||||||
|
//绘制遮罩层
|
||||||
|
drawOverlay(&painter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::drawBorderOut(QPainter *painter)
|
||||||
|
{
|
||||||
|
int radius = 99;
|
||||||
|
painter->save();
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
QLinearGradient borderGradient(0, -radius, 0, radius);
|
||||||
|
borderGradient.setColorAt(0, borderOutColorStart);
|
||||||
|
borderGradient.setColorAt(1, borderOutColorEnd);
|
||||||
|
painter->setBrush(borderGradient);
|
||||||
|
painter->drawEllipse(-radius, -radius, radius * 2, radius * 2);
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::drawBorderIn(QPainter *painter)
|
||||||
|
{
|
||||||
|
int radius = 90;
|
||||||
|
painter->save();
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
QLinearGradient borderGradient(0, -radius, 0, radius);
|
||||||
|
borderGradient.setColorAt(0, borderInColorStart);
|
||||||
|
borderGradient.setColorAt(1, borderInColorEnd);
|
||||||
|
painter->setBrush(borderGradient);
|
||||||
|
painter->drawEllipse(-radius, -radius, radius * 2, radius * 2);
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::drawBg(QPainter *painter)
|
||||||
|
{
|
||||||
|
int radius = 80;
|
||||||
|
painter->save();
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
painter->setBrush(bgColor);
|
||||||
|
painter->drawEllipse(-radius, -radius, radius * 2, radius * 2);
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::drawText(QPainter *painter)
|
||||||
|
{
|
||||||
|
if (text.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int radius = 100;
|
||||||
|
painter->save();
|
||||||
|
|
||||||
|
QFont font;
|
||||||
|
font.setPixelSize(85);
|
||||||
|
painter->setFont(font);
|
||||||
|
painter->setPen(textColor);
|
||||||
|
QRect rect(-radius, -radius, radius * 2, radius * 2);
|
||||||
|
painter->drawText(rect, Qt::AlignCenter, text);
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::drawOverlay(QPainter *painter)
|
||||||
|
{
|
||||||
|
if (!showOverlay) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int radius = 80;
|
||||||
|
painter->save();
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
|
||||||
|
QPainterPath smallCircle;
|
||||||
|
QPainterPath bigCircle;
|
||||||
|
radius -= 1;
|
||||||
|
smallCircle.addEllipse(-radius, -radius, radius * 2, radius * 2);
|
||||||
|
radius *= 2;
|
||||||
|
bigCircle.addEllipse(-radius, -radius + 140, radius * 2, radius * 2);
|
||||||
|
|
||||||
|
//高光的形状为小圆扣掉大圆的部分
|
||||||
|
QPainterPath highlight = smallCircle - bigCircle;
|
||||||
|
|
||||||
|
QLinearGradient linearGradient(0, -radius / 2, 0, 0);
|
||||||
|
overlayColor.setAlpha(100);
|
||||||
|
linearGradient.setColorAt(0.0, overlayColor);
|
||||||
|
overlayColor.setAlpha(30);
|
||||||
|
linearGradient.setColorAt(1.0, overlayColor);
|
||||||
|
painter->setBrush(linearGradient);
|
||||||
|
painter->rotate(-20);
|
||||||
|
painter->drawPath(highlight);
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString MoveButton::getText() const
|
||||||
|
{
|
||||||
|
return this->text;
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor MoveButton::getTextColor() const
|
||||||
|
{
|
||||||
|
return this->textColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor MoveButton::getBorderOutColorStart() const
|
||||||
|
{
|
||||||
|
return this->borderOutColorStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor MoveButton::getBorderOutColorEnd() const
|
||||||
|
{
|
||||||
|
return this->borderOutColorEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor MoveButton::getBorderInColorStart() const
|
||||||
|
{
|
||||||
|
return this->borderInColorStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor MoveButton::getBorderInColorEnd() const
|
||||||
|
{
|
||||||
|
return this->borderInColorEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor MoveButton::getBgColor() const
|
||||||
|
{
|
||||||
|
return this->bgColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MoveButton::getCanMove() const
|
||||||
|
{
|
||||||
|
return this->canMove;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MoveButton::getShowRect() const
|
||||||
|
{
|
||||||
|
return this->showRect;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MoveButton::getShowOverlay() const
|
||||||
|
{
|
||||||
|
return this->showOverlay;
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor MoveButton::getOverlayColor() const
|
||||||
|
{
|
||||||
|
return this->overlayColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize MoveButton::sizeHint() const
|
||||||
|
{
|
||||||
|
return QSize(100, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize MoveButton::minimumSizeHint() const
|
||||||
|
{
|
||||||
|
return QSize(10, 10);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setText(const QString &text)
|
||||||
|
{
|
||||||
|
if (this->text != text) {
|
||||||
|
this->text = text;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setTextColor(const QColor &textColor)
|
||||||
|
{
|
||||||
|
if (this->textColor != textColor) {
|
||||||
|
this->textColor = textColor;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setBorderOutColorStart(const QColor &borderOutColorStart)
|
||||||
|
{
|
||||||
|
if (this->borderOutColorStart != borderOutColorStart) {
|
||||||
|
this->borderOutColorStart = borderOutColorStart;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setBorderOutColorEnd(const QColor &borderOutColorEnd)
|
||||||
|
{
|
||||||
|
if (this->borderOutColorEnd != borderOutColorEnd) {
|
||||||
|
this->borderOutColorEnd = borderOutColorEnd;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setBorderInColorStart(const QColor &borderInColorStart)
|
||||||
|
{
|
||||||
|
if (this->borderInColorStart != borderInColorStart) {
|
||||||
|
this->borderInColorStart = borderInColorStart;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setBorderInColorEnd(const QColor &borderInColorEnd)
|
||||||
|
{
|
||||||
|
if (this->borderInColorEnd != borderInColorEnd) {
|
||||||
|
this->borderInColorEnd = borderInColorEnd;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setBgColor(const QColor &bgColor)
|
||||||
|
{
|
||||||
|
if (this->bgColor != bgColor) {
|
||||||
|
this->bgColor = bgColor;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setCanMove(bool canMove)
|
||||||
|
{
|
||||||
|
if (this->canMove != canMove) {
|
||||||
|
this->canMove = canMove;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setShowRect(bool showRect)
|
||||||
|
{
|
||||||
|
if (this->showRect != showRect) {
|
||||||
|
this->showRect = showRect;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setShowOverlay(bool showOverlay)
|
||||||
|
{
|
||||||
|
if (this->showOverlay != showOverlay) {
|
||||||
|
this->showOverlay = showOverlay;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setOverlayColor(const QColor &overlayColor)
|
||||||
|
{
|
||||||
|
if (this->overlayColor != overlayColor) {
|
||||||
|
this->overlayColor = overlayColor;
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setGreen()
|
||||||
|
{
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
setBgColor(QColor(0, 166, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setRed()
|
||||||
|
{
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
setBgColor(QColor(255, 0, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setYellow()
|
||||||
|
{
|
||||||
|
textColor = QColor(25, 50, 7);
|
||||||
|
setBgColor(QColor(238, 238, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setBlack()
|
||||||
|
{
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
setBgColor(QColor(10, 10, 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setGray()
|
||||||
|
{
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
setBgColor(QColor(129, 129, 129));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setBlue()
|
||||||
|
{
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
setBgColor(QColor(0, 0, 166));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setLightBlue()
|
||||||
|
{
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
setBgColor(QColor(100, 184, 255));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setLightRed()
|
||||||
|
{
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
setBgColor(QColor(255, 107, 107));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::setLightGreen()
|
||||||
|
{
|
||||||
|
textColor = QColor(255, 255, 255);
|
||||||
|
setBgColor(QColor(24, 189, 155));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::startAlarm()
|
||||||
|
{
|
||||||
|
if (!timerAlarm->isActive()) {
|
||||||
|
timerAlarm->start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::stopAlarm()
|
||||||
|
{
|
||||||
|
if (timerAlarm->isActive()) {
|
||||||
|
timerAlarm->stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveButton::alarm()
|
||||||
|
{
|
||||||
|
static bool isRed = false;
|
||||||
|
if (isRed) {
|
||||||
|
this->setBlack();
|
||||||
|
} else {
|
||||||
|
this->setRed();
|
||||||
|
}
|
||||||
|
|
||||||
|
isRed = !isRed;
|
||||||
|
}
|
||||||
126
xyylMCWEACSystem/MoveButton.h
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
#ifndef MoveButton_H
|
||||||
|
#define MoveButton_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
MoveButton
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
|
||||||
|
class MoveButton : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(QString text READ getText WRITE setText)
|
||||||
|
Q_PROPERTY(QColor textColor READ getTextColor WRITE setTextColor)
|
||||||
|
|
||||||
|
Q_PROPERTY(QColor borderOutColorStart READ getBorderOutColorStart WRITE setBorderOutColorStart)
|
||||||
|
Q_PROPERTY(QColor borderOutColorEnd READ getBorderOutColorEnd WRITE setBorderOutColorEnd)
|
||||||
|
Q_PROPERTY(QColor borderInColorStart READ getBorderInColorStart WRITE setBorderInColorStart)
|
||||||
|
Q_PROPERTY(QColor borderInColorEnd READ getBorderInColorEnd WRITE setBorderInColorEnd)
|
||||||
|
Q_PROPERTY(QColor bgColor READ getBgColor WRITE setBgColor)
|
||||||
|
|
||||||
|
Q_PROPERTY(bool canMove READ getCanMove WRITE setCanMove)
|
||||||
|
Q_PROPERTY(bool showRect READ getShowRect WRITE setShowRect)
|
||||||
|
Q_PROPERTY(bool showOverlay READ getShowOverlay WRITE setShowOverlay)
|
||||||
|
Q_PROPERTY(QColor overlayColor READ getOverlayColor WRITE setOverlayColor)
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit MoveButton(QWidget *parent = 0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool eventFilter(QObject *watched, QEvent *event);
|
||||||
|
void paintEvent(QPaintEvent *);
|
||||||
|
void drawBorderOut(QPainter *painter);
|
||||||
|
void drawBorderIn(QPainter *painter);
|
||||||
|
void drawBg(QPainter *painter);
|
||||||
|
void drawText(QPainter *painter);
|
||||||
|
void drawOverlay(QPainter *painter);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString text; //文本
|
||||||
|
QColor textColor; //文字颜色
|
||||||
|
|
||||||
|
QColor borderOutColorStart; //外边框渐变开始颜色
|
||||||
|
QColor borderOutColorEnd; //外边框渐变结束颜色
|
||||||
|
QColor borderInColorStart; //里边框渐变开始颜色
|
||||||
|
QColor borderInColorEnd; //里边框渐变结束颜色
|
||||||
|
QColor bgColor; //背景颜色
|
||||||
|
|
||||||
|
bool showRect; //显示成矩形
|
||||||
|
bool canMove; //是否能够移动
|
||||||
|
bool showOverlay; //是否显示遮罩层
|
||||||
|
QColor overlayColor; //遮罩层颜色
|
||||||
|
|
||||||
|
QTimer *timerAlarm; //定时器切换颜色
|
||||||
|
|
||||||
|
public:
|
||||||
|
QString getText() const;
|
||||||
|
QColor getTextColor() const;
|
||||||
|
|
||||||
|
QColor getBorderOutColorStart() const;
|
||||||
|
QColor getBorderOutColorEnd() const;
|
||||||
|
QColor getBorderInColorStart() const;
|
||||||
|
QColor getBorderInColorEnd() const;
|
||||||
|
QColor getBgColor() const;
|
||||||
|
|
||||||
|
bool getCanMove() const;
|
||||||
|
bool getShowRect() const;
|
||||||
|
bool getShowOverlay() const;
|
||||||
|
QColor getOverlayColor() const;
|
||||||
|
|
||||||
|
QSize sizeHint() const;
|
||||||
|
QSize minimumSizeHint() const;
|
||||||
|
|
||||||
|
public Q_SLOTS:
|
||||||
|
//设置文本
|
||||||
|
void setText(const QString &text);
|
||||||
|
//设置文本颜色
|
||||||
|
void setTextColor(const QColor &textColor);
|
||||||
|
|
||||||
|
//设置外边框渐变颜色
|
||||||
|
void setBorderOutColorStart(const QColor &borderOutColorStart);
|
||||||
|
void setBorderOutColorEnd(const QColor &borderOutColorEnd);
|
||||||
|
|
||||||
|
//设置里边框渐变颜色
|
||||||
|
void setBorderInColorStart(const QColor &borderInColorStart);
|
||||||
|
void setBorderInColorEnd(const QColor &borderInColorEnd);
|
||||||
|
|
||||||
|
//设置背景色
|
||||||
|
void setBgColor(const QColor &bgColor);
|
||||||
|
|
||||||
|
//设置是否可移动
|
||||||
|
void setCanMove(bool canMove);
|
||||||
|
//设置是否显示矩形
|
||||||
|
void setShowRect(bool showRect);
|
||||||
|
//设置是否显示遮罩层
|
||||||
|
void setShowOverlay(bool showOverlay);
|
||||||
|
//设置遮罩层颜色
|
||||||
|
void setOverlayColor(const QColor &overlayColor);
|
||||||
|
|
||||||
|
//设置为绿色
|
||||||
|
void setGreen();
|
||||||
|
//设置为红色
|
||||||
|
void setRed();
|
||||||
|
//设置为黄色
|
||||||
|
void setYellow();
|
||||||
|
//设置为黑色
|
||||||
|
void setBlack();
|
||||||
|
//设置为灰色
|
||||||
|
void setGray();
|
||||||
|
//设置为蓝色
|
||||||
|
void setBlue();
|
||||||
|
//设置为淡蓝色
|
||||||
|
void setLightBlue();
|
||||||
|
//设置为淡红色
|
||||||
|
void setLightRed();
|
||||||
|
//设置为淡绿色
|
||||||
|
void setLightGreen();
|
||||||
|
|
||||||
|
//设置报警闪烁
|
||||||
|
void startAlarm();
|
||||||
|
void stopAlarm();
|
||||||
|
void alarm();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //MoveButton_H
|
||||||
@@ -85,7 +85,7 @@ bool SqlCore::execute(QString sql )
|
|||||||
bool flag = sqlQuery.exec(sql);
|
bool flag = sqlQuery.exec(sql);
|
||||||
if (!flag)
|
if (!flag)
|
||||||
{
|
{
|
||||||
//logError() << connName << sqlQuery.lastError().text() << endl;
|
qDebug() << connName << sqlQuery.lastError().text() << endl;
|
||||||
}
|
}
|
||||||
mutexMap[msDBFile][connName]->unlock();
|
mutexMap[msDBFile][connName]->unlock();
|
||||||
return flag;
|
return flag;
|
||||||
@@ -96,23 +96,8 @@ bool SqlCore::execute(QString sql )
|
|||||||
|
|
||||||
QSharedPointer<QSqlQuery> SqlCore::select(QString sql)
|
QSharedPointer<QSqlQuery> SqlCore::select(QString sql)
|
||||||
{
|
{
|
||||||
//QMutexLocker lockTemp(&mWriteMutex);
|
QSharedPointer<QSqlQuery> sqlQuery = QSharedPointer<QSqlQuery>(new QSqlQuery);
|
||||||
QString connName = QString("%1(%2)").arg(msDBFile).arg(QString::number(qint64(QThread::currentThread()), 16));//文件名 + 线程
|
return sqlQuery;
|
||||||
//qDebug() << "select:" << connName << endl;
|
|
||||||
QSqlDatabase t = getSqlDataBase();
|
|
||||||
|
|
||||||
mutexMap[msDBFile][connName]->lock();
|
|
||||||
if (!t.isOpen())
|
|
||||||
t.open(msUserName,msPasswd);
|
|
||||||
// QSqlQuery *sqlQuery = new QSqlQuery(t);
|
|
||||||
//QSharedPointer<QSqlQuery> sqlQuery = new QSharedPointer<QSqlQuery(t)>;
|
|
||||||
QSharedPointer<QSqlQuery> sqlQuery = QSharedPointer<QSqlQuery>(new QSqlQuery(t));
|
|
||||||
if (!sqlQuery->exec(sql)) {
|
|
||||||
//logError() << "CSqlCore::select() sql = " << sql << sqlQuery->lastError().text() << " failed!" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
mutexMap[msDBFile][connName]->unlock();
|
|
||||||
return sqlQuery;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSharedPointer<QSqlQuery> SqlCore::select(QString sql, bool& ok)
|
QSharedPointer<QSqlQuery> SqlCore::select(QString sql, bool& ok)
|
||||||
@@ -121,53 +106,30 @@ QSharedPointer<QSqlQuery> SqlCore::select(QString sql, bool& ok)
|
|||||||
QString connName = QString("%1(%2)").arg(msDBFile).arg(QString::number(qint64(QThread::currentThread()), 16));//文件名 + 线程
|
QString connName = QString("%1(%2)").arg(msDBFile).arg(QString::number(qint64(QThread::currentThread()), 16));//文件名 + 线程
|
||||||
//qDebug() << "select:" << connName << endl;
|
//qDebug() << "select:" << connName << endl;
|
||||||
QSqlDatabase t = getSqlDataBase();
|
QSqlDatabase t = getSqlDataBase();
|
||||||
|
|
||||||
mutexMap[msDBFile][connName]->lock();
|
|
||||||
if (!t.isOpen())
|
|
||||||
t.open(msUserName, msPasswd);
|
|
||||||
// QSqlQuery *sqlQuery = new QSqlQuery(t);
|
|
||||||
//QSharedPointer<QSqlQuery> sqlQuery = new QSharedPointer<QSqlQuery(t)>;
|
|
||||||
QSharedPointer<QSqlQuery> sqlQuery = QSharedPointer<QSqlQuery>(new QSqlQuery(t));
|
QSharedPointer<QSqlQuery> sqlQuery = QSharedPointer<QSqlQuery>(new QSqlQuery(t));
|
||||||
ok = sqlQuery->exec(sql);
|
ok = sqlQuery->exec(sql);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
//logError() << "CSqlCore::select() sql = " << sql << sqlQuery->lastError().text() << " failed!" << endl;
|
//logError() << "CSqlCore::select() sql = " << sql << sqlQuery->lastError().text() << " failed!" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutexMap[msDBFile][connName]->unlock();
|
|
||||||
return sqlQuery;
|
return sqlQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SqlCore::destroyConn()
|
void SqlCore::destroyConn()
|
||||||
{
|
{
|
||||||
QString connName = QString("%1(%2)").arg(msDBFile).arg(QString::number(qint64(QThread::currentThread()), 16));//文件名 + 线程
|
|
||||||
//qDebug() << "destroyConn:" << connName << endl;
|
|
||||||
if (!QSqlDatabase::contains( connName))
|
|
||||||
return;
|
|
||||||
QSqlDatabase t = QSqlDatabase::database(connName);
|
|
||||||
if (t.isOpen())
|
|
||||||
t.close();
|
|
||||||
QSqlDatabase::removeDatabase( connName);
|
|
||||||
delete mutexMap[msDBFile][connName];
|
|
||||||
mutexMap[msDBFile].remove(connName);
|
|
||||||
if (mutexMap[msDBFile].keys().length() == 0)
|
|
||||||
mutexMap.remove(msDBFile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SqlCore::destroyOneDBConn()
|
void SqlCore::destroyOneDBConn()
|
||||||
{
|
{
|
||||||
// foreach (QString i, mutexMap[msDBFile].keys())
|
|
||||||
{
|
|
||||||
destroyConn();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SqlCore::destroyAllDBConn()
|
void SqlCore::destroyAllDBConn()
|
||||||
{
|
{
|
||||||
// foreach (QString i, mutexMap.keys())
|
|
||||||
// {
|
|
||||||
destroyOneDBConn();
|
destroyOneDBConn();
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSqlDatabase SqlCore::getSqlDataBase()
|
QSqlDatabase SqlCore::getSqlDataBase()
|
||||||
@@ -179,24 +141,7 @@ QSqlDatabase SqlCore::getSqlDataBase()
|
|||||||
database.setDatabaseName(msDBFile);
|
database.setDatabaseName(msDBFile);
|
||||||
database.setUserName(msUserName);
|
database.setUserName(msUserName);
|
||||||
database.setPassword(msPasswd);
|
database.setPassword(msPasswd);
|
||||||
if (!mutexMap.contains(msDBFile))
|
|
||||||
{
|
|
||||||
QMap<QString, QMutex*> tMap;
|
|
||||||
mutexMap.insert(msDBFile, tMap);
|
|
||||||
}
|
|
||||||
if (database.isOpen() || database.open())
|
|
||||||
{
|
|
||||||
QSqlQuery query(database);
|
|
||||||
query.exec("PRAGMA journal_mode=WAL;"); // 设置WAL模式
|
|
||||||
query.finish();
|
|
||||||
query.clear();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//logWarning() << "DB open failed! " << database.lastError().text() << endl;
|
|
||||||
}
|
|
||||||
QMutex *mutex = new QMutex();
|
|
||||||
mutexMap[msDBFile].insert(connName, mutex);
|
|
||||||
}
|
}
|
||||||
return QSqlDatabase::database( connName);
|
return QSqlDatabase::database( connName);
|
||||||
}
|
}
|
||||||
|
|||||||
71
xyylMCWEACSystem/SqlExecute.cpp
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
#include "SqlExecute.h"
|
||||||
|
#include <QSqlRecord>
|
||||||
|
#include <QSqlField>
|
||||||
|
#include "SqlCore.h"
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
SqlExecute::SqlExecute(QObject * parent/*=NULL*/)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SqlExecute::~SqlExecute()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void SqlExecute::init(QString sDriver, QString sUser, QString sPasswd, QString sDBFile)
|
||||||
|
{
|
||||||
|
SqlCore::init(sDriver, sUser, sPasswd, sDBFile);
|
||||||
|
SqlCore::getSqlDataBase();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SqlExecute::exeRead(QString sql, QList<QVariantMap> &list)
|
||||||
|
{
|
||||||
|
bool ok;
|
||||||
|
QSharedPointer<QSqlQuery> m_sqlQuery = SqlCore::select(sql, ok);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SqlExecute::exeRead(QString sql, QList<QList<QVariant>> &list, QStringList sResuleSeq)
|
||||||
|
{
|
||||||
|
bool ok;
|
||||||
|
QSharedPointer<QSqlQuery> m_sqlQuery = SqlCore::select(sql, ok);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SqlExecute::exeWrite(QString sql)
|
||||||
|
{
|
||||||
|
bool ok;
|
||||||
|
QSharedPointer<QSqlQuery> m_sqlQuery = SqlCore::select(sql, ok);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SqlExecute::destroyConn()
|
||||||
|
{
|
||||||
|
SqlCore::destroyConn();
|
||||||
|
}
|
||||||
|
|
||||||
|
QSqlDatabase SqlExecute::getDataBase()
|
||||||
|
{
|
||||||
|
|
||||||
|
return SqlCore::getSqlDataBase();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<QVariantMap> SqlExecute::getValues(QSharedPointer<QSqlQuery> sqlQuery, int page, int pageNum)
|
||||||
|
{
|
||||||
|
QList<QVariantMap> list;
|
||||||
|
if (!sqlQuery->seek(page))
|
||||||
|
{
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
do
|
||||||
|
{
|
||||||
|
QVariantMap map;
|
||||||
|
list.append(map);
|
||||||
|
} while (sqlQuery->next() && --pageNum);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
37
xyylMCWEACSystem/SqlExecute.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#ifndef _SqlExecute_H__
|
||||||
|
#define _SqlExecute_H__
|
||||||
|
/*
|
||||||
|
\author: zym
|
||||||
|
\brief :
|
||||||
|
\version 1.0
|
||||||
|
\note
|
||||||
|
\CopyRight:zym
|
||||||
|
*/
|
||||||
|
#include <QSqlDatabase>
|
||||||
|
#include <QMap>
|
||||||
|
#include <QThread>
|
||||||
|
#include <QSqlQuery>
|
||||||
|
#include <QSharedPointer>
|
||||||
|
#include <QSqlRecord>
|
||||||
|
#include <QMutex>
|
||||||
|
#include <QMutexLocker>
|
||||||
|
#include <QSqlError>
|
||||||
|
|
||||||
|
class SqlExecute :public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
SqlExecute(QObject * parent = NULL);
|
||||||
|
virtual ~SqlExecute();
|
||||||
|
static void init(QString sDriver, QString sUser, QString sPasswd, QString sDBFile);
|
||||||
|
static bool exeRead(QString sql, QList<QVariantMap> &list);
|
||||||
|
static bool exeRead(QString sql, QList<QList<QVariant>> &list, QStringList sResuleSeq);
|
||||||
|
static bool exeWrite(QString sql);
|
||||||
|
static void destroyConn();
|
||||||
|
static QSqlDatabase getDataBase();
|
||||||
|
private:
|
||||||
|
bool saveSql(QString sqlAction);
|
||||||
|
QList<QVariantMap> getValues(QSharedPointer<QSqlQuery> sqlQuery, int page, int pageNum);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SqlExecute_h__
|
||||||
111
xyylMCWEACSystem/SqlGenerate.cpp
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
|
||||||
|
#include "SqlGenerate.h"
|
||||||
|
#include <QMapIterator>
|
||||||
|
|
||||||
|
SqlGenerate::SqlGenerate()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SqlGenerate::~SqlGenerate()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SqlGenerate::createTable(QString table, QMap<QString, QString> map)
|
||||||
|
{
|
||||||
|
QString content = QString("create table %1 (").arg(table);
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SqlGenerate::insertData(QString table, QVariantMap map)
|
||||||
|
{
|
||||||
|
//insert or replace into
|
||||||
|
QString content = QString("insert or replace into %1 (").arg(table);
|
||||||
|
QString values = QString("values(");
|
||||||
|
content.append(") ");
|
||||||
|
values.append(")");
|
||||||
|
content.append(values);
|
||||||
|
content += QString(";");
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SqlGenerate::selectWhere(QString table, QStringList Name, QString condition)
|
||||||
|
{
|
||||||
|
//QString content = QString("select from %1 ").arg(table);
|
||||||
|
QString content = QString("select ");// .arg(table);
|
||||||
|
QListIterator<QString> i(Name);
|
||||||
|
content += QString(";");//
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SqlGenerate::selectUnion(QStringList sTables, QStringList Name, QString condition /*= ""*/)
|
||||||
|
{
|
||||||
|
QString s_select_Data;
|
||||||
|
if (!condition.isEmpty())
|
||||||
|
{
|
||||||
|
s_select_Data += condition;// QString(" where %1").arg(condition);
|
||||||
|
}
|
||||||
|
s_select_Data += QString(";");//
|
||||||
|
|
||||||
|
return s_select_Data;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SqlGenerate::createIndex(QString table, QString name)
|
||||||
|
{
|
||||||
|
QString content = QString("create index %1_index on %2 (%3)").arg(name).arg(table).arg(name);
|
||||||
|
content += QString(";");//
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SqlGenerate::updateData(QString table, QVariantMap map, QString condition)
|
||||||
|
{
|
||||||
|
QString content = QString("update %1 set ").arg(table);
|
||||||
|
QMapIterator<QString, QVariant>i(map);
|
||||||
|
content += QString("where %1").arg(condition);
|
||||||
|
content += QString(";");
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString SqlGenerate::deleteData(QString table, QString condition)
|
||||||
|
{
|
||||||
|
QString content = QString("delete %1 ").arg(table);
|
||||||
|
content += QString("where '%1'").arg(condition);
|
||||||
|
content += QString(";");
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool SqlGenerate::checkCheckParameterSql(const QString& str)
|
||||||
|
{
|
||||||
|
QStringList keys;
|
||||||
|
keys << "and";
|
||||||
|
keys << "or";
|
||||||
|
keys << "*";
|
||||||
|
keys << "=";
|
||||||
|
keys << " ";
|
||||||
|
keys << "%0a";
|
||||||
|
keys << "%0d";
|
||||||
|
keys << "%";
|
||||||
|
keys << "/";
|
||||||
|
keys << "union";
|
||||||
|
keys << "|";
|
||||||
|
keys << "&";
|
||||||
|
keys << "^";
|
||||||
|
keys << "#";
|
||||||
|
keys << "/*";
|
||||||
|
keys << "*/";
|
||||||
|
keys << "delete";
|
||||||
|
keys << "insert";
|
||||||
|
keys << "select";
|
||||||
|
keys << "update";
|
||||||
|
keys << "drop";
|
||||||
|
for (int i = 0; i < keys.size(); i++)
|
||||||
|
{
|
||||||
|
if (str.contains(keys[i])) // != string::npos)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
33
xyylMCWEACSystem/SqlGenerate.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#ifndef _SqlGenerate_H__
|
||||||
|
#define _SqlGenerate_H__
|
||||||
|
#include <QString>
|
||||||
|
#include <QMap>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
/*
|
||||||
|
\author: zym
|
||||||
|
\brief : Êý¾Ý¿â×é֯УÑéÆ÷
|
||||||
|
\version 1.0
|
||||||
|
\note
|
||||||
|
*/
|
||||||
|
|
||||||
|
class SqlGenerate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SqlGenerate();
|
||||||
|
virtual ~SqlGenerate();
|
||||||
|
QString createTable(QString table, QMap<QString, QString> map);
|
||||||
|
QString insertData(QString table, QVariantMap map);
|
||||||
|
QString selectWhere(QString table, QStringList Name, QString condition = "");
|
||||||
|
QString selectUnion(QStringList table, QStringList Name, QString condition = "");
|
||||||
|
QString createIndex(QString table, QString name);
|
||||||
|
QString updateData(QString table, QVariantMap map, QString condition);
|
||||||
|
QString deleteData(QString table, QString sWhere);
|
||||||
|
private:
|
||||||
|
bool checkCheckParameterSql(const QString& str);
|
||||||
|
protected:
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SqlGenerate_h__
|
||||||
187
xyylMCWEACSystem/cdateedit.cpp
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
#include "CDateEdit.h"
|
||||||
|
|
||||||
|
class CDateEdit::Private {
|
||||||
|
public:
|
||||||
|
Private(CDateEdit* qq) : q(qq), null(false), nullable(false) {}
|
||||||
|
|
||||||
|
CDateEdit* const q;
|
||||||
|
|
||||||
|
bool null;
|
||||||
|
bool nullable;
|
||||||
|
|
||||||
|
void setNull(bool n) {
|
||||||
|
null = n;
|
||||||
|
if (null) {
|
||||||
|
QLineEdit *edit = q->findChild<QLineEdit*>("qt_spinbox_lineedit");
|
||||||
|
if (!edit->text().isEmpty()) {
|
||||||
|
edit->clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CDateEdit::CDateEdit(QWidget *parent) :
|
||||||
|
QDateEdit(parent), d(new Private(this))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QDateTime CDateEdit::dateTime() const
|
||||||
|
{
|
||||||
|
if (d->nullable && d->null) {
|
||||||
|
return QDateTime();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return QDateEdit::dateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QDate CDateEdit::date() const
|
||||||
|
{
|
||||||
|
if (d->nullable && d->null) {
|
||||||
|
return QDate();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return QDateEdit::date();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QTime CDateEdit::time() const
|
||||||
|
{
|
||||||
|
if (d->nullable && d->null) {
|
||||||
|
return QTime();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return QDateEdit::time();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::setDateTime(const QDateTime &dateTime)
|
||||||
|
{
|
||||||
|
if (d->nullable && !dateTime.isValid()) {
|
||||||
|
d->setNull(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
d->setNull(false);
|
||||||
|
QDateEdit::setDateTime(dateTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::setDate(const QDate &date)
|
||||||
|
{
|
||||||
|
if (d->nullable && !date.isValid()) {
|
||||||
|
d->setNull(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
d->setNull(false);
|
||||||
|
QDateEdit::setDate(date);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::setTime(const QTime &time)
|
||||||
|
{
|
||||||
|
if (d->nullable && !time.isValid()) {
|
||||||
|
d->setNull(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
d->setNull(false);
|
||||||
|
QDateEdit::setTime(time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CDateEdit::isNullable() const
|
||||||
|
{
|
||||||
|
return d->nullable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::setNullDatetime()
|
||||||
|
{
|
||||||
|
d->setNull(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::setNullable(bool enable)
|
||||||
|
{
|
||||||
|
d->nullable = enable;
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize CDateEdit::sizeHint() const
|
||||||
|
{
|
||||||
|
const QSize sz = QDateEdit::sizeHint();
|
||||||
|
return QSize(sz.width() + 3, sz.height());
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize CDateEdit::minimumSizeHint() const
|
||||||
|
{
|
||||||
|
const QSize sz = QDateEdit::minimumSizeHint();
|
||||||
|
return QSize(sz.width() + 3, sz.height());
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::showEvent(QShowEvent *event)
|
||||||
|
{
|
||||||
|
QDateEdit::showEvent(event);
|
||||||
|
d->setNull(d->null);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::resizeEvent(QResizeEvent *event)
|
||||||
|
{
|
||||||
|
QDateEdit::resizeEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::paintEvent(QPaintEvent *event)
|
||||||
|
{
|
||||||
|
d->setNull(d->null);
|
||||||
|
QDateEdit::paintEvent(event);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
if (d->nullable &&
|
||||||
|
(event->key() >= Qt::Key_0) &&
|
||||||
|
(event->key() <= Qt::Key_9) &&
|
||||||
|
d->null) {
|
||||||
|
setDateTime(QDateTime::currentDateTime());
|
||||||
|
}
|
||||||
|
if (event->key() == Qt::Key_Tab && d->nullable && d->null) {
|
||||||
|
QAbstractSpinBox::keyPressEvent(event);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event->key() == Qt::Key_Backspace && d->nullable){
|
||||||
|
QLineEdit *edit = this->findChild<QLineEdit *>("qt_spinbox_lineedit");
|
||||||
|
if (edit->selectedText() == edit->text()) {
|
||||||
|
setDateTime(QDateTime());
|
||||||
|
event->accept();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QDateEdit::keyPressEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDateEdit::mousePressEvent(QMouseEvent *event)
|
||||||
|
{
|
||||||
|
bool saveNull = d->null;
|
||||||
|
QDateEdit::mousePressEvent(event);
|
||||||
|
if (d->nullable && saveNull && calendarWidget()->isVisible()) {
|
||||||
|
setDateTime(QDateTime::currentDateTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CDateEdit::focusNextPrevChild(bool next)
|
||||||
|
{
|
||||||
|
if (d->nullable && d->null){
|
||||||
|
return QAbstractSpinBox::focusNextPrevChild(next);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return QDateEdit::focusNextPrevChild(next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QValidator::State CDateEdit::validate(QString &input, int &pos) const
|
||||||
|
{
|
||||||
|
if (d->nullable && d->null){
|
||||||
|
return QValidator::Acceptable;
|
||||||
|
}
|
||||||
|
return QDateEdit::validate(input, pos);
|
||||||
|
}
|
||||||
54
xyylMCWEACSystem/cdateedit.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#ifndef CDATEEDIT_H
|
||||||
|
#define CDATEEDIT_H
|
||||||
|
|
||||||
|
#include <QtCore>
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QDateEdit>
|
||||||
|
#include <QStyle>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QStyleOptionSpinBox>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
#include <QCalendarWidget>
|
||||||
|
class CDateEdit : public QDateEdit
|
||||||
|
{
|
||||||
|
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit CDateEdit(QWidget *parent = 0);
|
||||||
|
|
||||||
|
QDateTime dateTime() const;
|
||||||
|
QDate date() const;
|
||||||
|
QTime time() const;
|
||||||
|
|
||||||
|
bool isNullable() const;
|
||||||
|
void setNullable(bool enable);
|
||||||
|
void setNullDatetime();
|
||||||
|
|
||||||
|
QSize sizeHint() const;
|
||||||
|
QSize minimumSizeHint() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void showEvent(QShowEvent *event);
|
||||||
|
void resizeEvent(QResizeEvent *event);
|
||||||
|
void paintEvent(QPaintEvent *event);
|
||||||
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
void mousePressEvent(QMouseEvent *event);
|
||||||
|
bool focusNextPrevChild(bool next);
|
||||||
|
QValidator::State validate(QString &input, int &pos) const;
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void setDateTime(const QDateTime &dateTime);
|
||||||
|
void setDate(const QDate &date);
|
||||||
|
void setTime(const QTime &time);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Q_DISABLE_COPY(CDateEdit)
|
||||||
|
class Private;
|
||||||
|
friend class Private;
|
||||||
|
Private* d;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CDATEEDIT_H
|
||||||
@@ -66,7 +66,7 @@ void CurChatWidget::paintEvent(QPaintEvent *)
|
|||||||
|
|
||||||
// 设置画笔的颜色和样式
|
// 设置画笔的颜色和样式
|
||||||
painter.setPen(Qt::black);
|
painter.setPen(Qt::black);
|
||||||
painteXY(painter);
|
painteXY(painter);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
263
xyylMCWEACSystem/datamanager.cpp
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
#include "datamanager.h"
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QFile>
|
||||||
|
DataManager::DataManager(QObject * parent ):QObject(parent)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
};
|
||||||
|
DataManager::~DataManager()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
DataManager& DataManager::instance()
|
||||||
|
{
|
||||||
|
static DataManager dataManager;
|
||||||
|
return dataManager;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DataManager::init()
|
||||||
|
{
|
||||||
|
QString sFileName = QCoreApplication::applicationDirPath()+"/medicalRecode.db";
|
||||||
|
//bool bexist = QFile::exists(sFileName);
|
||||||
|
//if(bexist)
|
||||||
|
{
|
||||||
|
SqlCore::init("QSQLITE","user","passdwd",sFileName);
|
||||||
|
}
|
||||||
|
initTable();
|
||||||
|
}
|
||||||
|
void DataManager::initTable()
|
||||||
|
{
|
||||||
|
|
||||||
|
//病例信息
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
病历管理
|
||||||
|
检查号
|
||||||
|
类型: 住院或门诊
|
||||||
|
姓名
|
||||||
|
性别 男女
|
||||||
|
出生日期
|
||||||
|
年龄
|
||||||
|
左右利Laterality 左右
|
||||||
|
检查日期 inspection
|
||||||
|
其他信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
QMap<QString, QString> map;
|
||||||
|
map.insert("f_CheckNum", "TEXT PRIMARY KEY");
|
||||||
|
map.insert("f_Type", "TEXT NOT NULL");
|
||||||
|
map.insert("f_Name", "TEXT NOT NULL");
|
||||||
|
map.insert("f_Sex", "TEXT NOT NULL");
|
||||||
|
map.insert("f_Birthday", "TEXT NOT NULL");
|
||||||
|
map.insert("f_Year", "TEXT NOT NULL");
|
||||||
|
map.insert("f_Laterality", "TEXT NOT NULL");
|
||||||
|
map.insert("f_InspectDate", "TEXT NOT NULL");
|
||||||
|
map.insert("f_Other", "TEXT NOT NULL");
|
||||||
|
SqlGenerate sqlGener;
|
||||||
|
QString sql = sqlGener.createTable("t_RecodManage",map);
|
||||||
|
qDebug()<<sql<<endl;
|
||||||
|
m_sqlcore.execute(sql);
|
||||||
|
}
|
||||||
|
//医院信息
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
医院名称
|
||||||
|
用户名称
|
||||||
|
科室
|
||||||
|
用户密码
|
||||||
|
用户人数
|
||||||
|
确认密码
|
||||||
|
数据名称
|
||||||
|
*/
|
||||||
|
QMap<QString, QString> map;
|
||||||
|
map.insert("f_Id", "TEXT PRIMARY KEY");
|
||||||
|
map.insert("f_HostpitalName", "TEXT ");
|
||||||
|
map.insert("f_UserName", "TEXT NOT NULL");
|
||||||
|
map.insert("f_Section", "TEXT NOT NULL");
|
||||||
|
map.insert("f_UserPasswd", "TEXT NOT NULL");
|
||||||
|
map.insert("f_UserNum", "TEXT NOT NULL");
|
||||||
|
map.insert("f_RePasswd", "TEXT NOT NULL");
|
||||||
|
map.insert("f_DataName", "TEXT NOT NULL");
|
||||||
|
|
||||||
|
SqlGenerate sqlGener;
|
||||||
|
QString sql = sqlGener.createTable("t_Hostpital",map);
|
||||||
|
qDebug()<<sql<<endl;
|
||||||
|
m_sqlcore.execute(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新医院信息
|
||||||
|
bool DataManager::updateHospitalInfo(QString sHostpitalName,
|
||||||
|
QString UserName,
|
||||||
|
QString sSection,
|
||||||
|
QString UserPasswd,
|
||||||
|
QString UserNum,
|
||||||
|
QString RePasswd,
|
||||||
|
QString DataName)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
QMap<QString, QVariant> map;
|
||||||
|
map.insert("f_Id", 0);
|
||||||
|
map.insert("f_HostpitalName", sHostpitalName);
|
||||||
|
map.insert("f_UserName", UserName);
|
||||||
|
map.insert("f_Section", sSection);
|
||||||
|
map.insert("f_UserPasswd", UserPasswd);
|
||||||
|
map.insert("f_UserNum", UserNum);
|
||||||
|
map.insert("f_RePasswd", RePasswd);
|
||||||
|
map.insert("f_DataName",DataName);
|
||||||
|
|
||||||
|
SqlGenerate sqlGener;
|
||||||
|
QString sql = sqlGener.insertData("t_Hostpital",map);
|
||||||
|
qDebug()<<sql<<endl;
|
||||||
|
return m_sqlcore.execute(sql);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DataManager::HospitalInfo(QString& sHostpitalName,
|
||||||
|
QString& UserName,
|
||||||
|
QString& sSection,
|
||||||
|
QString& UserPasswd,
|
||||||
|
QString& UserNum,
|
||||||
|
QString& RePasswd,
|
||||||
|
QString& DataName)
|
||||||
|
{
|
||||||
|
|
||||||
|
QStringList listName;
|
||||||
|
listName<<"f_HostpitalName";
|
||||||
|
listName<<"f_UserName";
|
||||||
|
listName<<"f_Section";
|
||||||
|
listName<<"f_UserPasswd";
|
||||||
|
listName<<"f_UserNum";
|
||||||
|
listName<<"f_RePasswd";
|
||||||
|
listName<<"f_DataName";
|
||||||
|
SqlGenerate sqlGener;
|
||||||
|
QString sql = sqlGener.selectWhere("t_Hostpital",listName);
|
||||||
|
|
||||||
|
bool ret =false;
|
||||||
|
auto query(m_sqlcore.select(sql));
|
||||||
|
if (query.isNull())
|
||||||
|
{
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
while (query->next())
|
||||||
|
{
|
||||||
|
int i =0;
|
||||||
|
sHostpitalName = query->value(i++).toString();;
|
||||||
|
UserName = query->value(i++).toString();
|
||||||
|
sSection= query->value(i++).toString();
|
||||||
|
UserPasswd = query->value(i++).toString();
|
||||||
|
UserNum = query->value(i++).toString();
|
||||||
|
RePasswd = query->value(i++).toString();
|
||||||
|
DataName = query->value(i++).toString();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
query->finish();
|
||||||
|
query->clear();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool DataManager::updateMedicRecord(
|
||||||
|
QString CheckNum ,
|
||||||
|
QString Type ,
|
||||||
|
QString _Name ,
|
||||||
|
QString Sex,
|
||||||
|
QString Birthday,
|
||||||
|
QString Year,
|
||||||
|
QString Laterality,
|
||||||
|
QString InspectDate,
|
||||||
|
QString Other)
|
||||||
|
{
|
||||||
|
QMap<QString, QVariant> map;
|
||||||
|
map.insert("f_CheckNum", CheckNum);
|
||||||
|
map.insert("f_Type", Type);
|
||||||
|
map.insert("f_Name", _Name);
|
||||||
|
map.insert("f_Sex", Sex);
|
||||||
|
map.insert("f_Birthday", Birthday);
|
||||||
|
map.insert("f_Year", Year);
|
||||||
|
map.insert("f_Laterality", Laterality);
|
||||||
|
map.insert("f_InspectDate", InspectDate);
|
||||||
|
map.insert("f_Other", Other);
|
||||||
|
SqlGenerate sqlGener;
|
||||||
|
QString sql = sqlGener.insertData("t_RecodManage",map);
|
||||||
|
qDebug()<<sql<<endl;
|
||||||
|
return m_sqlcore.execute(sql);
|
||||||
|
}
|
||||||
|
int DataManager::getMedicRecordCount( QString sName)
|
||||||
|
{
|
||||||
|
int ret = -1;
|
||||||
|
QString querySql = QString("select count(*) from t_RecodManage where f_Name LIKE '%") + sName + "%';";
|
||||||
|
//qDebug() << "querySql = " << querySql << endl;
|
||||||
|
auto query(m_sqlcore.select(querySql));
|
||||||
|
if (!query.isNull())
|
||||||
|
{
|
||||||
|
if (query->first())
|
||||||
|
{
|
||||||
|
ret = query->value(0).toInt();
|
||||||
|
}
|
||||||
|
query->finish();
|
||||||
|
query->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
uint DataManager::getMedicRecordList(const QString& fileName,
|
||||||
|
QList<MedicRecord>& filesInfo,
|
||||||
|
int& curPage,
|
||||||
|
int perPageCnt)
|
||||||
|
{
|
||||||
|
uint ret = 0;
|
||||||
|
filesInfo.clear();
|
||||||
|
QString tmpFileName = fileName;
|
||||||
|
QString querySql = QString("SELECT f_CheckNum,f_Type,f_Name, f_Sex,f_Birthday,f_Year,f_Laterality,f_InspectDate,f_Other from t_RecodManage where f_Name LIKE '%") + tmpFileName + "%'";
|
||||||
|
querySql += QString(" LIMIT %1 offset %2;").arg(perPageCnt)
|
||||||
|
.arg(curPage * perPageCnt);
|
||||||
|
|
||||||
|
auto query(m_sqlcore.select(querySql));
|
||||||
|
if (query.isNull())
|
||||||
|
{
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
while (query->next())
|
||||||
|
{
|
||||||
|
MedicRecord info;
|
||||||
|
info.m_CheckNum= query->value(0).toString();
|
||||||
|
info.m_Type = query->value(1).toString();
|
||||||
|
info.m_Name = query->value(2).toString();
|
||||||
|
info.m_Sex = query->value(3).toString();
|
||||||
|
info.m_Birthday = query->value(4).toString();
|
||||||
|
info.m_Year = query->value(5).toString();
|
||||||
|
info.m_Laterality = query->value(6).toString();
|
||||||
|
info.m_InspectDate= query->value(7).toString();
|
||||||
|
info.m_Other = query->value(8).toString();
|
||||||
|
|
||||||
|
filesInfo.append(info);
|
||||||
|
++ret;
|
||||||
|
}
|
||||||
|
if (ret > 0)
|
||||||
|
{
|
||||||
|
++curPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
query->finish();
|
||||||
|
query->clear();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
bool DataManager::deleteNumRecode(QString checkNum)
|
||||||
|
{
|
||||||
|
SqlGenerate sqlGener;
|
||||||
|
|
||||||
|
QString sql = QString("delete from %1 where %2").arg("t_RecodManage").arg("f_CheckNum = '"+checkNum+"';");
|
||||||
|
|
||||||
|
return m_sqlcore.execute(sql);
|
||||||
|
|
||||||
|
}
|
||||||
68
xyylMCWEACSystem/datamanager.h
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
#ifndef DATAMANAGER_H
|
||||||
|
#define DATAMANAGER_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include "SqlCore.h"
|
||||||
|
#include "SqlGenerate.h"
|
||||||
|
struct MedicRecord
|
||||||
|
{
|
||||||
|
QString m_CheckNum ;
|
||||||
|
QString m_Type ;
|
||||||
|
QString m_Name ;
|
||||||
|
QString m_Sex;
|
||||||
|
QString m_Birthday;
|
||||||
|
QString m_Year;
|
||||||
|
QString m_Laterality;
|
||||||
|
QString m_InspectDate;
|
||||||
|
QString m_Other;
|
||||||
|
};
|
||||||
|
class DataManager:public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
private:
|
||||||
|
DataManager(QObject * parent = NULL);
|
||||||
|
~DataManager();
|
||||||
|
public:
|
||||||
|
static DataManager& instance();
|
||||||
|
//更新医院信息
|
||||||
|
bool updateHospitalInfo(QString sHostpitalName,
|
||||||
|
QString UserName,
|
||||||
|
QString sSection,
|
||||||
|
QString UserPasswd,
|
||||||
|
QString f_UserNum,
|
||||||
|
QString f_RePasswd,
|
||||||
|
QString DataName);
|
||||||
|
|
||||||
|
bool HospitalInfo(QString& sHostpitalName,
|
||||||
|
QString& UserName,
|
||||||
|
QString& sSection,
|
||||||
|
QString& UserPasswd,
|
||||||
|
QString& f_UserNum,
|
||||||
|
QString& f_RePasswd,
|
||||||
|
QString& DataName);
|
||||||
|
bool updateMedicRecord(
|
||||||
|
QString CheckNum ,
|
||||||
|
QString Type ,
|
||||||
|
QString Name ,
|
||||||
|
QString Sex,
|
||||||
|
QString _Birthday,
|
||||||
|
QString Year,
|
||||||
|
QString Laterality,
|
||||||
|
QString InspectDate,
|
||||||
|
QString Other);
|
||||||
|
int getMedicRecordCount(QString sName);
|
||||||
|
uint getMedicRecordList(const QString& fileName,
|
||||||
|
QList<MedicRecord>& filesInfo,
|
||||||
|
int& curPage,
|
||||||
|
int perPageCnt);
|
||||||
|
|
||||||
|
bool deleteNumRecode(QString checkNum);
|
||||||
|
private:
|
||||||
|
void init();
|
||||||
|
void initTable();
|
||||||
|
private:
|
||||||
|
SqlCore m_sqlcore;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DATAMANAGER_H
|
||||||
@@ -48,5 +48,28 @@
|
|||||||
<file>image/systemsetting.png</file>
|
<file>image/systemsetting.png</file>
|
||||||
<file>image/icon_back_2.png</file>
|
<file>image/icon_back_2.png</file>
|
||||||
<file>image/icon_HighFreq.png</file>
|
<file>image/icon_HighFreq.png</file>
|
||||||
|
<file>image/icon_Amplitude.png</file>
|
||||||
|
<file>image/icon_PowerFreNotch.png</file>
|
||||||
|
<file>image/icon_TimeConst.png</file>
|
||||||
|
<file>image/icon_Wavevelocity.png</file>
|
||||||
|
<file>image/icon_LowerFreq.png</file>
|
||||||
|
<file>image/EGG_icon_DeleteSh_checked.png</file>
|
||||||
|
<file>image/EGG_icon_DeleteSh_hover.png</file>
|
||||||
|
<file>image/EGG_icon_Modify.png</file>
|
||||||
|
<file>image/EGG_icon_Modify_checked.png</file>
|
||||||
|
<file>image/EGG_icon_Modify_hover.png</file>
|
||||||
|
<file>image/EGG_icon_newShec.png</file>
|
||||||
|
<file>image/EGG_icon_newShec_checked.png</file>
|
||||||
|
<file>image/EGG_icon_newShec_hover.png</file>
|
||||||
|
<file>image/EGG_icond_DeleteSh.png</file>
|
||||||
|
<file>qssstyle.qss</file>
|
||||||
|
<file>image/acq.png</file>
|
||||||
|
<file>image/data.png</file>
|
||||||
|
<file>image/img_BEAM.png</file>
|
||||||
|
<file>image/setup.png</file>
|
||||||
|
<file>image/dateEdit.png</file>
|
||||||
|
<file>image/dateEdit_disable.png</file>
|
||||||
|
<file>image/dateEdit_hover.png</file>
|
||||||
|
<file>image/dateEdit_pressed.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
23
xyylMCWEACSystem/framebtn.cpp
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
#include "framebtn.h"
|
||||||
|
#include "ui_framebtn.h"
|
||||||
|
|
||||||
|
FrameBtn::FrameBtn(QWidget *parent) :
|
||||||
|
QFrame(parent),
|
||||||
|
ui(new Ui::FrameBtn)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
ui->label->setStyleSheet("{padding-top: 2px;\
|
||||||
|
background-repeat: no-repeat;\
|
||||||
|
background-color: #60C171;\
|
||||||
|
text-align: bottom;\
|
||||||
|
padding-bottom: 2px;\
|
||||||
|
font-size: 12px;\
|
||||||
|
color: #FFFFFF;}");
|
||||||
|
ui->label_2->setStyleSheet("");
|
||||||
|
ui->label_3->setStyleSheet("");
|
||||||
|
}
|
||||||
|
|
||||||
|
FrameBtn::~FrameBtn()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
22
xyylMCWEACSystem/framebtn.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef FRAMEBTN_H
|
||||||
|
#define FRAMEBTN_H
|
||||||
|
|
||||||
|
#include <QFrame>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class FrameBtn;
|
||||||
|
}
|
||||||
|
|
||||||
|
class FrameBtn : public QFrame
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit FrameBtn(QWidget *parent = nullptr);
|
||||||
|
~FrameBtn();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::FrameBtn *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FRAMEBTN_H
|
||||||
98
xyylMCWEACSystem/framebtn.ui
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>FrameBtn</class>
|
||||||
|
<widget class="QFrame" name="FrameBtn">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>450</width>
|
||||||
|
<height>500</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Frame</string>
|
||||||
|
</property>
|
||||||
|
<property name="inputMethodHints">
|
||||||
|
<set>Qt::ImhNone</set>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>45</x>
|
||||||
|
<y>52</y>
|
||||||
|
<width>240</width>
|
||||||
|
<height>87</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>30</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::LeftToRight</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>脑电采集</string>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>44</x>
|
||||||
|
<y>138</y>
|
||||||
|
<width>278</width>
|
||||||
|
<height>47</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Source Code Pro</family>
|
||||||
|
<pointsize>40</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>90</x>
|
||||||
|
<y>290</y>
|
||||||
|
<width>72</width>
|
||||||
|
<height>15</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="gridLayoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>160</x>
|
||||||
|
<y>270</y>
|
||||||
|
<width>160</width>
|
||||||
|
<height>80</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout"/>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -10,6 +10,8 @@ FrameWindow::FrameWindow(QWidget * parent )
|
|||||||
init();
|
init();
|
||||||
initLay();
|
initLay();
|
||||||
initConnect();
|
initConnect();
|
||||||
|
setWindowFlags(Qt::FramelessWindowHint); // 去掉边框
|
||||||
|
setAttribute(Qt::WA_TranslucentBackground); // 背景透明
|
||||||
}
|
}
|
||||||
FrameWindow::~FrameWindow()
|
FrameWindow::~FrameWindow()
|
||||||
{
|
{
|
||||||
@@ -21,7 +23,7 @@ void FrameWindow::init()
|
|||||||
m_stackWidget.setCurrentWidget(&m_MainWindow);
|
m_stackWidget.setCurrentWidget(&m_MainWindow);
|
||||||
setWindowTitle(" ");
|
setWindowTitle(" ");
|
||||||
setObjectName("FrameWindow");
|
setObjectName("FrameWindow");
|
||||||
this->setStyleSheet("QWidget{background-color:#ffffff;}");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -66,18 +68,18 @@ void FrameWindow::slotClickedChanged(QString btnName)
|
|||||||
{
|
{
|
||||||
qDebug()<<btnName <<endl;
|
qDebug()<<btnName <<endl;
|
||||||
|
|
||||||
if(btnName.compare("EEG") == 0)
|
if(btnName.compare("EEG",Qt::CaseInsensitive) == 0)
|
||||||
{
|
{
|
||||||
m_stackWidget.addWidget(&m_Egg);
|
m_stackWidget.addWidget(&m_Egg);
|
||||||
m_stackWidget.setCurrentWidget(&m_Egg);
|
m_stackWidget.setCurrentWidget(&m_Egg);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(btnName.compare("DataProcess") == 0)
|
else if(btnName.compare("DataProcess",Qt::CaseInsensitive) == 0)
|
||||||
{
|
{
|
||||||
m_stackWidget.addWidget(&m_DataProcess);
|
m_stackWidget.addWidget(&m_DataProcess);
|
||||||
m_stackWidget.setCurrentWidget(&m_DataProcess);
|
m_stackWidget.setCurrentWidget(&m_DataProcess);
|
||||||
}
|
}
|
||||||
else if(btnName.compare("SystemSetting") == 0)
|
else if(btnName.compare("SystemSetting",Qt::CaseInsensitive) == 0)
|
||||||
{
|
{
|
||||||
m_stackWidget.addWidget(&m_SystemSetting);
|
m_stackWidget.addWidget(&m_SystemSetting);
|
||||||
m_stackWidget.setCurrentWidget(&m_SystemSetting);
|
m_stackWidget.setCurrentWidget(&m_SystemSetting);
|
||||||
|
|||||||
@@ -5,6 +5,14 @@
|
|||||||
#include "systemsettingwidget.h"
|
#include "systemsettingwidget.h"
|
||||||
#include "dataprocesswidget.h"
|
#include "dataprocesswidget.h"
|
||||||
#include "eggwidget.h"
|
#include "eggwidget.h"
|
||||||
|
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QStyleOption>
|
||||||
|
#include <QPaintEvent>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FrameWindow:public QWidget
|
class FrameWindow:public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -15,6 +23,14 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
void initLay();
|
void initLay();
|
||||||
bool initConnect();
|
bool initConnect();
|
||||||
|
void paintEvent(QPaintEvent* event)
|
||||||
|
{
|
||||||
|
QStyleOption opt;
|
||||||
|
opt.init(this);
|
||||||
|
QPainter p(this);
|
||||||
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||||
|
}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotClickedChanged(QString);
|
void slotClickedChanged(QString);
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include "datamanager.h"
|
||||||
HospitalInfo::HospitalInfo(QWidget * parent ):QWidget (parent)
|
HospitalInfo::HospitalInfo(QWidget * parent ):QWidget (parent)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
@@ -16,75 +17,433 @@ HospitalInfo::~HospitalInfo()
|
|||||||
}
|
}
|
||||||
void HospitalInfo::init()
|
void HospitalInfo::init()
|
||||||
{
|
{
|
||||||
|
this->setStyleSheet("QWidget \
|
||||||
|
{\
|
||||||
|
background-color:white;\
|
||||||
|
border-radius:10px;\
|
||||||
|
}"\
|
||||||
|
);
|
||||||
|
|
||||||
|
m_labHospitalInfo.setText("医院信息:");;
|
||||||
|
|
||||||
|
m_labHospitalInfo.setStyleSheet("width: 128px; height: 46px;font-family: 思源黑体;font-size: 32px;font-weight: 500; color: #0D9DDB;");
|
||||||
|
|
||||||
|
m_labStart1.setText("*");
|
||||||
|
m_labStart2.setText("*");
|
||||||
|
m_labStart1.setObjectName("labStar");
|
||||||
|
m_labStart2.setObjectName("labStar");
|
||||||
|
m_labStart1.setFixedWidth(10);
|
||||||
|
m_labStart2.setFixedWidth(10);
|
||||||
|
//m_labStart1.setStyleSheet("color:red");
|
||||||
|
//m_labStart2.setStyleSheet("color:red");
|
||||||
|
|
||||||
//医院名称
|
//医院名称
|
||||||
m_labHospitalName.setText(tr("HospitalName"));
|
m_labHospitalName.setText("医院名称:");
|
||||||
|
m_labHospitalName.setObjectName("labhospitalName");
|
||||||
|
//科室
|
||||||
|
m_labSection.setText("科 室:");;
|
||||||
|
m_labSection.setObjectName("labSection");
|
||||||
|
//用户人数
|
||||||
|
m_labUserNum.setText(" 用户人数:");;
|
||||||
|
m_labUserNum.setObjectName("labUserNum");
|
||||||
|
|
||||||
|
//数据名称
|
||||||
|
m_labDataBaseName.setText("数据名称:");;
|
||||||
|
m_labDataBaseName.setObjectName("labDataBaseName");
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
m_labUser.setText("用户名称:");
|
||||||
|
m_labUser.setObjectName("labUser");
|
||||||
|
//用户名称
|
||||||
|
m_labpasswd.setText("用户密码:");;
|
||||||
|
m_labpasswd.setObjectName("labpasswd");
|
||||||
|
//确认密码
|
||||||
|
m_labRepasswd.setText("确认密码:");;
|
||||||
|
m_labRepasswd.setObjectName("labRepasswd");
|
||||||
|
//确认
|
||||||
|
m_btnOK.setText("确认");;
|
||||||
|
m_btnCancel.setText("取消");;
|
||||||
|
|
||||||
|
int ihight = 40;
|
||||||
|
|
||||||
|
m_labStart1.setFixedHeight(ihight);
|
||||||
|
m_labStart2.setFixedHeight(ihight);
|
||||||
|
//医院名称
|
||||||
|
m_labHospitalName.setFixedHeight(ihight);
|
||||||
|
m_editHospitalName.setFixedHeight(ihight);
|
||||||
|
//科室
|
||||||
|
m_labSection.setFixedHeight(ihight);
|
||||||
|
m_editSection.setFixedHeight(ihight);
|
||||||
|
//用户人数
|
||||||
|
m_labUserNum.setFixedHeight(ihight);
|
||||||
|
m_editUserNum.setFixedHeight(ihight);
|
||||||
|
|
||||||
|
//数据名称
|
||||||
|
m_labDataBaseName.setFixedHeight(ihight);
|
||||||
|
m_editDataBaseName.setFixedHeight(ihight);
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
m_labUser.setFixedHeight(ihight);
|
||||||
|
m_editUser.setFixedHeight(ihight);
|
||||||
|
//用户密码
|
||||||
|
m_labpasswd.setFixedHeight(ihight);
|
||||||
|
m_editPasswd.setFixedHeight(ihight);
|
||||||
|
//确认密码
|
||||||
|
m_labRepasswd.setFixedHeight(ihight);
|
||||||
|
m_editRePasswd.setFixedHeight(ihight);
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
int iwidth = 40;
|
||||||
|
|
||||||
|
//医院名称
|
||||||
|
m_labHospitalName.setFixedHeight(iwidth);
|
||||||
|
|
||||||
//科室
|
//科室
|
||||||
m_labSection.setText(tr("Section"));
|
m_labSection.setFixedHeight(iwidth);
|
||||||
|
|
||||||
//用户数
|
//用户人数
|
||||||
m_labUserNum.setText(tr("UserNum"));;
|
m_labUserNum.setFixedHeight(iwidth);
|
||||||
|
|
||||||
|
|
||||||
//数据库 名称
|
//数据名称
|
||||||
m_labDataBaseName.setText(tr("DataBaseName"));
|
m_labDataBaseName.setFixedHeight(iwidth);
|
||||||
|
|
||||||
//用户名
|
|
||||||
m_labUser.setText(tr("User"));
|
|
||||||
|
|
||||||
m_labpasswd.setText(tr("Passwd"));
|
|
||||||
|
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
m_labUser.setFixedHeight(iwidth);
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
m_labpasswd.setFixedHeight(iwidth);
|
||||||
|
|
||||||
|
//确认密码
|
||||||
|
m_labRepasswd.setFixedHeight(iwidth);
|
||||||
|
|
||||||
|
int iwidth = QFontMetrics(this->font()).width("医院名称")+8;
|
||||||
|
|
||||||
|
//医院名称
|
||||||
|
m_labHospitalName.setFixedWidth(iwidth);
|
||||||
|
|
||||||
|
//科室
|
||||||
|
m_labSection.setFixedWidth(iwidth);
|
||||||
|
|
||||||
|
//用户人数
|
||||||
|
m_labUserNum.setFixedWidth(iwidth+10);
|
||||||
|
|
||||||
|
|
||||||
|
//数据名称
|
||||||
|
m_labDataBaseName.setFixedWidth(iwidth+10);
|
||||||
|
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
m_labUser.setFixedWidth(iwidth+10);
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
m_labpasswd.setFixedWidth(iwidth+10);
|
||||||
|
|
||||||
|
//确认密码
|
||||||
|
m_labRepasswd.setFixedWidth(iwidth+10);
|
||||||
|
#endif
|
||||||
//确认
|
//确认
|
||||||
m_btnOK.setText(tr("Confirm"));
|
m_btnOK.setText("确认");;
|
||||||
|
m_btnCancel.setText("取消");;
|
||||||
|
|
||||||
|
|
||||||
|
m_btnOK.setStyleSheet("QPushButton{\
|
||||||
|
background: white;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:hover{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:pressed{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:checked{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}");
|
||||||
|
m_btnCancel.setStyleSheet("QPushButton{\
|
||||||
|
background: white;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:hover{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:pressed{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:checked{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}");
|
||||||
|
|
||||||
|
m_btnCancel.setMinimumWidth(100);
|
||||||
|
m_btnOK.setMinimumWidth(100);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
int ediWidth = 150;
|
||||||
|
//医院信息
|
||||||
|
|
||||||
|
//医院名称
|
||||||
|
m_labHospitalName.setFixedWidth(ediWidth);
|
||||||
|
m_editHospitalName.setFixedWidth(ediWidth);
|
||||||
|
//科室
|
||||||
|
m_editSection.setFixedWidth(ediWidth);
|
||||||
|
m_editSection.setFixedWidth(ediWidth);;
|
||||||
|
//用户人数
|
||||||
|
m_editUserNum.setFixedWidth(ediWidth);
|
||||||
|
m_editUserNum.setFixedWidth(ediWidth);;
|
||||||
|
|
||||||
|
//数据名称
|
||||||
|
m_labHospitalName.setFixedWidth(ediWidth);
|
||||||
|
m_editDataBaseName.setFixedWidth(ediWidth);;
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
m_labHospitalName.setFixedWidth(ediWidth);
|
||||||
|
m_editUser.setFixedWidth(ediWidth);;
|
||||||
|
//用户密码
|
||||||
|
m_labHospitalName.setFixedWidth(ediWidth);
|
||||||
|
m_editPasswd.setFixedWidth(ediWidth);;
|
||||||
|
//确认密码
|
||||||
|
m_labHospitalName.setFixedWidth(ediWidth);
|
||||||
|
m_editRePasswd.setFixedWidth(ediWidth);;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
void HospitalInfo::initLay()
|
void HospitalInfo::initLay()
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
|
||||||
QGridLayout * gridlaySearch = new QGridLayout;
|
int width_space = 60;
|
||||||
QHBoxLayout * hlay = new QHBoxLayout;
|
QHBoxLayout * hlay0 = new QHBoxLayout;
|
||||||
QVBoxLayout * vlay = new QVBoxLayout;
|
hlay0->addWidget(&m_labHospitalInfo);
|
||||||
vlay->addLayout(gridlaySearch);
|
|
||||||
|
QHBoxLayout * hlay = new QHBoxLayout;
|
||||||
|
hlay->addSpacing(width_space);
|
||||||
|
hlay->addWidget(&m_labStart2);
|
||||||
|
hlay->addWidget(&m_labHospitalName);
|
||||||
|
hlay->addWidget(&m_editHospitalName);
|
||||||
|
hlay->addWidget(&m_labUser);
|
||||||
|
hlay->addWidget(&m_editUser);
|
||||||
|
|
||||||
|
//科室
|
||||||
|
QHBoxLayout * hlay1 = new QHBoxLayout;
|
||||||
|
hlay1->addSpacing(width_space);
|
||||||
|
hlay1->addWidget(&m_labStart1);
|
||||||
|
hlay1->addWidget(&m_labSection);//
|
||||||
|
hlay1->addWidget(&m_editSection);
|
||||||
|
hlay1->addWidget(&m_labpasswd);
|
||||||
|
hlay1->addWidget(&m_editPasswd);
|
||||||
|
|
||||||
|
|
||||||
|
//用户人数
|
||||||
|
QHBoxLayout * hlay2 = new QHBoxLayout;
|
||||||
|
hlay2->addSpacing(width_space);
|
||||||
|
hlay2->addWidget(&m_labUserNum);
|
||||||
|
hlay2->addWidget(&m_editUserNum);
|
||||||
|
hlay2->addWidget(&m_labRepasswd);
|
||||||
|
hlay2->addWidget(&m_editRePasswd);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//数据名称
|
||||||
|
QHBoxLayout * hlay3 = new QHBoxLayout;
|
||||||
|
hlay3->addSpacing(width_space);
|
||||||
|
hlay3->addWidget(&m_labDataBaseName);
|
||||||
|
hlay3->addWidget(&m_editDataBaseName);
|
||||||
|
|
||||||
|
|
||||||
|
QHBoxLayout * hlay4 = new QHBoxLayout;
|
||||||
|
hlay4->addStretch();
|
||||||
|
hlay4->addWidget(&m_btnOK);
|
||||||
|
hlay4->addWidget(&m_btnCancel);
|
||||||
|
hlay4->addStretch();
|
||||||
|
|
||||||
|
|
||||||
|
QVBoxLayout * vlay = new QVBoxLayout;
|
||||||
|
vlay->addLayout(hlay0);
|
||||||
|
vlay->addSpacing(30);
|
||||||
vlay->addLayout(hlay);
|
vlay->addLayout(hlay);
|
||||||
|
vlay->addLayout(hlay1);
|
||||||
|
vlay->addLayout(hlay2);
|
||||||
|
vlay->addLayout(hlay3);
|
||||||
|
vlay->addStretch();
|
||||||
|
|
||||||
setLayout(vlay);
|
|
||||||
|
|
||||||
int col = 0;
|
hlay0->setSpacing(0);
|
||||||
int row = 0;
|
hlay->setSpacing(0);
|
||||||
gridlaySearch->addWidget(&m_labHospitalName,row,col);
|
hlay1->setSpacing(0);
|
||||||
gridlaySearch->addWidget(&m_editHospitalName,row,++col);
|
hlay2->setSpacing(0);
|
||||||
row ++;
|
hlay3->setSpacing(0);
|
||||||
col = 0;
|
hlay4->setSpacing(0);
|
||||||
gridlaySearch->addWidget(&m_labSection,row,col);
|
|
||||||
gridlaySearch->addWidget(&m_editSection,row,++col);
|
|
||||||
row ++;
|
|
||||||
col = 0;
|
|
||||||
gridlaySearch->addWidget(&m_labUserNum,row,col);
|
|
||||||
gridlaySearch->addWidget(&m_editUserNum,row,++col);
|
|
||||||
|
|
||||||
row ++;
|
QWidget * w = new QWidget;
|
||||||
col = 0;
|
w->setLayout(vlay);
|
||||||
gridlaySearch->addWidget(&m_labDataBaseName,row,col);
|
|
||||||
gridlaySearch->addWidget(&m_editDataBaseName,row,++col);
|
|
||||||
|
|
||||||
row ++;
|
QVBoxLayout * hlayall = new QVBoxLayout;
|
||||||
col = 0;
|
hlayall->addWidget(w);
|
||||||
gridlaySearch->addWidget(&m_labUser,row,col);
|
hlayall->addLayout(hlay4);
|
||||||
gridlaySearch->addWidget(&m_editUser,row,++col);
|
|
||||||
|
|
||||||
row ++;
|
w->setStyleSheet("QWidget \
|
||||||
col = 0;
|
{\
|
||||||
gridlaySearch->addWidget(&m_labpasswd,row,col);
|
background-color:white;\
|
||||||
gridlaySearch->addWidget(&m_editPasswd,row,++col);
|
border-radius:10px;\
|
||||||
|
}"\
|
||||||
|
);
|
||||||
|
|
||||||
hlay->addStretch();
|
setLayout(hlayall);
|
||||||
hlay->addWidget(&m_btnOK);
|
#else
|
||||||
hlay->addStretch();
|
|
||||||
|
QVBoxLayout * vlay1 = new QVBoxLayout;
|
||||||
|
QHBoxLayout * hlay = new QHBoxLayout;
|
||||||
|
hlay->addWidget(&m_labStart2);
|
||||||
|
hlay->addWidget(&m_labHospitalName);
|
||||||
|
vlay1->addLayout(hlay);
|
||||||
|
|
||||||
|
QHBoxLayout * hlay2 = new QHBoxLayout;
|
||||||
|
hlay2->addWidget(&m_labStart1);
|
||||||
|
hlay2->addWidget(&m_labSection);
|
||||||
|
vlay1->addLayout(hlay2);
|
||||||
|
vlay1->addWidget(&m_labUserNum);
|
||||||
|
vlay1->addWidget(&m_labDataBaseName);
|
||||||
|
vlay1->addStretch();
|
||||||
|
QVBoxLayout * vlay2 = new QVBoxLayout;
|
||||||
|
vlay2->addWidget(&m_editHospitalName);
|
||||||
|
vlay2->addWidget(&m_editSection);
|
||||||
|
vlay2->addWidget(&m_editUserNum);
|
||||||
|
vlay2->addWidget(&m_editDataBaseName);
|
||||||
|
vlay2->addStretch();
|
||||||
|
|
||||||
|
QVBoxLayout * vlay3= new QVBoxLayout;
|
||||||
|
vlay3->addWidget(&m_labUser);
|
||||||
|
vlay3->addWidget(&m_labpasswd);
|
||||||
|
vlay3->addWidget(&m_labRepasswd);
|
||||||
|
vlay3->addStretch();
|
||||||
|
|
||||||
|
QVBoxLayout * vlay4= new QVBoxLayout;
|
||||||
|
vlay4->addWidget(&m_editUser);
|
||||||
|
vlay4->addWidget(&m_editPasswd);
|
||||||
|
vlay4->addWidget(&m_editRePasswd);
|
||||||
|
vlay4->addStretch();
|
||||||
|
|
||||||
|
QHBoxLayout * hlay4 = new QHBoxLayout;
|
||||||
|
hlay4->addStretch();
|
||||||
|
hlay4->addWidget(&m_btnOK);
|
||||||
|
hlay4->addWidget(&m_btnCancel);
|
||||||
|
hlay4->addStretch();
|
||||||
|
|
||||||
|
QHBoxLayout * hlayAll = new QHBoxLayout;
|
||||||
|
hlayAll->addLayout(vlay1);
|
||||||
|
hlayAll->addLayout(vlay2);
|
||||||
|
hlayAll->addLayout(vlay3);
|
||||||
|
hlayAll->addLayout(vlay4);
|
||||||
|
|
||||||
|
int ispace = 3;
|
||||||
|
vlay1->setSpacing(ispace);
|
||||||
|
vlay2->setSpacing(ispace);
|
||||||
|
vlay3->setSpacing(ispace);
|
||||||
|
vlay4->setSpacing(ispace);
|
||||||
|
|
||||||
|
QVBoxLayout * vall = new QVBoxLayout;
|
||||||
|
//vall->addLayout(hlayAll);
|
||||||
|
|
||||||
|
QWidget * w = new QWidget;
|
||||||
|
QHBoxLayout * hlayw = new QHBoxLayout;
|
||||||
|
hlayw->addWidget(&m_labHospitalInfo );
|
||||||
|
QVBoxLayout * vlayw = new QVBoxLayout;
|
||||||
|
vlayw->addLayout(hlayw);
|
||||||
|
vlayw->addLayout(hlayAll);
|
||||||
|
w->setLayout(vlayw);
|
||||||
|
|
||||||
|
vall->addWidget(w);
|
||||||
|
vall->addLayout(hlay4);
|
||||||
|
vall->addStretch();
|
||||||
|
setLayout(vall);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
bool HospitalInfo::initConnect()
|
bool HospitalInfo::initConnect()
|
||||||
{
|
{
|
||||||
|
bool reok;
|
||||||
|
reok = connect(&m_btnOK,SIGNAL(clicked()),this,SLOT(slotSave()));
|
||||||
|
if(!reok)
|
||||||
|
{
|
||||||
|
qDebug()<<"save connect failed"<<endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void HospitalInfo::slotSave()
|
||||||
|
{
|
||||||
|
|
||||||
|
//医院名称
|
||||||
|
|
||||||
|
QString sHostpitalName = m_editHospitalName.text();
|
||||||
|
//科室
|
||||||
|
|
||||||
|
QString sSection = m_editSection.text();
|
||||||
|
//用户人数
|
||||||
|
|
||||||
|
QString UserNum = m_editUserNum.text();
|
||||||
|
|
||||||
|
//数据名称
|
||||||
|
|
||||||
|
QString DataName = m_editDataBaseName.text();
|
||||||
|
|
||||||
|
//用户名称
|
||||||
|
QString UserName = m_editUser.text();
|
||||||
|
//用户密码
|
||||||
|
QString UserPasswd = m_editPasswd.text();
|
||||||
|
//确认密码
|
||||||
|
QString RePasswd = m_editRePasswd.text();
|
||||||
|
|
||||||
|
DataManager::instance().updateHospitalInfo( sHostpitalName,
|
||||||
|
UserName,
|
||||||
|
sSection,
|
||||||
|
UserPasswd,
|
||||||
|
UserNum,
|
||||||
|
RePasswd,
|
||||||
|
DataName);
|
||||||
|
|
||||||
|
slotUpdateShow();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
void HospitalInfo::slotUpdateShow()
|
||||||
|
{
|
||||||
|
QString sHostpitalName;
|
||||||
|
QString UserName;
|
||||||
|
QString sSection;
|
||||||
|
QString UserPasswd;
|
||||||
|
QString UserNum;
|
||||||
|
QString RePasswd;
|
||||||
|
QString DataName;
|
||||||
|
DataManager::instance().HospitalInfo( sHostpitalName,
|
||||||
|
UserName,
|
||||||
|
sSection,
|
||||||
|
UserPasswd,
|
||||||
|
UserNum,
|
||||||
|
RePasswd,
|
||||||
|
DataName);
|
||||||
|
//医院名称
|
||||||
|
m_editHospitalName.setText(sHostpitalName);
|
||||||
|
//科室
|
||||||
|
m_editSection.setText(sSection);
|
||||||
|
//用户人数
|
||||||
|
m_editUserNum.setText(UserNum);
|
||||||
|
//数据名称
|
||||||
|
m_editDataBaseName.setText(DataName);
|
||||||
|
//用户名称
|
||||||
|
m_editUser.setText(UserName);
|
||||||
|
//用户密码
|
||||||
|
m_editPasswd.setText(UserPasswd);
|
||||||
|
//确认密码
|
||||||
|
m_editRePasswd.setText(RePasswd);
|
||||||
|
}
|
||||||
|
void HospitalInfo::slotCancel()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,28 +17,43 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
void initLay();
|
void initLay();
|
||||||
bool initConnect();
|
bool initConnect();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void slotSave();
|
||||||
|
void slotCancel();
|
||||||
|
public slots:
|
||||||
|
void slotUpdateShow();
|
||||||
private:
|
private:
|
||||||
|
//医院信息
|
||||||
|
QLabel m_labHospitalInfo;
|
||||||
|
|
||||||
|
QLabel m_labStart1;
|
||||||
|
QLabel m_labStart2;
|
||||||
//医院名称
|
//医院名称
|
||||||
QLabel m_labHospitalName;
|
QLabel m_labHospitalName;
|
||||||
QLineEdit m_editHospitalName;
|
QLineEdit m_editHospitalName;
|
||||||
//科室
|
//科室
|
||||||
QLabel m_labSection;
|
QLabel m_labSection;
|
||||||
QLineEdit m_editSection;
|
QLineEdit m_editSection;
|
||||||
//用户数
|
//用户人数
|
||||||
QLabel m_labUserNum;
|
QLabel m_labUserNum;
|
||||||
QLineEdit m_editUserNum;
|
QLineEdit m_editUserNum;
|
||||||
|
|
||||||
//数据库 名称
|
//数据名称
|
||||||
QLabel m_labDataBaseName;
|
QLabel m_labDataBaseName;
|
||||||
QLineEdit m_editDataBaseName;
|
QLineEdit m_editDataBaseName;
|
||||||
|
|
||||||
//用户名
|
//用户名称
|
||||||
QLabel m_labUser;
|
QLabel m_labUser;
|
||||||
QLineEdit m_editUser;
|
QLineEdit m_editUser;
|
||||||
|
//用户密码
|
||||||
QLabel m_labpasswd;
|
QLabel m_labpasswd;
|
||||||
QLineEdit m_editPasswd;
|
QLineEdit m_editPasswd;
|
||||||
|
//确认密码
|
||||||
|
QLabel m_labRepasswd;
|
||||||
|
QLineEdit m_editRePasswd;
|
||||||
//确认
|
//确认
|
||||||
QPushButton m_btnOK;
|
QPushButton m_btnOK;
|
||||||
|
QPushButton m_btnCancel;
|
||||||
};
|
};
|
||||||
#endif // HOSPITALINFO_H
|
#endif // HOSPITALINFO_H
|
||||||
|
|||||||
BIN
xyylMCWEACSystem/image/EGG_icon_DeleteSh_checked.png
Normal file
|
After Width: | Height: | Size: 896 B |
BIN
xyylMCWEACSystem/image/EGG_icon_DeleteSh_hover.png
Normal file
|
After Width: | Height: | Size: 884 B |
BIN
xyylMCWEACSystem/image/EGG_icon_Modify.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
xyylMCWEACSystem/image/EGG_icon_Modify_checked.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
xyylMCWEACSystem/image/EGG_icon_Modify_hover.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
xyylMCWEACSystem/image/EGG_icon_newShec.png
Normal file
|
After Width: | Height: | Size: 964 B |
BIN
xyylMCWEACSystem/image/EGG_icon_newShec_checked.png
Normal file
|
After Width: | Height: | Size: 964 B |
BIN
xyylMCWEACSystem/image/EGG_icon_newShec_hover.png
Normal file
|
After Width: | Height: | Size: 894 B |
BIN
xyylMCWEACSystem/image/EGG_icond_DeleteSh.png
Normal file
|
After Width: | Height: | Size: 927 B |
BIN
xyylMCWEACSystem/image/acq.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
xyylMCWEACSystem/image/data.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
xyylMCWEACSystem/image/dateEdit.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
xyylMCWEACSystem/image/dateEdit_disable.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
xyylMCWEACSystem/image/dateEdit_hover.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
xyylMCWEACSystem/image/dateEdit_pressed.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 815 B After Width: | Height: | Size: 815 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
xyylMCWEACSystem/image/icon_LowerFreq.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 638 B After Width: | Height: | Size: 638 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 15 KiB |
BIN
xyylMCWEACSystem/image/setup.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
595
xyylMCWEACSystem/leadscheme.cpp
Normal file
@@ -0,0 +1,595 @@
|
|||||||
|
#include "leadscheme.h"
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QJsonValue>
|
||||||
|
#include <QButtonGroup>
|
||||||
|
#include "operatorjson.h"
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QScrollArea>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFileInfoList>
|
||||||
|
#include <QFileInfo>
|
||||||
|
#include "logger.h"
|
||||||
|
LeadScheme::LeadScheme(QWidget * parent ):QWidget (parent)
|
||||||
|
{
|
||||||
|
init();
|
||||||
|
initconnect();
|
||||||
|
initLay();
|
||||||
|
|
||||||
|
}
|
||||||
|
LeadScheme::~LeadScheme()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeadScheme::init()
|
||||||
|
{
|
||||||
|
QSize sizetemp(60,60);
|
||||||
|
m_btnOK.setFixedSize(sizetemp);
|
||||||
|
m_btndelete.setFixedSize(sizetemp);
|
||||||
|
m_btnNew.setFixedSize(sizetemp);
|
||||||
|
// m_btnNew.setText("新建");
|
||||||
|
// m_btndelete.setText("删除");
|
||||||
|
// m_btnCancel.setText("取消");
|
||||||
|
// m_btnOK.setText("修改");
|
||||||
|
m_btnOK.setStyleSheet("QPushButton{border-image:url(:/image/EGG_icon_Modify.png);}"
|
||||||
|
"QPushButton:hover{border-image:url(:/image/EGG_icon_Modify_hover.png);}"
|
||||||
|
"QPushButton:pressed{border-image:url(:/image/EGG_icon_Modify_checked.png);}"
|
||||||
|
);
|
||||||
|
m_btndelete.setStyleSheet("QPushButton{border-image:url(:/image/EGG_icond_DeleteSh.png);}"
|
||||||
|
"QPushButton:hover{border-image:url(:/image/EGG_icon_DeleteSh_hover.png);}"
|
||||||
|
"QPushButton:pressed{border-image:url(:/image/EGG_icon_DeleteSh_checked.png);}"
|
||||||
|
);
|
||||||
|
m_btnNew.setStyleSheet("QPushButton{border-image:url(:/image/EGG_icon_newShec.png);}"
|
||||||
|
"QPushButton:hover{border-image:url(:/image/EGG_icon_newShec_hover.png);}"
|
||||||
|
"QPushButton:pressed{border-image:url(:/image/EGG_icon_newShec_checked.png);}"
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
bool LeadScheme::initconnect()
|
||||||
|
{
|
||||||
|
bool bCon = true;
|
||||||
|
bCon = connect(&m_btnOK,SIGNAL(clicked(bool)),this,SLOT(slotSave()));
|
||||||
|
if(!bCon)
|
||||||
|
{
|
||||||
|
logError()<<"connect failed"<<endl;
|
||||||
|
return bCon;
|
||||||
|
|
||||||
|
}
|
||||||
|
bCon = connect(&m_btnNew,SIGNAL(clicked(bool)),this,SLOT(slotNew()));
|
||||||
|
if(!bCon)
|
||||||
|
{
|
||||||
|
logError()<<"connect failed"<<endl;
|
||||||
|
return bCon;
|
||||||
|
|
||||||
|
}
|
||||||
|
bCon = connect(&m_btndelete,SIGNAL(clicked(bool)),this,SLOT(slotDelete()));
|
||||||
|
if(!bCon)
|
||||||
|
{
|
||||||
|
logError()<<"connect failed"<<endl;
|
||||||
|
return bCon;
|
||||||
|
|
||||||
|
}
|
||||||
|
return bCon;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LeadScheme::initLay()
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
QLabel * labScheme = new QLabel;
|
||||||
|
labScheme->setText("导联方案");
|
||||||
|
QVBoxLayout * vlayScheme = new QVBoxLayout;
|
||||||
|
vlayScheme->addWidget(labScheme);
|
||||||
|
vlayScheme->addWidget(&m_LeadSchemes);
|
||||||
|
|
||||||
|
QLabel * labNum = new QLabel;
|
||||||
|
labNum->setText("导联");
|
||||||
|
QVBoxLayout * vlayNum = new QVBoxLayout;
|
||||||
|
vlayNum->addWidget(labNum );
|
||||||
|
vlayNum->addWidget(&m_listNum);
|
||||||
|
|
||||||
|
|
||||||
|
QLabel * labPoints = new QLabel;
|
||||||
|
labPoints->setText("测点");
|
||||||
|
QVBoxLayout * vlayPoints = new QVBoxLayout;
|
||||||
|
vlayPoints->addWidget(labPoints);
|
||||||
|
vlayPoints->addWidget(&m_listPoints);
|
||||||
|
|
||||||
|
|
||||||
|
QLabel * labExPoints = new QLabel;
|
||||||
|
labExPoints->setText("参考点");
|
||||||
|
QVBoxLayout * vlayExPoints = new QVBoxLayout;
|
||||||
|
vlayExPoints->addWidget(labExPoints );
|
||||||
|
vlayExPoints->addWidget(&m_listExPoints );
|
||||||
|
|
||||||
|
|
||||||
|
QHBoxLayout * hlayWPoints = new QHBoxLayout;
|
||||||
|
QWidget * wPoints = new QWidget;
|
||||||
|
wPoints->setLayout(hlayWPoints);
|
||||||
|
hlayWPoints->addLayout(vlayNum );
|
||||||
|
hlayWPoints->addLayout(vlayPoints);
|
||||||
|
hlayWPoints->addLayout(vlayExPoints);
|
||||||
|
|
||||||
|
QLabel * labScheme = new QLabel;
|
||||||
|
labScheme->setText("导联方案");
|
||||||
|
QVBoxLayout * vlayScheme = new QVBoxLayout;
|
||||||
|
vlayScheme->addWidget(labScheme,1,Qt::AlignHCenter);
|
||||||
|
vlayScheme->addWidget(&m_LeadSchemes,1);
|
||||||
|
vlayScheme->addStretch();
|
||||||
|
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
QLabel * labScheme = new QLabel;
|
||||||
|
labScheme->setText("导联方案");
|
||||||
|
labScheme->setObjectName("labScheme");
|
||||||
|
|
||||||
|
QLabel * labNum = new QLabel;
|
||||||
|
labNum->setText("导联");
|
||||||
|
labNum->setObjectName("labSchemeNum");
|
||||||
|
QLabel * labPoints = new QLabel;
|
||||||
|
labPoints->setText("测点");
|
||||||
|
labPoints->setObjectName("labSchemePoints");
|
||||||
|
QLabel * labExPoints = new QLabel;
|
||||||
|
labExPoints->setText("参考点");
|
||||||
|
labExPoints->setObjectName("labSchemePointsparam");
|
||||||
|
//start
|
||||||
|
QWidget * wPoints = new QWidget;
|
||||||
|
|
||||||
|
QGridLayout * gridlayOut = new QGridLayout;
|
||||||
|
QVBoxLayout * vlayPoints = new QVBoxLayout;
|
||||||
|
vlayPoints->addLayout(gridlayOut);
|
||||||
|
// vlayPoints->addStretch();
|
||||||
|
wPoints->setLayout(vlayPoints);
|
||||||
|
QStringList strList1,strList2,strList3;
|
||||||
|
strList1<<"0"<<"1"<<"2"<<"3"<<"4"<<"5"<<"6"<<"7"<<"8"<<"9"<<"10"<<"11"<<
|
||||||
|
"12"<<"13"<<"14"<<"15";
|
||||||
|
strList2<<"F1"<<"F2"<<"F3"<<"F4"<<"C3"<<"C4"<<"P3"<<"P4"<<"O1"<<"O2"<<"F7"<<"F8"<<
|
||||||
|
"T3"<<"T4"<<"T5"<<"T6";
|
||||||
|
strList3<<"A1"<<"A2"<<"A1"<<"A1"<<"A2"<<"A1"<<"A2"<<"A1"<<"A2"<<"A1"<<"A2"<<"A1"<<
|
||||||
|
"A1"<<"A2"<<"A1"<<"A2";
|
||||||
|
pButtonGroup0 = new QButtonGroup(this);
|
||||||
|
|
||||||
|
QButtonGroup *pButtonGroup1 = new QButtonGroup(this);
|
||||||
|
// 设置互斥
|
||||||
|
pButtonGroup1->setExclusive(true);
|
||||||
|
QButtonGroup *pButtonGroup2= new QButtonGroup(this);
|
||||||
|
// 设置互斥
|
||||||
|
pButtonGroup2->setExclusive(true);
|
||||||
|
QButtonGroup *pButtonGroup3 = new QButtonGroup(this);
|
||||||
|
// 设置互斥
|
||||||
|
pButtonGroup3->setExclusive(true);
|
||||||
|
int colmn = 0;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
QStringList Sches;
|
||||||
|
Sches<<"8通道"<<"16通道"<<"64通道";
|
||||||
|
gridlayOut->addWidget(labScheme,0,colmn++,Qt::AlignHCenter);
|
||||||
|
for (int i= 0 ; i<Sches.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton(Sches.at(i));
|
||||||
|
//btn->setMinimumHeight(minHeight);
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
pButtonGroup0->addButton(btn);
|
||||||
|
gridlayOut->addWidget( btn,i+1,0);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
QStringList Sches;
|
||||||
|
Sches<<"8通道"<<"16通道"<<"64通道";
|
||||||
|
//遍历加载当前已经存在的方案
|
||||||
|
QDir dir(QApplication::applicationDirPath()+"/Scheme/");
|
||||||
|
QStringList fileList;
|
||||||
|
QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot | QDir::Dirs);
|
||||||
|
foreach (auto fileInfo, fileInfoList)
|
||||||
|
{
|
||||||
|
if(fileInfo.isFile())
|
||||||
|
{
|
||||||
|
|
||||||
|
if(!Sches.contains(fileInfo.baseName()) && fileInfo.baseName().compare("0")!=0)
|
||||||
|
{
|
||||||
|
Sches.append(fileInfo.baseName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gridlayOut->addWidget(labScheme,0,colmn++,Qt::AlignHCenter);
|
||||||
|
QScrollArea * scroll = new QScrollArea;
|
||||||
|
scroll->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
|
||||||
|
scroll->setWidgetResizable(true);
|
||||||
|
scroll->setAlignment(Qt::AlignRight);
|
||||||
|
QWidget * wShech = new QWidget;
|
||||||
|
|
||||||
|
gridlayOut->addWidget(scroll,1,colmn-1,12,1);
|
||||||
|
// QGridLayout * gridShech = new QGridLayout;
|
||||||
|
m_vlayHH = new QVBoxLayout;
|
||||||
|
wShech->setLayout(m_vlayHH);
|
||||||
|
for (int i= 0 ; i<Sches.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton(Sches.at(i));
|
||||||
|
connect(btn,SIGNAL(clicked(bool)),this,SLOT(slotUpdateCurScheme()));
|
||||||
|
btn->setMaximumHeight(60);
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
pButtonGroup0->addButton(btn);
|
||||||
|
//gridShech->addWidget( btn,i+1,0);
|
||||||
|
m_vlayHH->addWidget(btn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
m_listBtnsSchemes.append(btn);
|
||||||
|
btn->setObjectName("btnShem");
|
||||||
|
#if 1
|
||||||
|
btn->setStyleSheet("QPushButton{ background: rgb(255, 255, 255); color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; border:0px ; } \
|
||||||
|
QPushButton:hover{color: black;background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; }\
|
||||||
|
QPushButton:pressed{color: black; background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px;}\
|
||||||
|
QPushButton:checked{ color: white;background: #0D9DDB;border-radius: 8px; }");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
m_vlayHH->addStretch();
|
||||||
|
|
||||||
|
scroll->setWidget(wShech);
|
||||||
|
|
||||||
|
QHBoxLayout * hbtn = new QHBoxLayout;
|
||||||
|
hbtn->addStretch();
|
||||||
|
hbtn->addWidget(&m_btnNew);
|
||||||
|
hbtn->addWidget(&m_btndelete);
|
||||||
|
//hbtn->addWidget(&m_btnCancel);
|
||||||
|
hbtn->addWidget(&m_btnOK);
|
||||||
|
hbtn->addStretch();
|
||||||
|
gridlayOut->addLayout(hbtn,14,colmn-1,1,1);
|
||||||
|
QLabel * desLab = new QLabel;
|
||||||
|
desLab->setObjectName("labDesShec");
|
||||||
|
desLab->setText("1 选择重构方式0-9\n(注意:0方式不能重构\n2 左键点击重构选择测参点\n3左键点击部位要选择的点)");
|
||||||
|
gridlayOut->addWidget(desLab,15,colmn-1,3,1);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
gridlayOut->addWidget(labNum,0,colmn++,Qt::AlignHCenter);
|
||||||
|
int minHeight = 45;
|
||||||
|
for (int i = 0 ;i<strList1.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton(strList1.at(i));
|
||||||
|
//btn->setMinimumHeight(minHeight);
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
pButtonGroup1->addButton(btn);
|
||||||
|
gridlayOut->addWidget( btn,i+1,1);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
btn->setObjectName("btnShem1");
|
||||||
|
#if 1
|
||||||
|
btn->setStyleSheet("QPushButton{ background: rgb(255, 255, 255); color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; border:0px ; } \
|
||||||
|
QPushButton:hover{color: black;background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; }\
|
||||||
|
QPushButton:pressed{color: black; background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px;}\
|
||||||
|
QPushButton:checked{ color: white;background: #0D9DDB;border-radius: 8px; }");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
gridlayOut->addWidget( labPoints,0,colmn++,Qt::AlignHCenter);
|
||||||
|
for (int i = 0 ;i<strList2.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton(strList2.at(i));
|
||||||
|
//btn->setMinimumHeight(minHeight);
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
pButtonGroup2->addButton(btn);
|
||||||
|
|
||||||
|
gridlayOut->addWidget( btn,i+1,2);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
btn->setObjectName("btnShem1");
|
||||||
|
#if 1
|
||||||
|
btn->setStyleSheet("QPushButton{ background: rgb(255, 255, 255); color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; border:0px ; } \
|
||||||
|
QPushButton:hover{color: black;background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; }\
|
||||||
|
QPushButton:pressed{color: black; background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px;}\
|
||||||
|
QPushButton:checked{ color: white;background: #0D9DDB;border-radius: 8px; }");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
gridlayOut->addWidget( labExPoints,0,colmn++,Qt::AlignHCenter);
|
||||||
|
for (int i = 0 ;i<strList3.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton(strList3.at(i));
|
||||||
|
//btn->setMinimumHeight(minHeight);
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
pButtonGroup3->addButton(btn);
|
||||||
|
|
||||||
|
gridlayOut->addWidget( btn,i+1,3);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
btn->setObjectName("btnShem1");
|
||||||
|
#if 1
|
||||||
|
btn->setStyleSheet("QPushButton{ background: rgb(255, 255, 255); color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; border:0px ; } \
|
||||||
|
QPushButton:hover{color: black;background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; }\
|
||||||
|
QPushButton:pressed{color: black; background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px;}\
|
||||||
|
QPushButton:checked{ color: white;background: #0D9DDB;border-radius: 8px; }");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
//end
|
||||||
|
|
||||||
|
#endif
|
||||||
|
QWidget * wClickedPints = new QWidget;
|
||||||
|
wClickedPints->setStyleSheet("border-image:url(:/image/img_lead.png);}");
|
||||||
|
|
||||||
|
QVBoxLayout * vlaypointsTemp = new QVBoxLayout;
|
||||||
|
m_editShecName.setFixedWidth(180);
|
||||||
|
m_editShecName.setPlaceholderText("输入方案名称");
|
||||||
|
vlaypointsTemp->addWidget(&m_editShecName);
|
||||||
|
vlaypointsTemp->addWidget(wClickedPints);
|
||||||
|
QWidget * ww =new QWidget;
|
||||||
|
ww->setLayout(vlaypointsTemp);
|
||||||
|
// wClickedPints->setFixedWidth(500);
|
||||||
|
//wClickedPints->show();
|
||||||
|
QHBoxLayout * hlayAll = new QHBoxLayout;
|
||||||
|
// hlayAll->addLayout(vlayScheme,1);
|
||||||
|
hlayAll->addWidget(wPoints,3);
|
||||||
|
hlayAll->addWidget(ww,3);
|
||||||
|
|
||||||
|
|
||||||
|
QList<QColor> colors;
|
||||||
|
colors.append(QColor(100, 184, 255));
|
||||||
|
colors.append(QColor(255, 107, 107));
|
||||||
|
colors.append(QColor(24, 189, 155));
|
||||||
|
colors.append(QColor(1, 174, 103));
|
||||||
|
colors.append(QColor(52, 73, 94));
|
||||||
|
|
||||||
|
int x = 5;
|
||||||
|
int y = 5;
|
||||||
|
int radius = 50;
|
||||||
|
|
||||||
|
QStringList listNames;
|
||||||
|
listNames<<"Fp1"<<"Fp2"
|
||||||
|
<<"F7"<<"F3"<<"Fz"<<"F4"<<"F8"
|
||||||
|
<<"A1"<<"T3"<<"C3"<<"Cz"<<"C4"<<"T4"<<"A2"
|
||||||
|
<<"T5"<<"P3" <<"Pz"<<"P4" <<"T6"
|
||||||
|
<<"O1"<<"O2";
|
||||||
|
|
||||||
|
QJsonObject json;
|
||||||
|
OperatorJson Ojson;
|
||||||
|
Ojson.readJson(QApplication::applicationDirPath()+"/Scheme/0.json",json);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
qDebug()<<"hahaha"<<json<<endl;
|
||||||
|
for(int i = 0 ; i< listNames.size();i++)
|
||||||
|
{
|
||||||
|
MoveButton * btn = new MoveButton(wClickedPints);
|
||||||
|
btn->setParent(wClickedPints);
|
||||||
|
int x =json[listNames.at(i)].toObject()["x"].toInt();
|
||||||
|
int y = json[listNames.at(i)].toObject()["y"].toInt();
|
||||||
|
|
||||||
|
btn->setGeometry(x,y, radius, radius);
|
||||||
|
//x = x + radius;
|
||||||
|
btn->setText(listNames.at(i));
|
||||||
|
btn->setCanMove(true);
|
||||||
|
btn->setShowOverlay(true);
|
||||||
|
btn->setBgColor(QColor(1, 174, 103));
|
||||||
|
m_listMoveBtns.append(btn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QWidget * Wall = new QWidget;
|
||||||
|
Wall->setLayout(hlayAll);
|
||||||
|
Wall->setStyleSheet("QWidget \
|
||||||
|
{\
|
||||||
|
background-color:white;\
|
||||||
|
border-radius:10px;\
|
||||||
|
}");
|
||||||
|
|
||||||
|
QVBoxLayout * vlayAll = new QVBoxLayout;
|
||||||
|
vlayAll->addWidget(Wall);
|
||||||
|
//vlayAll->addLayout(hbtn);
|
||||||
|
setLayout(vlayAll);
|
||||||
|
|
||||||
|
// setStyleSheet("QLabel{font-family: 思源黑体;font-size: 26px;font-weight: 500;color: #054578;}");
|
||||||
|
}
|
||||||
|
void LeadScheme::reLay()
|
||||||
|
{
|
||||||
|
QLayoutItem *child;
|
||||||
|
while ((child = m_vlayHH->takeAt(0)) != 0)
|
||||||
|
{
|
||||||
|
//删除Stretch(弹簧)等布局
|
||||||
|
if (child->spacerItem())
|
||||||
|
{
|
||||||
|
m_vlayHH->removeItem(child);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//删除布局
|
||||||
|
//删除布局
|
||||||
|
QWidget * w = child->widget();
|
||||||
|
m_vlayHH->removeWidget(child->widget());
|
||||||
|
child->widget()->setParent(0);
|
||||||
|
if (w)
|
||||||
|
{
|
||||||
|
w->deleteLater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
void LeadScheme::slotUpdateCurScheme()
|
||||||
|
{
|
||||||
|
//1获取方案名称
|
||||||
|
QPushButton *btn = static_cast<QPushButton*>( sender());
|
||||||
|
if(btn)
|
||||||
|
{
|
||||||
|
m_CurScheme = btn->text();
|
||||||
|
}
|
||||||
|
m_editShecName.setText(m_CurScheme);
|
||||||
|
//2检查对应的方案名称是否存在
|
||||||
|
//(2.1)存在就加载原来的
|
||||||
|
QString sFileName = QApplication::applicationDirPath()+"/Scheme/"+m_CurScheme+".json";
|
||||||
|
if(QFile::exists(sFileName))
|
||||||
|
{
|
||||||
|
int radius = 50;
|
||||||
|
QJsonObject json;
|
||||||
|
OperatorJson Ojson;
|
||||||
|
Ojson.readJson(sFileName,json);
|
||||||
|
|
||||||
|
for(int i = 0 ; i< json.keys().size();i++)
|
||||||
|
{
|
||||||
|
for(int j =0 ;j < m_listMoveBtns.size();j++)
|
||||||
|
{
|
||||||
|
if(m_listMoveBtns.at(j)->getText().compare(json.keys().at(i)) ==0)
|
||||||
|
{
|
||||||
|
MoveButton * btn = m_listMoveBtns.at(j);
|
||||||
|
int x =json[json.keys().at(i)].toObject()["x"].toInt();
|
||||||
|
int y = json[json.keys().at(i)].toObject()["y"].toInt();
|
||||||
|
|
||||||
|
btn->setGeometry(x,y, radius, radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else // (2.2)不存在就加载模版
|
||||||
|
{
|
||||||
|
int radius = 50;
|
||||||
|
QJsonObject json;
|
||||||
|
OperatorJson Ojson;
|
||||||
|
Ojson.readJson(QApplication::applicationDirPath()+"/Scheme/0.json",json);
|
||||||
|
for(int i = 0 ; i< json.keys().size();i++)
|
||||||
|
{
|
||||||
|
for(int j =0 ;j < m_listMoveBtns.size();j++)
|
||||||
|
{
|
||||||
|
if(m_listMoveBtns.at(j)->getText().compare(json.keys().at(i)) ==0)
|
||||||
|
{
|
||||||
|
MoveButton * btn = m_listMoveBtns.at(j);
|
||||||
|
int x =json[json.keys().at(i)].toObject()["x"].toInt();
|
||||||
|
int y = json[json.keys().at(i)].toObject()["y"].toInt();
|
||||||
|
|
||||||
|
btn->setGeometry(x,y, radius, radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//保存最新的位置
|
||||||
|
QJsonObject jsonSave;
|
||||||
|
|
||||||
|
for(int i = 0;i< m_listMoveBtns.size();i++ )
|
||||||
|
{
|
||||||
|
auto btn = m_listMoveBtns.at(i);
|
||||||
|
QString text = btn->getText();
|
||||||
|
int x = btn->x();
|
||||||
|
int y = btn->y();
|
||||||
|
QJsonObject perJson;
|
||||||
|
perJson.insert("x",x);
|
||||||
|
perJson.insert("y",y);
|
||||||
|
jsonSave.insert(text,perJson);
|
||||||
|
qDebug()<<QString("名称:%1\tx:%2\ty:%3").arg(text).arg(x).arg(y)<<endl;
|
||||||
|
}
|
||||||
|
OperatorJson json;
|
||||||
|
|
||||||
|
json.savaJson(jsonSave,QApplication::applicationDirPath()+"/Scheme/"+m_CurScheme+".json");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
void LeadScheme::slotSave()
|
||||||
|
{
|
||||||
|
QJsonObject jsonSave;
|
||||||
|
|
||||||
|
for(int i = 0;i< m_listMoveBtns.size();i++ )
|
||||||
|
{
|
||||||
|
auto btn = m_listMoveBtns.at(i);
|
||||||
|
QString text = btn->getText();
|
||||||
|
int x = btn->x();
|
||||||
|
int y = btn->y();
|
||||||
|
QJsonObject perJson;
|
||||||
|
perJson.insert("x",x);
|
||||||
|
perJson.insert("y",y);
|
||||||
|
jsonSave.insert(text,perJson);
|
||||||
|
qDebug()<<QString("名称:%1\tx:%2\ty:%3").arg(text).arg(x).arg(y)<<endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
OperatorJson json;
|
||||||
|
|
||||||
|
json.savaJson(jsonSave,QApplication::applicationDirPath()+"/Scheme/"+m_CurScheme+".json");
|
||||||
|
|
||||||
|
}
|
||||||
|
void LeadScheme::slotNew()
|
||||||
|
{
|
||||||
|
//1 新建方案名称不为空 且不重复
|
||||||
|
QString schemeName = m_editShecName.text();
|
||||||
|
if(schemeName.isEmpty())
|
||||||
|
{
|
||||||
|
logError()<<"Shech Name is empty!"<<endl;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
//2 判断名称是否有重复
|
||||||
|
QStringList listNames;
|
||||||
|
schemeName = schemeName.trimmed();
|
||||||
|
for(int i = 0 ; i< m_listBtnsSchemes.size();i++)
|
||||||
|
{
|
||||||
|
QString name = m_listBtnsSchemes.at(i)->text();
|
||||||
|
if(name.compare(schemeName)== 0)
|
||||||
|
{
|
||||||
|
logError()<<"Shech Name is repeated!"<<endl;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
listNames.append(name);
|
||||||
|
}
|
||||||
|
listNames.append(schemeName);
|
||||||
|
//3 获取当前所有方案名称
|
||||||
|
m_listBtnsSchemes.clear();
|
||||||
|
reLay();
|
||||||
|
//4 重新布局
|
||||||
|
for (int i= 0 ; i<listNames.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton(listNames.at(i));
|
||||||
|
connect(btn,SIGNAL(clicked(bool)),this,SLOT(slotUpdateCurScheme()));
|
||||||
|
btn->setMaximumHeight(60);
|
||||||
|
btn->setObjectName("btnShem");
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
pButtonGroup0->addButton(btn);
|
||||||
|
//gridShech->addWidget( btn,i+1,0);
|
||||||
|
m_vlayHH->addWidget(btn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
m_listBtnsSchemes.append(btn);
|
||||||
|
btn->setObjectName("btnShem1");
|
||||||
|
#if 1
|
||||||
|
btn->setStyleSheet("QPushButton{ background: rgb(255, 255, 255); color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; border:0px ; } \
|
||||||
|
QPushButton:hover{color: black;background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px; }\
|
||||||
|
QPushButton:pressed{color: black; background: rgb(255, 255, 255);color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal; border-radius: 4px;}\
|
||||||
|
QPushButton:checked{ color: white;background: #0D9DDB;border-radius: 8px; }");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
m_vlayHH->addStretch();
|
||||||
|
}
|
||||||
|
void LeadScheme::slotDelete()
|
||||||
|
{
|
||||||
|
//1 获取当前列表,从当前列表中获取出被选中的要删除的
|
||||||
|
QString sDeleName;
|
||||||
|
QStringList listNames;
|
||||||
|
for(int i = 0 ; i< m_listBtnsSchemes.size();i++)
|
||||||
|
{
|
||||||
|
if(m_listBtnsSchemes.at(i)->isChecked())
|
||||||
|
{
|
||||||
|
//logError()<<"delete:"<<m_listBtnsSchemes.at(i)->text()<<endl;
|
||||||
|
sDeleName=m_listBtnsSchemes.at(i)->text();
|
||||||
|
if(i<3)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
listNames.append(m_listBtnsSchemes.at(i)->text());
|
||||||
|
}
|
||||||
|
//2 重新布局
|
||||||
|
m_listBtnsSchemes.clear();
|
||||||
|
reLay();
|
||||||
|
//3
|
||||||
|
for (int i= 0 ; i<listNames.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton(listNames.at(i));
|
||||||
|
connect(btn,SIGNAL(clicked(bool)),this,SLOT(slotUpdateCurScheme()));
|
||||||
|
btn->setMaximumHeight(40);
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
pButtonGroup0->addButton(btn);
|
||||||
|
//gridShech->addWidget( btn,i+1,0);
|
||||||
|
m_vlayHH->addWidget(btn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
m_listBtnsSchemes.append(btn);
|
||||||
|
}
|
||||||
|
m_vlayHH->addStretch();
|
||||||
|
//4 删除对应的位置文件
|
||||||
|
|
||||||
|
QFile::remove( QApplication::applicationDirPath()+"/Scheme/"+sDeleName+".json");
|
||||||
|
}
|
||||||
43
xyylMCWEACSystem/leadscheme.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
#ifndef LEADSCHEME_H
|
||||||
|
#define LEADSCHEME_H
|
||||||
|
#include <QWidget>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include "navlistwidget.h"
|
||||||
|
#include "MoveButton.h"
|
||||||
|
#include <QList>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include "operatorjson.h"
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QButtonGroup>
|
||||||
|
class LeadScheme:public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
LeadScheme(QWidget * parent = NULL);
|
||||||
|
virtual ~LeadScheme();
|
||||||
|
|
||||||
|
void init();
|
||||||
|
bool initconnect();
|
||||||
|
void initLay();
|
||||||
|
private:
|
||||||
|
void reLay();
|
||||||
|
private slots:
|
||||||
|
void slotSave();
|
||||||
|
void slotNew();
|
||||||
|
void slotDelete();
|
||||||
|
void slotUpdateCurScheme();
|
||||||
|
private:
|
||||||
|
QString m_CurScheme;
|
||||||
|
QPushButton m_btnNew;
|
||||||
|
QPushButton m_btndelete;
|
||||||
|
QPushButton m_btnCancel;
|
||||||
|
QPushButton m_btnOK;
|
||||||
|
QVBoxLayout * m_vlayHH ;
|
||||||
|
QList<MoveButton*> m_listMoveBtns;
|
||||||
|
QLineEdit m_editShecName;
|
||||||
|
QList<QPushButton *> m_listBtnsSchemes;
|
||||||
|
QButtonGroup *pButtonGroup0;
|
||||||
|
};
|
||||||
|
#endif // LEADSCHEME_H
|
||||||
35
xyylMCWEACSystem/logger.cpp
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#include "logger.h"
|
||||||
|
void MessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
|
{
|
||||||
|
QString txt;
|
||||||
|
#if 0
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case QtDebugMsg:
|
||||||
|
txt = QString("Debug: %1").arg(msg);//调试信息
|
||||||
|
break;
|
||||||
|
case QtInfoMsg:
|
||||||
|
txt = QString("Info: %1").arg(msg);//一般信息
|
||||||
|
break;
|
||||||
|
case QtWarningMsg:
|
||||||
|
txt = QString("Warning: %1").arg(msg);//警告信息
|
||||||
|
break;
|
||||||
|
case QtCriticalMsg:
|
||||||
|
txt = QString("Critical: %1").arg(msg);//严重错误信息
|
||||||
|
break;
|
||||||
|
case QtFatalMsg:
|
||||||
|
txt = QString("Fatal: %1").arg(msg);//致命错误信息
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if(type != QtCriticalMsg )
|
||||||
|
{
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
txt =msg;// txt + QString(" line:%1").arg(context.line);
|
||||||
|
|
||||||
|
QFile logFile("log.txt");
|
||||||
|
logFile.open(QIODevice::WriteOnly | QIODevice::Append);
|
||||||
|
QTextStream in(&logFile);
|
||||||
|
in << txt << endl;
|
||||||
|
}
|
||||||
21
xyylMCWEACSystem/logger.h
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef LOGGER_H
|
||||||
|
#define LOGGER_H
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QThread>
|
||||||
|
#include <iostream>
|
||||||
|
#ifndef logData
|
||||||
|
#define logData "["<< __TIME__ <<"]"<<"[line:"<<__LINE__<<"]"<<"[fuction:"<<__FUNCTION__<<"]"<<"[ID:"<<QThread::currentThreadId()<<"]"// "["<<__TIME__ <<"]"<< "["<<__FILE__ <<"]"<< "[line:"<<__LINE__<<"]"<<__FUNCTION__<<"[threadID:"<<QThread::currentThreadId()<<"]"
|
||||||
|
//#define logData "["<<__DATE__<< __TIME__ <<"]"<< "["<<__FILE__ <<"]"<< "[line:"<<__LINE__<<"]"<<__FUNCTION__
|
||||||
|
#define logDebug() qDebug()<<logData<<"logDebug:"
|
||||||
|
#define logWarning() qWarning()<<logData<<"logWarning:"
|
||||||
|
#define logError() qCritical()<<logData<<"logError:"
|
||||||
|
#define logInfo() qInfo()<<logData<<"logInfo:"
|
||||||
|
#endif
|
||||||
|
void MessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // LOGGER_H
|
||||||
@@ -1,22 +1,5 @@
|
|||||||
#include "widget.h"
|
#include "widget.h"
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include "regwidget.h"
|
|
||||||
#include "loginwidget.h"
|
|
||||||
#include "medicalrecordwidget.h"
|
|
||||||
#include "medicalrecordmanager.h"
|
|
||||||
#include "hospitalinfo.h"
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <QGraphicsView>
|
|
||||||
#include <QGraphicsScene>
|
|
||||||
#include <QGraphicsPathItem>
|
|
||||||
#include <QGraphicsPolygonItem>
|
|
||||||
#include <QGraphicsTextItem>
|
|
||||||
#include <QPainterPath>
|
|
||||||
#include <QFont>
|
|
||||||
#include <QColor>
|
|
||||||
#include <QPen>
|
|
||||||
|
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
@@ -26,122 +9,67 @@
|
|||||||
#include <QGraphicsTextItem>
|
#include <QGraphicsTextItem>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <qmath.h>
|
#include <qmath.h>
|
||||||
#include "curchatwidget.h"
|
|
||||||
#include "DevConWidget.h"
|
|
||||||
#include "framewindow.h"
|
#include "framewindow.h"
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
|
|
||||||
#include "navlistwidget.h"
|
|
||||||
#include "framelesswindow.h"
|
#include "framelesswindow.h"
|
||||||
|
#include <QTextCodec>
|
||||||
|
#include "logger.h"
|
||||||
|
#include "hospitalinfo.h"
|
||||||
|
#include "framebtn.h"
|
||||||
|
#include "mainbtn.h"
|
||||||
|
void LoadStyleFile(QString strStyle)
|
||||||
|
{
|
||||||
|
QFile qss(strStyle);
|
||||||
|
qss.open(QFile::ReadOnly);
|
||||||
|
QString sqss =qss.readAll();
|
||||||
|
qApp->setStyleSheet(sqss);
|
||||||
|
qss.close();
|
||||||
|
}
|
||||||
|
|
||||||
#include "medicalrecordmanager.h"
|
#include<QDateEdit>
|
||||||
#include "parametersettingswidget.h"
|
|
||||||
#include <QCalendarWidget>
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
// QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
//qInstallMessageHandler(MessageHandler);
|
||||||
|
QTextCodec *codec = QTextCodec::codecForName("GBK");
|
||||||
|
QTextCodec::setCodecForLocale(codec);
|
||||||
FrameWindow *mainw = new FrameWindow;
|
FrameWindow *mainw = new FrameWindow;
|
||||||
FramelessWindow *window = new FramelessWindow(mainw);
|
// FramelessWindow *window = new FramelessWindow(mainw);
|
||||||
window->resize(300, 400);
|
//window->resize(300, 400);
|
||||||
window->showMaximized();
|
// window->showMaximized();
|
||||||
|
mainw->showMaximized();
|
||||||
//a.setStyleSheet("QWidget{background-color:#ffffff;}");
|
QFont globalFont;
|
||||||
// a.setStyleSheet("QWidget{background: rgb(47, 61, 82);}");
|
globalFont.setFamily("黑体");
|
||||||
QFont globalFont;
|
|
||||||
globalFont.setFamily("黑体");
|
|
||||||
QApplication::setFont(globalFont);
|
QApplication::setFont(globalFont);
|
||||||
MedicalRecordManager me;
|
LoadStyleFile(QApplication::applicationDirPath()+"/defaultstyle.qss");
|
||||||
me.show();
|
|
||||||
|
|
||||||
ParameterSettingsWidget mekl;
|
|
||||||
mekl.show();
|
|
||||||
|
|
||||||
|
|
||||||
PerWidget kkss;
|
|
||||||
kkss.show();
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
CurChatWidget w;
|
|
||||||
w.show();
|
|
||||||
RegWidget re;
|
|
||||||
re.show();
|
|
||||||
|
|
||||||
DevConWidget de;
|
|
||||||
de.show();
|
|
||||||
|
|
||||||
HospitalInfo ho;
|
|
||||||
ho.show();
|
|
||||||
|
|
||||||
LoginWidget log;
|
|
||||||
log.show();
|
|
||||||
|
|
||||||
|
|
||||||
MedicalRecordWidget mew;
|
|
||||||
mew.show();
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString qss1=R"(
|
#if 1
|
||||||
QLineEdit{
|
QDateTimeEdit date;
|
||||||
border: 1px solid #ABCDA0; /* 边框宽度为1px,颜色为#A0A0A0 */
|
date.setStyleSheet("QDateTimeEdit::drop-down {\
|
||||||
border-radius: 3px; /* 边框圆角 */
|
width: 80px; \
|
||||||
padding-left: 5px; /* 文本距离左边界有5px */
|
border-left-width: 0px; \
|
||||||
background-color: #F2F2F2; /* 背景颜色 */
|
border-image:url(:/image/dateEdit.png);\
|
||||||
color: #A0A0A0; /* 文本颜色 */
|
border-left-color: gray; \
|
||||||
selection-background-color: #A0A0A0; /* 选中文本的背景颜色 */
|
}");
|
||||||
selection-color: #F2F2F2; /* 选中文本的颜色 */
|
date.setCalendarPopup(true);
|
||||||
font-family: "Microsoft YaHei"; /* 文本字体族 */
|
|
||||||
font-size: 10pt; /* 文本字体大小 */
|
date.show();
|
||||||
}
|
#else
|
||||||
|
QDateEdit date;
|
||||||
QLineEdit:hover { /* 鼠标悬浮在QLineEdit时的状态 */
|
date.setDisplayFormat("yyyy-MM-dd hh:mm:ss.zzz");
|
||||||
border: 1px solid #298DFF;
|
date.setStyleSheet("QDateEdit::drop-down {\
|
||||||
border-radius: 3px;
|
width: 80px; \
|
||||||
background-color: #F2F2F2;
|
border-left-width: 0px; \
|
||||||
color: #298DFF;
|
border-image:url(:/image/dateEdit.png);\
|
||||||
selection-background-color: #298DFF;
|
border-left-color: gray; \
|
||||||
selection-color: #F2F2F2;
|
}");
|
||||||
}
|
date.setCalendarPopup(true);
|
||||||
|
date.show();
|
||||||
QLineEdit[echoMode="2"] { /* QLineEdit有输入掩码时的状态 */
|
#endif
|
||||||
lineedit-password-character: 9679;
|
return a.exec();
|
||||||
lineedit-password-mask-delay: 2000;
|
|
||||||
}
|
|
||||||
|
|
||||||
QLineEdit:disabled { /* QLineEdit在禁用时的状态 */
|
|
||||||
border: 1px solid #CDCDCD;
|
|
||||||
background-color: #CDCDCD;
|
|
||||||
color: #B4B4B4;
|
|
||||||
}
|
|
||||||
|
|
||||||
QLineEdit:read-only { /* QLineEdit在只读时的状态 */
|
|
||||||
background-color: #CDCDCD;
|
|
||||||
color: #F2F2F2;
|
|
||||||
}
|
|
||||||
QTextEdit{ color: black;
|
|
||||||
background-color: white; border:1px solid black;
|
|
||||||
}
|
|
||||||
QPushButton{border:1px solid black;}
|
|
||||||
QGroupBox{
|
|
||||||
background-color: #4F4F4F;
|
|
||||||
border: 1px solid #969696;
|
|
||||||
color: rgb(13,157,219);
|
|
||||||
border-radius: 5px;
|
|
||||||
margin-top: 2ex;
|
|
||||||
}
|
|
||||||
QDateEdit
|
|
||||||
{
|
|
||||||
border: 1px solid rgb(22,63,23);
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
)";
|
|
||||||
|
|
||||||
a.setStyleSheet(qss1);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return a.exec();
|
|
||||||
}
|
}
|
||||||
|
|||||||
73
xyylMCWEACSystem/mainbtn.cpp
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#include "mainbtn.h"
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
void MainBtn::setTxt(QString str,QString str2,QString str3)
|
||||||
|
{
|
||||||
|
m_labTxt.setText(str);
|
||||||
|
m_labEgTxt.setText(str2) ;
|
||||||
|
// m_labImage.setText(str3);
|
||||||
|
|
||||||
|
|
||||||
|
m_labImage.setStyleSheet(QString("QLabel{border-image:url(:/image/%1.png);background-color: transparent;}").arg(str3));
|
||||||
|
}
|
||||||
|
MainBtn::MainBtn(QPushButton * parent ):QPushButton (parent)
|
||||||
|
{
|
||||||
|
setObjectName("MainBtn");
|
||||||
|
|
||||||
|
m_labTxt.setObjectName("MainTxt");
|
||||||
|
m_labEgTxt.setObjectName("MainTxtEn");
|
||||||
|
#if 0
|
||||||
|
this->setStyleSheet("QPushButton{border-image:url(:/image/index_bg_setting.png);}"
|
||||||
|
"QPushButton:hover{border-image:url(:/image/index_bg_setting_hover.png);}"
|
||||||
|
"QPushButton:pressed{border-image:url(:/image/index_bg_setting_checked.png);}" );
|
||||||
|
m_labTxt.setStyleSheet("font-size: 60px;font-weight: 500;color:white;background-color:transparent;");
|
||||||
|
m_labEgTxt.setStyleSheet("font-size: 60px;font-weight:normal;color:white;background-color:transparent;");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_labTxt.setStyleSheet("font-size: 60px;font-weight: 500;color:white;background-color:transparent;");
|
||||||
|
m_labEgTxt.setStyleSheet("font-size: 60px;font-weight:normal;color:white;background-color:transparent;");
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
m_labTxt.setFixedSize(QSize(240,87));
|
||||||
|
|
||||||
|
m_labImage.setFixedSize(QSize(129,117));
|
||||||
|
|
||||||
|
#endif
|
||||||
|
QHBoxLayout * hlay = new QHBoxLayout;
|
||||||
|
QHBoxLayout * hlay2 = new QHBoxLayout;
|
||||||
|
QHBoxLayout * hlay3 = new QHBoxLayout;
|
||||||
|
hlay->addWidget(&m_labTxt);
|
||||||
|
hlay->addStretch();
|
||||||
|
hlay2->addWidget(&m_labEgTxt);
|
||||||
|
hlay2->addStretch();
|
||||||
|
hlay3->addStretch();
|
||||||
|
hlay3->addWidget(&m_labImage);
|
||||||
|
|
||||||
|
|
||||||
|
QVBoxLayout * vlay = new QVBoxLayout;
|
||||||
|
vlay->addLayout(hlay);
|
||||||
|
vlay->addLayout(hlay2);
|
||||||
|
vlay->addSpacing(143);
|
||||||
|
vlay->addLayout(hlay3);
|
||||||
|
vlay->setSpacing(0);
|
||||||
|
vlay->setContentsMargins(45,45,45,45);
|
||||||
|
setFixedSize(QSize(450,500));
|
||||||
|
setLayout(vlay);
|
||||||
|
}
|
||||||
|
MainBtn::~MainBtn()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
|
void MainBtn::mouseReleaseEvent(QMouseEvent * ev)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
void MainBtn::paintEvent(QPaintEvent* event)
|
||||||
|
{
|
||||||
|
QStyleOption opt;
|
||||||
|
opt.init(this);
|
||||||
|
QPainter p(this);
|
||||||
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
35
xyylMCWEACSystem/mainbtn.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#ifndef MAINBTN_H
|
||||||
|
#define MAINBTN_H
|
||||||
|
#include <QFrame>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QStyleOption>
|
||||||
|
#include <QPaintEvent>
|
||||||
|
#include <QPainter>
|
||||||
|
|
||||||
|
|
||||||
|
class MainBtn:public QPushButton
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
MainBtn(QPushButton * parent =NULL);
|
||||||
|
~MainBtn();
|
||||||
|
void setTxt(QString str,QString str2,QString str3);
|
||||||
|
// void paintEvent(QPaintEvent* event);
|
||||||
|
void paintEvent(QPaintEvent* event)
|
||||||
|
{
|
||||||
|
QStyleOption opt;
|
||||||
|
opt.init(this);
|
||||||
|
QPainter p(this);
|
||||||
|
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||||
|
}
|
||||||
|
signals:
|
||||||
|
// void clicked();
|
||||||
|
protected:
|
||||||
|
//virtual void mouseReleaseEvent(QMouseEvent * ev);
|
||||||
|
private:
|
||||||
|
QLabel m_labTxt;
|
||||||
|
QLabel m_labEgTxt;
|
||||||
|
QLabel m_labImage;
|
||||||
|
};
|
||||||
|
#endif // MAINBTN_H
|
||||||
@@ -9,6 +9,7 @@ MainWindow::MainWindow(QWidget * parent ):QWidget(parent)
|
|||||||
init();
|
init();
|
||||||
initLay();
|
initLay();
|
||||||
initConnect();
|
initConnect();
|
||||||
|
|
||||||
}
|
}
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
@@ -22,10 +23,10 @@ void MainWindow::init()
|
|||||||
m_btnEEG.setObjectName("EEG");
|
m_btnEEG.setObjectName("EEG");
|
||||||
m_btnDataProcess.setObjectName("DataProcess");
|
m_btnDataProcess.setObjectName("DataProcess");
|
||||||
m_CompanyDes.setText("河南翔宇医疗设备股份有限公司");
|
m_CompanyDes.setText("河南翔宇医疗设备股份有限公司");
|
||||||
QFont font ("Microsoft YaHei", 10, 85);
|
|
||||||
m_CompanyDes.setFont(font);
|
|
||||||
|
|
||||||
m_CompanyDes.setStyleSheet("color:Gray;");
|
m_btnDataProcess.setTxt("数据处理","Data processing","data");
|
||||||
|
m_btnEEG.setTxt("脑电采集","EGG acquisition","acq");
|
||||||
|
m_btnSystemSetting.setTxt("系统设置","Set up","setup");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -34,6 +35,12 @@ void MainWindow::initLay()
|
|||||||
|
|
||||||
QHBoxLayout * hlay = new QHBoxLayout;
|
QHBoxLayout * hlay = new QHBoxLayout;
|
||||||
|
|
||||||
|
|
||||||
|
m_btnSystemSetting.setObjectName("systemsetting");
|
||||||
|
m_btnEEG.setObjectName("egg");
|
||||||
|
m_btnDataProcess.setObjectName("dataprocess");
|
||||||
|
#if 0
|
||||||
|
|
||||||
m_btnSystemSetting.setStyleSheet("border-image:url(:/image/index_bg_setting_char.png);}");
|
m_btnSystemSetting.setStyleSheet("border-image:url(:/image/index_bg_setting_char.png);}");
|
||||||
m_btnEEG.setStyleSheet("border-image:url(:/image/index_bg_EEG_char.png);}");
|
m_btnEEG.setStyleSheet("border-image:url(:/image/index_bg_EEG_char.png);}");
|
||||||
m_btnDataProcess.setStyleSheet("border-image:url(:/image/index_bg_data_char.png);}");
|
m_btnDataProcess.setStyleSheet("border-image:url(:/image/index_bg_data_char.png);}");
|
||||||
@@ -52,6 +59,7 @@ void MainWindow::initLay()
|
|||||||
"QPushButton:hover{border-image:url(:/image/index_bg_data_hover.png);}"
|
"QPushButton:hover{border-image:url(:/image/index_bg_data_hover.png);}"
|
||||||
"QPushButton:pressed{border-image:url(:/image/index_bg_data_checked.png);}"
|
"QPushButton:pressed{border-image:url(:/image/index_bg_data_checked.png);}"
|
||||||
);
|
);
|
||||||
|
|
||||||
m_btnSystemSetting.setMaximumSize(QSize(400,300));
|
m_btnSystemSetting.setMaximumSize(QSize(400,300));
|
||||||
m_btnEEG.setMaximumSize(QSize(400,300));
|
m_btnEEG.setMaximumSize(QSize(400,300));
|
||||||
m_btnDataProcess.setMaximumSize(QSize(400,300));
|
m_btnDataProcess.setMaximumSize(QSize(400,300));
|
||||||
@@ -60,6 +68,7 @@ void MainWindow::initLay()
|
|||||||
m_btnSystemSetting.setMinimumSize(QSize(300,200));
|
m_btnSystemSetting.setMinimumSize(QSize(300,200));
|
||||||
m_btnEEG.setMinimumSize(QSize(300,300));
|
m_btnEEG.setMinimumSize(QSize(300,300));
|
||||||
m_btnDataProcess.setMinimumSize(QSize(300,300));
|
m_btnDataProcess.setMinimumSize(QSize(300,300));
|
||||||
|
#endif
|
||||||
|
|
||||||
m_btnSystemSetting.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
m_btnSystemSetting.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
m_btnEEG.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
m_btnEEG.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include "titlewidget.h"
|
#include "titlewidget.h"
|
||||||
|
#include "mainbtn.h"
|
||||||
class MainWindow: public QWidget
|
class MainWindow: public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -26,11 +27,11 @@ signals:
|
|||||||
private:
|
private:
|
||||||
TitleWidget m_titleWidget;
|
TitleWidget m_titleWidget;
|
||||||
//系统设置
|
//系统设置
|
||||||
QPushButton m_btnSystemSetting;
|
MainBtn m_btnSystemSetting;
|
||||||
//脑电采集Electroencephalography
|
//脑电采集Electroencephalography
|
||||||
QPushButton m_btnEEG;
|
MainBtn m_btnEEG;
|
||||||
//数据处理Datarocessing
|
//数据处理Datarocessing
|
||||||
QPushButton m_btnDataProcess;
|
MainBtn m_btnDataProcess;
|
||||||
//河南翔宇医疗设备股份有限公司
|
//河南翔宇医疗设备股份有限公司
|
||||||
QLabel m_CompanyDes;
|
QLabel m_CompanyDes;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QScrollBar>
|
||||||
MedicalRecordManager::MedicalRecordManager(QWidget * parent):QWidget(parent)
|
MedicalRecordManager::MedicalRecordManager(QWidget * parent):QWidget(parent)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
@@ -11,9 +11,8 @@ MedicalRecordManager::MedicalRecordManager(QWidget * parent):QWidget(parent)
|
|||||||
initConnect();
|
initConnect();
|
||||||
initTable();
|
initTable();
|
||||||
|
|
||||||
m_labMedRecManager.setStyleSheet("QLabel { font-size: 14px;\
|
m_btnOpen.setObjectName("open");
|
||||||
color: rgb(13,157,219); }\
|
#if 0
|
||||||
");
|
|
||||||
m_btnOpen.setStyleSheet("QPushButton{\
|
m_btnOpen.setStyleSheet("QPushButton{\
|
||||||
background: white;\
|
background: white;\
|
||||||
border-radius:10px;padding:7px 10px;\
|
border-radius:10px;padding:7px 10px;\
|
||||||
@@ -30,6 +29,7 @@ MedicalRecordManager::MedicalRecordManager(QWidget * parent):QWidget(parent)
|
|||||||
background: #0d9ddb;\
|
background: #0d9ddb;\
|
||||||
border-radius:10px;padding:7px 10px;\
|
border-radius:10px;padding:7px 10px;\
|
||||||
}");
|
}");
|
||||||
|
#endif
|
||||||
m_btnEdit.setStyleSheet("QPushButton{\
|
m_btnEdit.setStyleSheet("QPushButton{\
|
||||||
background: white;\
|
background: white;\
|
||||||
color: green;\
|
color: green;\
|
||||||
@@ -174,7 +174,12 @@ MedicalRecordManager::~MedicalRecordManager()
|
|||||||
}
|
}
|
||||||
void MedicalRecordManager::init()
|
void MedicalRecordManager::init()
|
||||||
{
|
{
|
||||||
|
//当前页
|
||||||
|
m_currentPage = 0 ;
|
||||||
|
|
||||||
m_labMedRecManager.setText("病例管理");
|
m_labMedRecManager.setText("病例管理");
|
||||||
|
m_labMedRecManager.setObjectName("labMedManager");
|
||||||
|
m_labMedRecManager.setStyleSheet("width: 136px; height: 46px;font-family: 思源黑体;font-size: 32px;font-weight: 500; color: #0D9DDB;");
|
||||||
//QAction
|
//QAction
|
||||||
m_actSearch = new QAction;
|
m_actSearch = new QAction;
|
||||||
m_actSearch->setToolTip("搜索");//设置鼠标悬浮的提示
|
m_actSearch->setToolTip("搜索");//设置鼠标悬浮的提示
|
||||||
@@ -268,19 +273,23 @@ void MedicalRecordManager::initLay()
|
|||||||
}
|
}
|
||||||
bool MedicalRecordManager::initConnect()
|
bool MedicalRecordManager::initConnect()
|
||||||
{
|
{
|
||||||
|
|
||||||
connect(m_actSearch, SIGNAL(triggered(bool)), this, SLOT(slotSearch()));
|
connect(m_actSearch, SIGNAL(triggered(bool)), this, SLOT(slotSearch()));
|
||||||
|
connect(&m_btnUpPage,SIGNAL(clicked()),this,SLOT(slotPreviousPage()));
|
||||||
|
connect(&m_btnNetPage,SIGNAL(clicked()),this,SLOT(slotNextPage()));
|
||||||
|
connect(&m_btnDelete,SIGNAL(clicked()),this,SLOT(slotDelete()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void MedicalRecordManager::slotSearch()
|
void MedicalRecordManager::slotSearch()
|
||||||
{
|
{
|
||||||
qDebug()<<"search"<<endl;
|
qDebug()<<"search"<<endl;
|
||||||
|
m_currentPage = 0;
|
||||||
|
updateContext();
|
||||||
|
|
||||||
}
|
}
|
||||||
void MedicalRecordManager::initTable()
|
void MedicalRecordManager::initTable()
|
||||||
{
|
{
|
||||||
m_tableWidget.setFocusPolicy(Qt::NoFocus);
|
m_tableWidget.setFocusPolicy(Qt::NoFocus);
|
||||||
m_tableWidget.setColumnCount(8);
|
m_tableWidget.setColumnCount(9);
|
||||||
m_tableWidget.setRowCount(100);
|
m_tableWidget.setRowCount(100);
|
||||||
//m_tableWidget.setShowGrid(false);
|
//m_tableWidget.setShowGrid(false);
|
||||||
QFont font;
|
QFont font;
|
||||||
@@ -289,6 +298,8 @@ void MedicalRecordManager::initTable()
|
|||||||
font.setBold(false);
|
font.setBold(false);
|
||||||
m_tableWidget.horizontalHeader()->setFont(font);
|
m_tableWidget.horizontalHeader()->setFont(font);
|
||||||
m_tableWidget.setFont(font);
|
m_tableWidget.setFont(font);
|
||||||
|
m_tableWidget.verticalScrollBar()->setDisabled(true); // 禁用滚动
|
||||||
|
m_tableWidget.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);//隐藏滚动条
|
||||||
//设置全选按钮
|
//设置全选按钮
|
||||||
//connect(&m_tableWidget, SIGNAL(itemClicked(QTableWidgetItem *)), this, SLOT(slotCilclidItem(QTableWidgetItem *)), Qt::QueuedConnection);
|
//connect(&m_tableWidget, SIGNAL(itemClicked(QTableWidgetItem *)), this, SLOT(slotCilclidItem(QTableWidgetItem *)), Qt::QueuedConnection);
|
||||||
|
|
||||||
@@ -302,10 +313,13 @@ void MedicalRecordManager::initTable()
|
|||||||
/*单个选中 QAbstractItemView::ExtendedSelection); 可以选中多个*/
|
/*单个选中 QAbstractItemView::ExtendedSelection); 可以选中多个*/
|
||||||
m_tableWidget.horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||||
m_tableWidget.horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||||
//m_tableWidget.horizontalHea der()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||||
m_tableWidget.horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
|
||||||
m_tableWidget.horizontalHeader()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
||||||
m_tableWidget.horizontalHeader()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(5, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(6, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(7, QHeaderView::ResizeToContents);
|
||||||
m_tableWidget.setEditTriggers(QAbstractItemView::NoEditTriggers);
|
m_tableWidget.setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||||
m_tableWidget.setShowGrid(false);
|
m_tableWidget.setShowGrid(false);
|
||||||
for (int row = 0; row < m_tableWidget.rowCount(); row++)
|
for (int row = 0; row < m_tableWidget.rowCount(); row++)
|
||||||
@@ -318,6 +332,7 @@ void MedicalRecordManager::initTable()
|
|||||||
QTableWidgetItem *item_hash6 = new QTableWidgetItem;
|
QTableWidgetItem *item_hash6 = new QTableWidgetItem;
|
||||||
QTableWidgetItem *item_butt7 = new QTableWidgetItem;
|
QTableWidgetItem *item_butt7 = new QTableWidgetItem;
|
||||||
QTableWidgetItem *item_createDate8 = new QTableWidgetItem;
|
QTableWidgetItem *item_createDate8 = new QTableWidgetItem;
|
||||||
|
QTableWidgetItem *item_createDate9 = new QTableWidgetItem;
|
||||||
item_id->setData(Qt::DisplayRole, "");
|
item_id->setData(Qt::DisplayRole, "");
|
||||||
item_fileName->setData(Qt::DisplayRole, "");
|
item_fileName->setData(Qt::DisplayRole, "");
|
||||||
|
|
||||||
@@ -338,13 +353,187 @@ void MedicalRecordManager::initTable()
|
|||||||
m_tableWidget.setItem(row, 5, item_hash6);
|
m_tableWidget.setItem(row, 5, item_hash6);
|
||||||
m_tableWidget.setItem(row, 6, item_butt7);
|
m_tableWidget.setItem(row, 6, item_butt7);
|
||||||
m_tableWidget.setItem(row, 7, item_createDate8);
|
m_tableWidget.setItem(row, 7, item_createDate8);
|
||||||
|
m_tableWidget.setItem(row, 8, item_createDate9);
|
||||||
|
|
||||||
//m_tableWidget.item(row, 4)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
//m_tableWidget.item(row, 4)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
}
|
}
|
||||||
QStringList lstHHead;
|
QStringList lstHHead;
|
||||||
/*("序号") "文件") << "修改日期"*/
|
/*("序号") "文件") << "修改日期"*/
|
||||||
lstHHead << tr("序号") << tr("检查号") << tr("类别") << tr("姓名") <<tr("性别")
|
lstHHead << tr("序号") << tr("检查号") << tr("类别") << tr("姓名") <<tr("性别")
|
||||||
<< tr("年龄") <<tr("左右利")<<tr("其他信息");
|
<< tr("年龄") <<tr("左右利")<<tr("检查日期")<<tr("其他信息");
|
||||||
m_tableWidget.setHorizontalHeaderLabels(lstHHead);//setWordWrap(true)
|
m_tableWidget.setHorizontalHeaderLabels(lstHHead);//setWordWrap(true)
|
||||||
//m_tableWidget.show();
|
//m_tableWidget.show();
|
||||||
}
|
}
|
||||||
|
void MedicalRecordManager::slotPreviousPage()
|
||||||
|
{
|
||||||
|
if (m_currentPage > 1)
|
||||||
|
{
|
||||||
|
m_currentPage = m_currentPage - 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
updateContext();
|
||||||
|
}
|
||||||
|
void MedicalRecordManager::slotNextPage()
|
||||||
|
{
|
||||||
|
updateContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
void MedicalRecordManager::updateContext()
|
||||||
|
{
|
||||||
|
QString fileName = m_editSearch.text();
|
||||||
|
fileName = fileName.simplified();
|
||||||
|
QList<MedicRecord> lstInfo;
|
||||||
|
int rowCounts = DataManager::instance().getMedicRecordCount(fileName);
|
||||||
|
qDebug() << fileName << rowCounts << endl;
|
||||||
|
double page = (double)rowCounts / (double)100;
|
||||||
|
if (page > (int)page)
|
||||||
|
{
|
||||||
|
page = page + 1;
|
||||||
|
}
|
||||||
|
else if (page == 0)
|
||||||
|
{
|
||||||
|
page = 1;
|
||||||
|
}
|
||||||
|
if (m_currentPage == (int)page)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(m_currentPage!=0)
|
||||||
|
{
|
||||||
|
m_labPageNumTxt.setText(QString("%1/%2").arg(m_currentPage).arg(QString::number((int)page)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_labPageNumTxt.setText(QString("%1/%2").arg(1).arg(QString::number((int)page)));
|
||||||
|
}
|
||||||
|
|
||||||
|
DataManager::instance().getMedicRecordList(fileName, lstInfo, m_currentPage, m_tableWidget.rowCount());
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
||||||
|
m_tableWidget.verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
||||||
|
QString::number((int)page);//设置一共有多少页
|
||||||
|
int row = 0;
|
||||||
|
for (; row < lstInfo.size(); row++)
|
||||||
|
{
|
||||||
|
int col=0;
|
||||||
|
QTableWidgetItem *item_id = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_m_CheckNum = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_type = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_Name = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_Sex = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_Age = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_Laterality = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_inspectDate = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_other = m_tableWidget.item(row, col++);
|
||||||
|
item_id->setCheckState(Qt::Unchecked);
|
||||||
|
item_id->setFlags(Qt::ItemIsEditable| Qt::ItemIsSelectable| Qt::ItemIsUserCheckable| Qt::ItemIsEnabled| Qt::ItemIsDragEnabled| Qt::ItemIsDropEnabled);
|
||||||
|
int id_page = 0;
|
||||||
|
if (m_currentPage == 0)
|
||||||
|
{
|
||||||
|
id_page = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
id_page = m_currentPage;
|
||||||
|
}
|
||||||
|
item_id->setData(Qt::DisplayRole, row + 1 + (id_page - 1) * 100);
|
||||||
|
//设置数据
|
||||||
|
item_m_CheckNum->setData(Qt::DisplayRole, lstInfo.at(row).m_CheckNum);
|
||||||
|
item_type->setData(Qt::DisplayRole, lstInfo.at(row).m_Type);
|
||||||
|
item_Name->setData(Qt::DisplayRole, lstInfo.at(row).m_Name);
|
||||||
|
item_Sex->setData(Qt::DisplayRole, lstInfo.at(row).m_Sex);
|
||||||
|
item_Age->setData(Qt::DisplayRole, lstInfo.at(row).m_Year);
|
||||||
|
item_Laterality->setData(Qt::DisplayRole, lstInfo.at(row).m_Laterality);
|
||||||
|
item_inspectDate->setData(Qt::DisplayRole, lstInfo.at(row).m_InspectDate);
|
||||||
|
item_other->setData(Qt::DisplayRole, lstInfo.at(row).m_Other);
|
||||||
|
|
||||||
|
item_m_CheckNum->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
item_type->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
item_Name->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
item_Sex->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
item_Age->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
|
||||||
|
item_Laterality->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
item_inspectDate->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
item_other->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (row < m_tableWidget.rowCount())
|
||||||
|
{
|
||||||
|
for (int i = row; i < m_tableWidget.rowCount(); i++)
|
||||||
|
{
|
||||||
|
int col=0;
|
||||||
|
QTableWidgetItem *item_id = m_tableWidget.item(i, col++);
|
||||||
|
QTableWidgetItem *item_m_CheckNum = m_tableWidget.item(i, col++);
|
||||||
|
QTableWidgetItem *item_type = m_tableWidget.item(i, col++);
|
||||||
|
QTableWidgetItem *item_Name = m_tableWidget.item(i, col++);
|
||||||
|
QTableWidgetItem *item_Sex = m_tableWidget.item(i, col++);
|
||||||
|
QTableWidgetItem *item_Age = m_tableWidget.item(i, col++);
|
||||||
|
QTableWidgetItem *item_Laterality = m_tableWidget.item(i, col++);
|
||||||
|
QTableWidgetItem *item_inspectDate = m_tableWidget.item(i, col++);
|
||||||
|
QTableWidgetItem *item_other = m_tableWidget.item(i, col++);
|
||||||
|
item_id->setData(Qt::CheckStateRole, QVariant());
|
||||||
|
item_id->setData(Qt::DisplayRole, "");
|
||||||
|
//item_id->setFlags(Qt::NoItemFlags);
|
||||||
|
item_m_CheckNum->setData(Qt::DisplayRole, "");
|
||||||
|
item_type->setData(Qt::DisplayRole, "");
|
||||||
|
item_Name->setData(Qt::DisplayRole, "");
|
||||||
|
item_Sex->setData(Qt::DisplayRole, "");
|
||||||
|
item_Age->setData(Qt::DisplayRole, "");
|
||||||
|
item_Age->setData(Qt::DisplayRole, "");
|
||||||
|
item_Laterality->setData(Qt::DisplayRole, "");
|
||||||
|
item_inspectDate->setData(Qt::DisplayRole, "");
|
||||||
|
item_other->setData(Qt::DisplayRole, "");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (m_currentPage == 0)
|
||||||
|
{
|
||||||
|
//m_labCurentPage.setText(QString::number(1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//m_labCurentPage.setText(QString::number(m_currentPage));
|
||||||
|
}
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);//单独使用--每一列宽度平均//Qt::4 //horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(1, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(3, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(4, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(5, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(6, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.horizontalHeader()->setSectionResizeMode(7, QHeaderView::ResizeToContents);
|
||||||
|
// m_tableWidget.horizontalHeader()->setSectionResizeMode(8, QHeaderView::ResizeToContents);
|
||||||
|
m_tableWidget.verticalHeader()->scrollToTop();
|
||||||
|
m_tableWidget.scrollToTop();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void MedicalRecordManager::slotDelete()
|
||||||
|
{
|
||||||
|
QStringList CheckNumList;
|
||||||
|
for (int i = 0; i < m_tableWidget.rowCount(); i++)
|
||||||
|
{
|
||||||
|
QTableWidgetItem *item_id = m_tableWidget.item(i, 0);
|
||||||
|
QTableWidgetItem *item_fileName = m_tableWidget.item(i, 1);
|
||||||
|
|
||||||
|
if (item_id->checkState() == Qt::CheckState::Checked)
|
||||||
|
{
|
||||||
|
//item_id->setCheckState(Qt::CheckState::Unchecked);
|
||||||
|
//item_id->setFlags(Qt::ItemIsSelectable);
|
||||||
|
int id = item_id->data(Qt::DisplayRole).toInt();
|
||||||
|
QString checkNum = item_fileName->data(Qt::DisplayRole).toString();
|
||||||
|
CheckNumList.append(checkNum);
|
||||||
|
bool okret = DataManager::instance().deleteNumRecode(checkNum);
|
||||||
|
if(!okret)
|
||||||
|
{
|
||||||
|
qDebug()<<"fails delete"<<endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_currentPage =0 ;
|
||||||
|
updateContext();
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,9 +14,10 @@
|
|||||||
#include <QDateEdit>
|
#include <QDateEdit>
|
||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
#include <QTabWidget>
|
#include <QTabWidget>
|
||||||
|
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
#include "datamanager.h"
|
||||||
|
|
||||||
class MedicalRecordManager:public QWidget
|
class MedicalRecordManager:public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -33,6 +34,16 @@ private slots:
|
|||||||
des: 搜索
|
des: 搜索
|
||||||
*/
|
*/
|
||||||
void slotSearch();
|
void slotSearch();
|
||||||
|
|
||||||
|
|
||||||
|
//页面跳转
|
||||||
|
|
||||||
|
void slotPreviousPage();//上一页update
|
||||||
|
void slotNextPage(); //下一页
|
||||||
|
void updateContext();
|
||||||
|
void slotDelete();
|
||||||
|
private:
|
||||||
|
int m_currentPage;
|
||||||
private:
|
private:
|
||||||
QLabel m_labMedRecManager;
|
QLabel m_labMedRecManager;
|
||||||
QAction * m_actSearch;
|
QAction * m_actSearch;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
|
#include "datamanager.h"
|
||||||
|
#include <QButtonGroup>
|
||||||
MedicalRecordWidget::MedicalRecordWidget(QWidget * parent ):QWidget(parent)
|
MedicalRecordWidget::MedicalRecordWidget(QWidget * parent ):QWidget(parent)
|
||||||
{
|
{
|
||||||
init();
|
init();
|
||||||
@@ -27,83 +29,96 @@ void MedicalRecordWidget::init()
|
|||||||
|
|
||||||
// setFixedSize(600,600);
|
// setFixedSize(600,600);
|
||||||
m_labStar.setText(tr("*"));
|
m_labStar.setText(tr("*"));
|
||||||
|
m_labStar.setObjectName("labStar");
|
||||||
m_labStar2.setText(tr("*"));
|
m_labStar2.setText(tr("*"));
|
||||||
m_labStar.setStyleSheet("color:red");
|
m_labStar2.setObjectName("labStar");
|
||||||
m_labStar2.setStyleSheet("color:red");
|
m_dateInspection.setCalendarPopup(true);
|
||||||
|
m_dateBirthDay.setCalendarPopup(true);
|
||||||
|
|
||||||
|
m_dateBirthDay.setDisplayFormat("yyyy-MM-dd");
|
||||||
|
m_dateInspection.setDisplayFormat("yyyy-MM-dd");
|
||||||
|
QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||||
|
QString formattedDateTime = currentDateTime.toString("yyyy-MM-dd");
|
||||||
|
m_dateInspection.setDateTime(QDateTime::fromString(formattedDateTime, "yyyy-MM-dd"));
|
||||||
|
m_dateBirthDay.setDateTime(QDateTime::fromString(formattedDateTime, "yyyy-MM-dd"));
|
||||||
|
#if 1
|
||||||
|
m_dateBirthDay.setStyleSheet("QDateEdit{ border:1px solid #cccccc;background: #F5F7F9;border-radius: 12px;width: 400px;\
|
||||||
|
font-family: Source Han Sans;font-size: 28px;font-weight: normal;color: #999999;\
|
||||||
|
height: 60px;padding: 5px 20px;}");
|
||||||
|
#endif
|
||||||
|
m_dateInspection.setStyleSheet("QDateEdit{ border:1px solid #cccccc;background: #F5F7F9;border-radius: 12px;width: 400px;\
|
||||||
|
font-family: Source Han Sans;font-size: 28px;font-weight: normal;color: #999999;\
|
||||||
|
height: 60px;padding: 5px 20px;}");
|
||||||
#if 0
|
#if 0
|
||||||
//检查号
|
|
||||||
m_labCheckNum.setText(tr("CheckNum"));
|
|
||||||
|
|
||||||
//住院 hospitalized
|
|
||||||
m_labType.setText(tr("type"));
|
|
||||||
m_chHospitalized.setText(tr("hospitalized"));
|
|
||||||
//门诊
|
|
||||||
m_chOutpatient.setText(tr("Outpatient"));
|
|
||||||
|
|
||||||
//姓名
|
|
||||||
m_labName.setText(tr("Name"));
|
|
||||||
//性别
|
|
||||||
m_labSex.setText(tr("Sex"));;
|
|
||||||
//左右利
|
|
||||||
m_labLaterality.setText(tr("Laterality"));
|
|
||||||
//检查日期
|
|
||||||
m_labDate_Of_inspection.setText(tr("DateInspection"));
|
|
||||||
m_labAge.setText(tr("Age"));
|
|
||||||
m_labBirthDay.setText(tr("birthDay"));
|
|
||||||
//诊断病历
|
|
||||||
m_labDiagnosticRecord.setText(tr("Record"));
|
|
||||||
|
|
||||||
m_btnOk.setText(tr("ok"));
|
|
||||||
m_btnCancel.setText(tr("Cancel"));
|
|
||||||
|
|
||||||
int iwidth = QFontMetrics(this->font()).width("Laterality");
|
|
||||||
//m_labCheckNum.setFixedWidth(iwidth);
|
|
||||||
// m_labName.setFixedWidth(iwidth);
|
|
||||||
// m_labLaterality.setFixedWidth(iwidth);
|
|
||||||
//m_labDiagnosticRecord.setFixedWidth(iwidth);
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
m_gbx.setTitle("病历资料");
|
m_labTitle.setText("病历资料");
|
||||||
|
m_labTitle.setStyleSheet("width: 136px;font-family: 思源黑体;color: #0D9DDB; font-size: 32px;font-weight: 500;height: 46px;");
|
||||||
//检查号
|
//检查号
|
||||||
m_labCheckNum.setText(tr("检查号"));
|
m_labCheckNum.setText(tr("检 查 号:"));
|
||||||
|
m_labCheckNum.setObjectName("labCheckNum");
|
||||||
//住院 hospitalized
|
//住院 hospitalized
|
||||||
m_labType.setText(tr("类型"));
|
m_labType.setText(tr("类 型:"));
|
||||||
m_chHospitalized.setText(tr("住院"));
|
m_labType.setObjectName("labCheckNum");
|
||||||
|
m_chHospitalized.setText(tr("住院:"));
|
||||||
|
m_chHospitalized.setObjectName("labCheckNum");
|
||||||
//门诊
|
//门诊
|
||||||
m_chOutpatient.setText(tr("门诊"));
|
m_chOutpatient.setText(tr("门诊"));
|
||||||
|
m_chOutpatient.setObjectName("labCheckNum");
|
||||||
//姓名
|
//姓名
|
||||||
m_labName.setText(tr("姓 名"));
|
m_labName.setText(tr("姓 名:"));
|
||||||
|
m_labName.setObjectName("labCheckNum");
|
||||||
//性别
|
//性别
|
||||||
m_labSex.setText(tr("性别"));;
|
m_labSex.setText(tr("性 别:"));;
|
||||||
|
m_labSex.setObjectName("labCheckNum");
|
||||||
m_chMan.setText(tr("男"));;
|
m_chMan.setText(tr("男"));;
|
||||||
|
m_chMan.setObjectName("labCheckNum");
|
||||||
m_chWan.setText(tr("女"));;
|
m_chWan.setText(tr("女"));;
|
||||||
|
m_chWan.setObjectName("labCheckNum");
|
||||||
|
QButtonGroup *SexpButtonGroup = new QButtonGroup(this);
|
||||||
|
// 设置互斥
|
||||||
|
SexpButtonGroup->setExclusive(true);
|
||||||
|
SexpButtonGroup->addButton(&m_chMan);
|
||||||
|
SexpButtonGroup->addButton(&m_chWan);
|
||||||
|
// bool ok = connect(pButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(onButtonClicked(QAbstractButton*)));
|
||||||
|
|
||||||
|
|
||||||
//左右利
|
//左右利
|
||||||
m_labLaterality.setText(tr(" 左右利"));
|
m_labLaterality.setText(tr("左 右 利:"));
|
||||||
|
m_labLaterality.setObjectName("labCheckNum");
|
||||||
m_chLeft.setText(tr("左"));;
|
m_chLeft.setText(tr("左"));;
|
||||||
|
m_chLeft.setObjectName("labCheckNum");
|
||||||
m_chRfight.setText(tr("右"));;
|
m_chRfight.setText(tr("右"));;
|
||||||
|
m_chRfight.setObjectName("labCheckNum");
|
||||||
|
QButtonGroup *LabpButtonGroup = new QButtonGroup(this);
|
||||||
|
// 设置互斥
|
||||||
|
LabpButtonGroup->setExclusive(true);
|
||||||
|
LabpButtonGroup->addButton(&m_chLeft);
|
||||||
|
LabpButtonGroup->addButton(&m_chRfight);
|
||||||
|
|
||||||
|
|
||||||
//检查日期
|
//检查日期
|
||||||
m_labDate_Of_inspection.setText(tr("检查日期"));
|
m_labDate_Of_inspection.setText(tr("检查日期:"));
|
||||||
m_labAge.setText(tr("年龄"));
|
m_labDate_Of_inspection.setObjectName("labCheckNum");
|
||||||
m_labBirthDay.setText(tr("出生日期"));
|
m_labAge.setText(tr("年 龄:"));
|
||||||
|
m_labAge.setObjectName("labCheckNum");
|
||||||
|
m_labBirthDay.setText(tr("出生日期:"));
|
||||||
|
m_labBirthDay.setObjectName("labCheckNum");
|
||||||
//诊断病历
|
//诊断病历
|
||||||
m_labDiagnosticRecord.setText(tr("其 他:"));
|
m_labDiagnosticRecord.setText(tr("其他信息:"));
|
||||||
|
m_labDiagnosticRecord.setObjectName("labCheckNum");
|
||||||
m_labDiagnosticRecord.setFixedHeight(30);
|
m_labDiagnosticRecord.setFixedHeight(30);
|
||||||
m_btnOk.setText(tr("保存"));
|
m_btnOk.setText(tr("保存"));
|
||||||
m_btnCancel.setText(tr("取消"));
|
m_btnCancel.setText(tr("取消"));
|
||||||
|
m_btnOk.setObjectName("ok");
|
||||||
|
m_btnCancel.setObjectName("cancel");
|
||||||
int iwidth = QFontMetrics(this->font()).width("Laterality");
|
int iwidth = QFontMetrics(this->font()).width("Laterality");
|
||||||
//m_labCheckNum.setFixedWidth(iwidth);
|
|
||||||
// m_labName.setFixedWidth(iwidth);
|
|
||||||
// m_labLaterality.setFixedWidth(iwidth);
|
|
||||||
//m_labDiagnosticRecord.setFixedWidth(iwidth);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
void MedicalRecordWidget::initLay()
|
void MedicalRecordWidget::initLay()
|
||||||
{
|
{
|
||||||
#if 1
|
#if 0
|
||||||
QHBoxLayout * hlayStart1 = new QHBoxLayout;
|
QHBoxLayout * hlayStart1 = new QHBoxLayout;
|
||||||
hlayStart1->addWidget(&m_labStar);
|
hlayStart1->addWidget(&m_labStar);
|
||||||
hlayStart1->addWidget(&m_labCheckNum);
|
hlayStart1->addWidget(&m_labCheckNum);
|
||||||
@@ -184,34 +199,247 @@ void MedicalRecordWidget::initLay()
|
|||||||
m_chRfight.setFixedWidth(iwidth/2);
|
m_chRfight.setFixedWidth(iwidth/2);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
QGridLayout * gridlay = new QGridLayout;
|
||||||
|
int col = 0;
|
||||||
|
int row = 0;
|
||||||
|
gridlay->addWidget(&m_labStar,row,col,Qt::AlignRight);
|
||||||
|
gridlay->addWidget(&m_labCheckNum,row,++col);
|
||||||
|
gridlay->addWidget(&m_editCheckNum,row,++col);
|
||||||
|
|
||||||
QVBoxLayout * vlay1 = new QVBoxLayout;
|
|
||||||
QHBoxLayout * hlayStart1 = new QHBoxLayout;
|
|
||||||
hlayStart1->addWidget(&m_labStar);
|
|
||||||
hlayStart1->addWidget(&m_labCheckNum);
|
|
||||||
vlay1->addLayout(hlayStart1);
|
|
||||||
|
|
||||||
QHBoxLayout * hlayStart2 = new QHBoxLayout;
|
gridlay->addWidget(&m_labType,row,++col,Qt::AlignRight);
|
||||||
hlayStart2->addWidget(&m_labStar2);
|
QHBoxLayout * hlay_hostOut = new QHBoxLayout;
|
||||||
hlayStart2->addWidget(&m_labName);
|
hlay_hostOut->addWidget(&m_chHospitalized);
|
||||||
vlay1->addLayout(hlayStart2);
|
hlay_hostOut->addWidget(&m_chOutpatient);
|
||||||
vlay1->addWidget(&m_labBirthDay);
|
hlay_hostOut->addStretch();
|
||||||
vlay1->addWidget(&m_labLaterality);
|
gridlay->addLayout(hlay_hostOut,row,++col) ;
|
||||||
vlay1->addWidget(&m_labDiagnosticRecord);
|
|
||||||
|
|
||||||
QVBoxLayout * vlay2 = new QVBoxLayout;
|
row ++;
|
||||||
vlay2->addWidget(&m_editCheckNum);
|
col = 0;
|
||||||
vlay2->addWidget(&m_editName);
|
gridlay->addWidget(&m_labStar2,row,col,Qt::AlignRight);
|
||||||
vlay2->addWidget(&m_dateBirthDay);
|
gridlay->addWidget(&m_labName,row,++col);
|
||||||
QHBoxLayout * hlay3 = new QHBoxLayout;
|
gridlay->addWidget(&m_editName,row,++col);
|
||||||
hlay3->addWidget(&m_chLeft);
|
|
||||||
hlay3->addWidget(&m_chRfight);
|
|
||||||
vlay2->addLayout(hlay3);
|
gridlay->addWidget(&m_labSex,row,++col,Qt::AlignRight);
|
||||||
|
QHBoxLayout * hlay_ManWan = new QHBoxLayout;
|
||||||
|
hlay_ManWan->addWidget(&m_chMan);
|
||||||
|
hlay_ManWan->addWidget(&m_chWan);
|
||||||
|
hlay_ManWan->addStretch();
|
||||||
|
gridlay->addLayout(hlay_ManWan,row,++col);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
row ++;
|
||||||
|
col = 1;
|
||||||
|
gridlay->addWidget(&m_labBirthDay,row,col );
|
||||||
|
gridlay->addWidget(&m_dateBirthDay,row,++col);
|
||||||
|
|
||||||
|
gridlay->addWidget(&m_labAge,row,++col,Qt::AlignRight);
|
||||||
|
gridlay->addWidget(&m_editAge,row,++col);
|
||||||
|
|
||||||
|
row ++;
|
||||||
|
col = 1;
|
||||||
|
gridlay->addWidget(&m_labLaterality,row,col);
|
||||||
|
QHBoxLayout * Hlay_leftRight = new QHBoxLayout;
|
||||||
|
Hlay_leftRight->addWidget(&m_chLeft);
|
||||||
|
Hlay_leftRight->addWidget(&m_chRfight);
|
||||||
|
Hlay_leftRight->addStretch();
|
||||||
|
gridlay->addLayout(Hlay_leftRight,row,++col);
|
||||||
|
|
||||||
|
|
||||||
|
gridlay->addWidget(&m_labDate_Of_inspection,row,++col,Qt::AlignRight);
|
||||||
|
gridlay->addWidget(&m_dateInspection,row,++col);
|
||||||
|
|
||||||
|
row ++;
|
||||||
|
col = 1;
|
||||||
|
gridlay->addWidget(&m_labDiagnosticRecord,row,col);
|
||||||
|
gridlay->addWidget(&m_textDiagnosticRecord,row,++col,3,3);
|
||||||
|
|
||||||
|
|
||||||
|
QHBoxLayout * hlay_title = new QHBoxLayout;
|
||||||
|
hlay_title->addWidget(&m_labTitle);
|
||||||
|
|
||||||
|
QHBoxLayout * hlay_grid = new QHBoxLayout;
|
||||||
|
//hlay_grid->addSpacing(30);
|
||||||
|
hlay_grid->addLayout(gridlay);
|
||||||
|
int iwidth = 30;
|
||||||
|
gridlay->setContentsMargins(50,30,30,50);
|
||||||
|
//hlay_grid->addSpacing(30);
|
||||||
|
|
||||||
|
QVBoxLayout * vlay = new QVBoxLayout;
|
||||||
|
|
||||||
|
|
||||||
|
vlay->addLayout(hlay_title,1);
|
||||||
|
vlay->addLayout(hlay_grid,15);
|
||||||
|
|
||||||
|
QHBoxLayout * hlay_okCancel = new QHBoxLayout;
|
||||||
|
hlay_okCancel->addStretch();
|
||||||
|
hlay_okCancel->addWidget(&m_btnOk);
|
||||||
|
hlay_okCancel->addWidget(&m_btnCancel);
|
||||||
|
hlay_okCancel->addStretch();
|
||||||
|
|
||||||
|
QWidget * w = new QWidget;
|
||||||
|
w->setLayout(vlay);
|
||||||
|
|
||||||
|
QVBoxLayout * vlayAll = new QVBoxLayout;
|
||||||
|
vlayAll->addWidget(w);
|
||||||
|
vlayAll->addLayout(hlay_okCancel);
|
||||||
|
setLayout(vlayAll);
|
||||||
|
|
||||||
|
m_btnOk.setStyleSheet("QPushButton{width: 180px;height: 64px;\
|
||||||
|
background: white;\
|
||||||
|
border-radius:12px;padding:7px 10px;\
|
||||||
|
background: #F5F7F9;\
|
||||||
|
border-radius: 12px;\
|
||||||
|
width: 400px;\
|
||||||
|
font-family: Source Han Sans;font-size: 28px;font-weight: normal;color: #999999;\
|
||||||
|
height: 60px;padding: 5px 20px;\
|
||||||
|
}\
|
||||||
|
QPushButton:hover{width: 180px;height: 64px;\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:12px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:pressed{width: 180px;height: 64px;\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:12px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:checked{width: 180px;height: 64px;\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:12px;padding:7px 10px;\
|
||||||
|
}");
|
||||||
|
m_btnCancel.setStyleSheet("QPushButton{width: 180px;height: 64px;\
|
||||||
|
background: white;\
|
||||||
|
border-radius:12px;padding:7px 10px;\
|
||||||
|
background: #F5F7F9;\
|
||||||
|
border-radius: 12px;\
|
||||||
|
width: 400px;\
|
||||||
|
font-family: Source Han Sans;font-size: 28px;font-weight: normal;color: #999999;\
|
||||||
|
height: 60px;padding: 5px 20px;\
|
||||||
|
}\
|
||||||
|
QPushButton:hover{width: 180px;height: 64px;\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:12px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:pressed{width: 180px;height: 64px;\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:12px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:checked{width: 180px;height: 64px;\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:12px;padding:7px 10px;\
|
||||||
|
}");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
bool MedicalRecordWidget::initConnect()
|
bool MedicalRecordWidget::initConnect()
|
||||||
|
{
|
||||||
|
bool reok;
|
||||||
|
reok = connect(&m_btnOk,SIGNAL(clicked()),this,SLOT(slotSave()));
|
||||||
|
if(!reok)
|
||||||
|
{
|
||||||
|
qDebug()<<"save connect failed"<<endl;
|
||||||
|
}
|
||||||
|
reok = connect(&m_btnCancel,SIGNAL(clicked()),this,SLOT(slotCancel()));
|
||||||
|
if(!reok)
|
||||||
|
{
|
||||||
|
qDebug()<<"save connect failed"<<endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void MedicalRecordWidget::slotSave()
|
||||||
|
{
|
||||||
|
|
||||||
|
QString CheckNum = m_editCheckNum.text();
|
||||||
|
//住院 hospitalized
|
||||||
|
QString Type ;
|
||||||
|
if(m_chHospitalized.isChecked())
|
||||||
|
{
|
||||||
|
Type = m_chHospitalized.text();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Type = m_chOutpatient.text();
|
||||||
|
}
|
||||||
|
qDebug()<<Type<<endl;
|
||||||
|
//姓名
|
||||||
|
QString Name = m_editName.text();
|
||||||
|
//性别
|
||||||
|
QString Sex;
|
||||||
|
if(m_chMan.isChecked())
|
||||||
|
{
|
||||||
|
Sex = m_chMan.text();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Sex = m_chWan.text();
|
||||||
|
}
|
||||||
|
//年龄
|
||||||
|
|
||||||
|
QString Year = m_editAge.text();
|
||||||
|
//左右利
|
||||||
|
QString Laterality;
|
||||||
|
if(m_chLeft.isChecked())
|
||||||
|
{
|
||||||
|
Laterality = m_chLeft.text();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Laterality = m_chRfight.text();
|
||||||
|
}
|
||||||
|
|
||||||
|
//出生日期
|
||||||
|
QString Birthday = m_dateBirthDay.dateTime().toString("yyyy/MM/dd hh:mm:ss");
|
||||||
|
|
||||||
|
//检查日期
|
||||||
|
|
||||||
|
QString inspectDate = m_dateInspection.dateTime().toString("yyyy/MM/dd hh:mm:ss");;
|
||||||
|
|
||||||
|
//诊断病历
|
||||||
|
|
||||||
|
QString Other = m_textDiagnosticRecord.toPlainText();
|
||||||
|
DataManager::instance().updateMedicRecord(
|
||||||
|
CheckNum ,
|
||||||
|
Type ,
|
||||||
|
Name ,
|
||||||
|
Sex,
|
||||||
|
Birthday,
|
||||||
|
Year,
|
||||||
|
Laterality,
|
||||||
|
inspectDate,
|
||||||
|
Other);
|
||||||
|
|
||||||
|
initclear();
|
||||||
|
}
|
||||||
|
void MedicalRecordWidget::slotCancel()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
void MedicalRecordWidget::initclear()
|
||||||
|
{
|
||||||
|
//检查号
|
||||||
|
m_editCheckNum.clear();
|
||||||
|
|
||||||
|
//住院 hospitalized
|
||||||
|
m_chHospitalized.setChecked(true);
|
||||||
|
|
||||||
|
//姓名
|
||||||
|
m_editName.clear();
|
||||||
|
//性别
|
||||||
|
m_chMan.setChecked(true);
|
||||||
|
|
||||||
|
//年龄
|
||||||
|
m_editAge.clear();
|
||||||
|
|
||||||
|
//左右利
|
||||||
|
m_chLeft.setChecked(true);
|
||||||
|
//出生日期
|
||||||
|
m_dateBirthDay.clear();
|
||||||
|
|
||||||
|
//检查日期
|
||||||
|
m_dateInspection.clear();
|
||||||
|
|
||||||
|
//诊断病历
|
||||||
|
m_textDiagnosticRecord.clear();
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
#include <QDateEdit>
|
#include <QDateEdit>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
|
#include <QRadioButton>
|
||||||
|
#include <QDateTimeEdit>
|
||||||
class MedicalRecordWidget:public QWidget
|
class MedicalRecordWidget:public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -24,10 +26,13 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
void initLay();
|
void initLay();
|
||||||
bool initConnect();
|
bool initConnect();
|
||||||
|
void initclear();
|
||||||
|
private slots:
|
||||||
|
void slotSave();
|
||||||
|
void slotCancel();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
QGroupBox m_gbx;
|
QLabel m_labTitle;
|
||||||
|
|
||||||
|
|
||||||
QLabel m_labStar;
|
QLabel m_labStar;
|
||||||
QLabel m_labStar2;
|
QLabel m_labStar2;
|
||||||
@@ -37,24 +42,25 @@ private:
|
|||||||
|
|
||||||
//住院 hospitalized
|
//住院 hospitalized
|
||||||
QLabel m_labType;
|
QLabel m_labType;
|
||||||
QCheckBox m_chHospitalized;
|
QRadioButton m_chHospitalized;
|
||||||
QCheckBox m_chOutpatient;
|
QRadioButton m_chOutpatient;
|
||||||
|
|
||||||
//姓名
|
//姓名
|
||||||
QLabel m_labName;
|
QLabel m_labName;
|
||||||
QLineEdit m_editName;
|
QLineEdit m_editName;
|
||||||
//性别
|
//性别
|
||||||
QLabel m_labSex;
|
QLabel m_labSex;
|
||||||
QCheckBox m_chMan;
|
QRadioButton m_chMan;
|
||||||
QCheckBox m_chWan;
|
QRadioButton m_chWan;
|
||||||
|
|
||||||
//年龄
|
//年龄
|
||||||
QLabel m_labAge;
|
QLabel m_labAge;
|
||||||
QLineEdit m_editAge;
|
QLineEdit m_editAge;
|
||||||
|
|
||||||
//左右利
|
//左右利
|
||||||
QLabel m_labLaterality;
|
QLabel m_labLaterality;
|
||||||
QCheckBox m_chLeft;
|
QRadioButton m_chLeft;
|
||||||
QCheckBox m_chRfight;
|
QRadioButton m_chRfight;
|
||||||
//出生日期
|
//出生日期
|
||||||
QLabel m_labBirthDay;
|
QLabel m_labBirthDay;
|
||||||
QDateEdit m_dateBirthDay;
|
QDateEdit m_dateBirthDay;
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ bool NavListWidget::initConnect()
|
|||||||
{
|
{
|
||||||
|
|
||||||
QVBoxLayout * vlay = new QVBoxLayout;
|
QVBoxLayout * vlay = new QVBoxLayout;
|
||||||
QGridLayout * gridlay = new QGridLayout;
|
// QGridLayout * gridlay = new QGridLayout;
|
||||||
|
QVBoxLayout * gridlay = new QVBoxLayout;
|
||||||
vlay->addLayout(gridlay);
|
vlay->addLayout(gridlay);
|
||||||
vlay->addStretch();
|
vlay->addStretch();
|
||||||
setLayout(vlay);
|
setLayout(vlay);
|
||||||
@@ -67,19 +68,22 @@ bool NavListWidget::initConnect()
|
|||||||
btn->setObjectName(strlistObjectName.at(i));
|
btn->setObjectName(strlistObjectName.at(i));
|
||||||
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
pButtonGroup->addButton(btn);
|
pButtonGroup->addButton(btn);
|
||||||
|
btn->setFixedSize(QSize(180,64));
|
||||||
//btn->setFixedSize(m_size);
|
//btn->setFixedSize(m_size);
|
||||||
// btn->setMinimumSize(QSize(200,80));
|
// btn->setMinimumSize(QSize(200,80));
|
||||||
//btn->setMaximumSize(QSize(200,180));
|
//btn->setMaximumSize(QSize(80,20));
|
||||||
|
//btn->setMaximumHeight(50);
|
||||||
btn->setCheckable(true);
|
btn->setCheckable(true);
|
||||||
gridlay->addWidget( btn);
|
gridlay->addWidget( btn);
|
||||||
gridlay->setSpacing(10);
|
gridlay->setSpacing(10);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
gridlay->addStretch();
|
||||||
//#263749
|
//#263749
|
||||||
#if 0
|
#if 0
|
||||||
setObjectName("NavList");
|
setObjectName("NavList");
|
||||||
setStyleSheet("QPushButton{\
|
setStyleSheet("QPushButton{\
|
||||||
background: rgba(51, 71, 75);\
|
background: rgb(51, 71, 75);\
|
||||||
color: white;\
|
color: white;\
|
||||||
border-radius: 30px;\
|
border-radius: 30px;\
|
||||||
font-size: 16px;\
|
font-size: 16px;\
|
||||||
|
|||||||
64
xyylMCWEACSystem/operatorjson.cpp
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
#include "operatorjson.h"
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QByteArray>
|
||||||
|
OperatorJson::OperatorJson(QObject * parent ):QObject (parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
OperatorJson::~OperatorJson()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OperatorJson::savaJson(QJsonObject obj, QString sPathFile)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
|
||||||
|
QJsonDocument doc(obj);
|
||||||
|
QByteArray data = doc.toJson();
|
||||||
|
QFile file(sPathFile);//json文件
|
||||||
|
bool ok = file.open(QIODevice::WriteOnly);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
file.write(data);
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OperatorJson::readJson(QString sPathFile, QJsonObject & json)
|
||||||
|
{
|
||||||
|
//读入所有内容
|
||||||
|
QFile file(sPathFile);
|
||||||
|
|
||||||
|
file.open(QIODevice::ReadOnly);
|
||||||
|
QByteArray data = file.readAll();
|
||||||
|
file.close();
|
||||||
|
//解析
|
||||||
|
QJsonParseError jsonError;
|
||||||
|
QJsonArray jsonAarray;
|
||||||
|
|
||||||
|
QByteArray array(data.toStdString().c_str());
|
||||||
|
QJsonDocument document = QJsonDocument::fromJson(array, &jsonError);
|
||||||
|
|
||||||
|
if (jsonError.error == QJsonParseError::NoError)
|
||||||
|
{
|
||||||
|
//logInfo() << array << endl;
|
||||||
|
//jsonAarray = document.array();
|
||||||
|
json = document.object();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
15
xyylMCWEACSystem/operatorjson.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef OPERATORJSON_H
|
||||||
|
#define OPERATORJSON_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QJsonObject>
|
||||||
|
class OperatorJson:public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
OperatorJson(QObject * parent = NULL );
|
||||||
|
~OperatorJson();
|
||||||
|
bool savaJson(QJsonObject obj, QString sPathFile);
|
||||||
|
bool readJson(QString sPathFile, QJsonObject & json);
|
||||||
|
};
|
||||||
|
#endif // OPERATORJSON_H
|
||||||
@@ -1,68 +1,266 @@
|
|||||||
#include "parametersettingswidget.h"
|
#include "parametersettingswidget.h"
|
||||||
|
#include <QButtonGroup>
|
||||||
ParameterSettingsWidget::ParameterSettingsWidget(QWidget *parent )
|
ParameterSettingsWidget::ParameterSettingsWidget(QWidget *parent )
|
||||||
{
|
{
|
||||||
setStyleSheet("background:white;");
|
|
||||||
m_PerHighFreqWidget.m_labImage.setStyleSheet("border-image:url(:/image/icon_HighFreq.png);}");
|
|
||||||
m_PerHighFreqWidget.m_labImage.setFixedSize(QSize(30,30));
|
|
||||||
m_PerHighFreqWidget.m_labTxt.setText("高频滤波");
|
|
||||||
m_PerHighFreqWidget.setTextList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
|
|
||||||
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
|
|
||||||
|
|
||||||
m_PerLowerFreqWidget.setTextList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
|
QStringList perHeighFreqstrlist;
|
||||||
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
|
perHeighFreqstrlist<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz";
|
||||||
|
QGridLayout * grid = new QGridLayout;
|
||||||
|
QSize tempSize(30,30);
|
||||||
|
QSize tempBtn(180,64);
|
||||||
|
m_labSettingTxt.setFixedSize(tempBtn);
|
||||||
|
grid->addWidget(&m_labSettingTxt,0,0,Qt::AlignHCenter);
|
||||||
|
int row =1;
|
||||||
|
int col =0;
|
||||||
|
QHBoxLayout * hlay_HieghtFre = new QHBoxLayout;
|
||||||
|
QLabel * m_labImageHeighFre= new QLabel;
|
||||||
|
|
||||||
m_PerTimeConst.setTextList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
|
m_labImageHeighFre->setFixedSize(tempSize);
|
||||||
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
|
m_labImageHeighFre->setStyleSheet("border-image:url(:/image/icon_HighFreq.png);}");
|
||||||
|
QLabel * m_labTxtHeighFre= new QLabel;
|
||||||
|
m_labTxtHeighFre->setText("高频滤波");
|
||||||
|
hlay_HieghtFre->addStretch();
|
||||||
|
hlay_HieghtFre->addWidget(m_labImageHeighFre);
|
||||||
|
hlay_HieghtFre->addWidget(m_labTxtHeighFre);
|
||||||
|
hlay_HieghtFre->addStretch();
|
||||||
|
|
||||||
m_PerPowerFreNotch.setTextList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
|
QWidget * wtemp = new QWidget;
|
||||||
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
|
wtemp->setLayout(hlay_HieghtFre);
|
||||||
m_PerAmplitude.setTextList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
|
wtemp->setFixedSize(tempBtn);
|
||||||
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
|
//grid->addLayout(hlay_HieghtFre,row++,col,Qt::AlignHCenter);
|
||||||
m_PerWavevelocity.setTextList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
|
grid->addWidget(wtemp,row++,col,Qt::AlignHCenter);
|
||||||
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
|
|
||||||
|
QButtonGroup *pButtonGroup = new QButtonGroup;
|
||||||
|
// 设置互斥
|
||||||
|
pButtonGroup->setExclusive(true);
|
||||||
|
// connect(pButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(onButtonClicked(QAbstractButton*)));
|
||||||
|
for (int i = 0 ;i < perHeighFreqstrlist.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton;
|
||||||
|
btn->setText(perHeighFreqstrlist.at(i));
|
||||||
|
pButtonGroup->addButton(btn);
|
||||||
|
grid->addWidget(btn,row++,col);
|
||||||
|
btn->setObjectName(perHeighFreqstrlist.at(i));
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
btn->setFixedSize(tempBtn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//2
|
||||||
|
row =1;
|
||||||
|
col++;
|
||||||
|
QStringList perLowFreqstrlist;
|
||||||
|
perLowFreqstrlist<<"10Hz"<<"30Hz"<<"50Hz"<<"70Hz"<<"100Hz";
|
||||||
|
|
||||||
|
QHBoxLayout * hlay_LowertFre = new QHBoxLayout;
|
||||||
|
QLabel * m_labImagelowerFre= new QLabel;
|
||||||
|
m_labImagelowerFre->setStyleSheet("border-image:url(:/image/icon_LowerFreq.png);}");
|
||||||
|
m_labImagelowerFre->setFixedSize(tempSize);
|
||||||
|
QLabel * m_labTxtlowerFre= new QLabel;
|
||||||
|
m_labTxtlowerFre->setText("低频滤波");
|
||||||
|
hlay_LowertFre->addWidget(m_labImagelowerFre);
|
||||||
|
hlay_LowertFre->addWidget(m_labTxtlowerFre);
|
||||||
|
grid->addLayout(hlay_LowertFre,row++,col,Qt::AlignHCenter);
|
||||||
|
pButtonGroup = new QButtonGroup;
|
||||||
|
pButtonGroup->setExclusive(true);
|
||||||
|
// connect(pButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(onButtonClicked(QAbstractButton*)));
|
||||||
|
for (int i = 0 ;i < perLowFreqstrlist.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton;
|
||||||
|
btn->setText(perHeighFreqstrlist.at(i));
|
||||||
|
pButtonGroup->addButton(btn);
|
||||||
|
grid->addWidget(btn,row++,col);
|
||||||
|
btn->setObjectName(perLowFreqstrlist.at(i));
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
btn->setFixedSize(tempBtn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//3
|
||||||
|
row =1;
|
||||||
|
col++;
|
||||||
|
QStringList perTimeConsttrlist;
|
||||||
|
perTimeConsttrlist<<"0.03Hz"<<"0.1Hz"<<"0.3Hz";
|
||||||
|
|
||||||
|
QHBoxLayout * hlay_TimeConst = new QHBoxLayout;
|
||||||
|
QLabel * m_labImageTimeConst= new QLabel;
|
||||||
|
m_labImageTimeConst->setStyleSheet("border-image:url(:/image/icon_TimeConst.png);}");
|
||||||
|
m_labImageTimeConst->setFixedSize(tempSize);
|
||||||
|
QLabel * m_labTxtTimeConst= new QLabel;
|
||||||
|
m_labTxtTimeConst->setText("时间常数");
|
||||||
|
hlay_TimeConst->addWidget(m_labImageTimeConst);
|
||||||
|
hlay_TimeConst->addWidget(m_labTxtTimeConst);
|
||||||
|
grid->addLayout(hlay_TimeConst,row++,col,Qt::AlignHCenter);
|
||||||
|
pButtonGroup = new QButtonGroup;
|
||||||
|
pButtonGroup->setExclusive(true);
|
||||||
|
// connect(pButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(onButtonClicked(QAbstractButton*)));
|
||||||
|
for (int i = 0 ;i < perTimeConsttrlist.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton;
|
||||||
|
btn->setText(perHeighFreqstrlist.at(i));
|
||||||
|
pButtonGroup->addButton(btn);
|
||||||
|
grid->addWidget(btn,row++,col);
|
||||||
|
btn->setObjectName(perTimeConsttrlist.at(i));
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
btn->setFixedSize(tempBtn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//4
|
||||||
|
row =1;
|
||||||
|
col++;
|
||||||
|
QStringList PowerFreNotchstrlist;
|
||||||
|
PowerFreNotchstrlist<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz";
|
||||||
|
|
||||||
|
QHBoxLayout * hlay_PowerFreNotch = new QHBoxLayout;
|
||||||
|
QLabel * m_labImagePowerFreNotch= new QLabel;
|
||||||
|
m_labImagePowerFreNotch->setStyleSheet("border-image:url(:/image/icon_PowerFreNotch.png);}");
|
||||||
|
m_labImagePowerFreNotch->setFixedSize(tempSize);
|
||||||
|
QLabel * m_labTxtPowerFreNotch= new QLabel;
|
||||||
|
m_labTxtPowerFreNotch->setText("工作馅波");
|
||||||
|
hlay_PowerFreNotch->addWidget(m_labImagePowerFreNotch);
|
||||||
|
hlay_PowerFreNotch->addWidget(m_labTxtPowerFreNotch);
|
||||||
|
grid->addLayout(hlay_PowerFreNotch,row++,col,Qt::AlignHCenter);
|
||||||
|
pButtonGroup = new QButtonGroup;
|
||||||
|
pButtonGroup->setExclusive(true);
|
||||||
|
//connect(pButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(onButtonClicked(QAbstractButton*)));
|
||||||
|
for (int i = 0 ;i < PowerFreNotchstrlist.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton;
|
||||||
|
btn->setText(PowerFreNotchstrlist.at(i));
|
||||||
|
pButtonGroup->addButton(btn);
|
||||||
|
grid->addWidget(btn,row++,col);
|
||||||
|
btn->setObjectName(PowerFreNotchstrlist.at(i));
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
btn->setFixedSize(tempBtn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//5
|
||||||
|
row =1;
|
||||||
|
col++;
|
||||||
|
QStringList Amplitudestrlist;
|
||||||
|
Amplitudestrlist<<"1"<<"2"<<"4"<<"8"<<"16"<<"32"<<"64";
|
||||||
|
|
||||||
#if 0
|
QHBoxLayout * hlay_Amplitude = new QHBoxLayout;
|
||||||
QLabel m_labHighFrequencyFiltering;
|
QLabel * m_labImageAmplitude= new QLabel;
|
||||||
PerWidget m_PerHighFreqWidget;
|
m_labImageAmplitude->setStyleSheet("border-image:url(:/image/icon_Amplitude.png);}");
|
||||||
|
m_labImageAmplitude->setFixedSize(tempSize);
|
||||||
|
QLabel * m_labTxtAmplitude= new QLabel;
|
||||||
|
m_labTxtAmplitude->setText("波幅");
|
||||||
|
hlay_Amplitude->addWidget(m_labImageAmplitude);
|
||||||
|
hlay_Amplitude->addWidget(m_labTxtAmplitude);
|
||||||
|
grid->addLayout(hlay_Amplitude,row++,col,Qt::AlignHCenter);
|
||||||
|
pButtonGroup = new QButtonGroup;
|
||||||
|
pButtonGroup->setExclusive(true);
|
||||||
|
for (int i = 0 ;i < Amplitudestrlist.size();i++)
|
||||||
|
{
|
||||||
|
QPushButton * btn = new QPushButton;
|
||||||
|
btn->setText(Amplitudestrlist.at(i));
|
||||||
|
pButtonGroup->addButton(btn);
|
||||||
|
grid->addWidget(btn,row++,col);
|
||||||
|
btn->setObjectName(Amplitudestrlist.at(i));
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
btn->setFixedSize(tempBtn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
|
||||||
//低频过滤
|
}
|
||||||
QLabel m_labLowerFrequencyFiltering;
|
|
||||||
PerWidget m_PerLowerFreqWidget;
|
|
||||||
|
|
||||||
//时间常数
|
//6
|
||||||
QLabel m_labTimeConst;
|
row =1;
|
||||||
PerWidget m_PerTimeConst;
|
col++;
|
||||||
|
QStringList Wavevelocitystrlist;
|
||||||
|
Wavevelocitystrlist<<"100"<<"500"<<"1000"<<"2500"<<"5000"<<"10000"<<"15000";
|
||||||
|
|
||||||
//工频馅波 Power-frequency notch
|
QHBoxLayout * hlay_Wavevelocity = new QHBoxLayout;
|
||||||
QLabel m_labPowerFreNotch;
|
QLabel * m_labImageWavevelocity= new QLabel;
|
||||||
PerWidget m_PerPowerFreNotch;
|
m_labImageWavevelocity->setStyleSheet("border-image:url(:/image/icon_Amplitude.png);}");
|
||||||
//波幅
|
m_labImageWavevelocity->setFixedSize(tempSize);
|
||||||
QLabel m_labAmplitude;
|
QLabel * m_labTxtWavevelocity= new QLabel;
|
||||||
PerWidget m_PerAmplitude;
|
m_labTxtWavevelocity->setText("波速");
|
||||||
//Wave velocity
|
hlay_Wavevelocity->addWidget(m_labImageWavevelocity);
|
||||||
//波速
|
hlay_Wavevelocity->addWidget(m_labTxtWavevelocity);
|
||||||
QLabel m_labWavevelocity;
|
grid->addLayout(hlay_Wavevelocity,row++,col,Qt::AlignHCenter);
|
||||||
PerWidget m_PerWavevelocity;
|
pButtonGroup = new QButtonGroup;
|
||||||
#endif
|
pButtonGroup->setExclusive(true);
|
||||||
QHBoxLayout * hlay = new QHBoxLayout;
|
//connect(pButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(onButtonClicked(QAbstractButton*)));
|
||||||
QFrame *line = new QFrame();
|
for (int i = 0 ;i < Wavevelocitystrlist.size();i++)
|
||||||
line->setFrameShape(QFrame::VLine);
|
{
|
||||||
//line->setFrameShadow(QFrame::Plain);
|
QPushButton * btn = new QPushButton;
|
||||||
|
btn->setText(Wavevelocitystrlist.at(i));
|
||||||
|
pButtonGroup->addButton(btn);
|
||||||
|
grid->addWidget(btn,row++,col);
|
||||||
|
btn->setObjectName(Wavevelocitystrlist.at(i));
|
||||||
|
btn->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
btn->setFixedSize(tempBtn);
|
||||||
|
btn->setCheckable(true);
|
||||||
|
|
||||||
hlay->setSpacing(0);
|
}
|
||||||
hlay->addWidget(&m_PerHighFreqWidget);
|
|
||||||
hlay->addWidget(&m_PerLowerFreqWidget);
|
|
||||||
hlay->addWidget(&m_PerTimeConst);
|
|
||||||
hlay->addWidget(&m_PerPowerFreNotch);
|
|
||||||
hlay->addWidget(&m_PerAmplitude);
|
|
||||||
hlay->addWidget(&m_PerWavevelocity);
|
|
||||||
|
|
||||||
|
|
||||||
setContentsMargins(0,0,0,0);
|
m_labSettingTxt.setText("参数设置");
|
||||||
setLayout(hlay);
|
m_labSettingTxt.setStyleSheet("font-family: 思源黑体;font-size: 32px;font-weight: 500; color: #0D9DDB;");
|
||||||
|
|
||||||
|
//QAction
|
||||||
|
m_btnOK.setText("保存");
|
||||||
|
m_btncanCel.setText("取消");
|
||||||
|
|
||||||
|
QHBoxLayout * hlay3 = new QHBoxLayout;
|
||||||
|
hlay3->addStretch();
|
||||||
|
hlay3->addWidget(&m_btncanCel);
|
||||||
|
hlay3->addWidget(&m_btnOK);
|
||||||
|
hlay3->addStretch();
|
||||||
|
QWidget * w = new QWidget;
|
||||||
|
w->setObjectName("parasetting");
|
||||||
|
w->setStyleSheet("QWidget#parasetting{background-color:white;border-radius: 10px;}");
|
||||||
|
w->setLayout(grid);
|
||||||
|
QVBoxLayout * vlay = new QVBoxLayout;
|
||||||
|
vlay->addWidget(w);
|
||||||
|
vlay->addLayout(hlay3);
|
||||||
|
|
||||||
|
setLayout(vlay);
|
||||||
|
this->setStyleSheet("QLabel{font-family: 思源黑体;font-size: 28px;color: #054578;font-weight: 500;}QPushButton{background-color:white; border-radius:10px; color: #666666;font-family: Source Han Sans; font-size: 30px;font-weight: normal;}\
|
||||||
|
QPushButton:hover{background: #41B962; border-radius:10px;padding:7px 10px;color: #666666; font-family: Source Han Sans; font-size: 30px;font-weight: normal; }\
|
||||||
|
QPushButton:pressed{ background: #41B962; border-radius:10px; padding:7px 10px;color: #666666; font-family: Source Han Sans; font-size: 30px;font-weight: normal; }\
|
||||||
|
QPushButton:checked{background: #41B962;border-radius:10px;padding:7px 10px; color: #666666; font-family: Source Han Sans; font-size: 30px;font-weight: normal;}");
|
||||||
|
|
||||||
|
m_btnOK.setStyleSheet("QPushButton{\
|
||||||
|
background: white;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:hover{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:pressed{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:checked{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}");
|
||||||
|
m_btncanCel.setStyleSheet("QPushButton{\
|
||||||
|
background: white;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:hover{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:pressed{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:checked{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}");
|
||||||
|
|
||||||
}
|
}
|
||||||
ParameterSettingsWidget::~ParameterSettingsWidget()
|
ParameterSettingsWidget::~ParameterSettingsWidget()
|
||||||
@@ -81,91 +279,5 @@ bool ParameterSettingsWidget::initConnect()
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
PerWidget::PerWidget(QWidget * parent):QWidget (parent)
|
|
||||||
{
|
|
||||||
init();
|
|
||||||
initLay();
|
|
||||||
}
|
|
||||||
PerWidget::~PerWidget()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
void PerWidget::init()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
void PerWidget::initLay()
|
|
||||||
{
|
|
||||||
|
|
||||||
m_NavListWidget.setList(QStringList()<<"0.05Hz"<<"0.1Hz"<<"1Hz"<<"2Hz"<<"5Hz",
|
|
||||||
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
|
|
||||||
|
|
||||||
m_NavListWidget.setObjectName("NavList1");
|
|
||||||
/*
|
|
||||||
font-size: 16px;\
|
|
||||||
font-weight: bold;\
|
|
||||||
*/
|
|
||||||
|
|
||||||
m_NavListWidget.setCustomSize(QSize(40,30));
|
|
||||||
|
|
||||||
m_NavListWidget.setStyleSheet("QPushButton{\
|
|
||||||
background: rgba(255, 255, 255);\
|
|
||||||
color: black;\
|
|
||||||
border-radius: 8px;\
|
|
||||||
border:0px ; \
|
|
||||||
}\
|
|
||||||
QPushButton:hover{\
|
|
||||||
color: black;\
|
|
||||||
background: rgb(255, 255, 255);\
|
|
||||||
border-radius: 8px;\
|
|
||||||
}\
|
|
||||||
QPushButton:pressed{\
|
|
||||||
color: black;\
|
|
||||||
background: rgb(255, 255, 255);\
|
|
||||||
border-radius: 8px;\
|
|
||||||
}\
|
|
||||||
QPushButton:checked{\
|
|
||||||
color: white;\
|
|
||||||
background: rgb(51, 144, 76);\
|
|
||||||
border-radius: 8px;\
|
|
||||||
}"\
|
|
||||||
"QWidget#NavList1{background-color:rgb(255, 255, 255);}"\
|
|
||||||
);
|
|
||||||
// m_NavListWidget.show();
|
|
||||||
|
|
||||||
//setAttribute(Qt::WA_TranslucentBackground); // 背景透明
|
|
||||||
QHBoxLayout * hlay = new QHBoxLayout;
|
|
||||||
QFrame *line = new QFrame();
|
|
||||||
line->setFrameShape(QFrame::VLine);
|
|
||||||
//line->setFrameShadow(QFrame::Plain);
|
|
||||||
|
|
||||||
hlay->setSpacing(0);
|
|
||||||
hlay->addWidget(&m_NavListWidget);
|
|
||||||
hlay->addWidget(line);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QHBoxLayout * hlay2 = new QHBoxLayout;
|
|
||||||
hlay2->addStretch();
|
|
||||||
hlay2->addWidget(&m_labImage, 1,Qt::AlignRight);
|
|
||||||
hlay2->addWidget(&m_labTxt, 1,Qt::AlignLeft);
|
|
||||||
hlay2->addStretch();
|
|
||||||
hlay2->setSpacing(0);
|
|
||||||
|
|
||||||
|
|
||||||
QVBoxLayout * vlay = new QVBoxLayout;
|
|
||||||
vlay->addLayout(hlay2);
|
|
||||||
vlay->addLayout(hlay);
|
|
||||||
setContentsMargins(0,0,0,0);
|
|
||||||
setLayout( vlay);
|
|
||||||
}
|
|
||||||
void PerWidget::initConnect()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
void PerWidget::setTextList(QStringList str,QStringList objNames)
|
|
||||||
{
|
|
||||||
m_NavListWidget.setList(str, objNames);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,22 +5,6 @@
|
|||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include "navlistwidget.h"
|
#include "navlistwidget.h"
|
||||||
class PerWidget:public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
PerWidget(QWidget * parent =NULL);
|
|
||||||
~PerWidget();
|
|
||||||
void init();
|
|
||||||
void initLay();
|
|
||||||
void initConnect();
|
|
||||||
void setTextList(QStringList str,QStringList objNames);
|
|
||||||
QLabel m_labImage;
|
|
||||||
QLabel m_labTxt;
|
|
||||||
private:
|
|
||||||
QLabel m_labHighFrequencyFiltering;
|
|
||||||
NavListWidget m_NavListWidget;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ParameterSettingsWidget:public QWidget
|
class ParameterSettingsWidget:public QWidget
|
||||||
{
|
{
|
||||||
@@ -33,27 +17,33 @@ public:
|
|||||||
bool initConnect();
|
bool initConnect();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
//参数设置
|
||||||
|
QLabel m_labSettingTxt;
|
||||||
|
|
||||||
QLabel m_labHighFrequencyFiltering;
|
QLabel m_labHighFrequencyFiltering;
|
||||||
PerWidget m_PerHighFreqWidget;
|
|
||||||
|
|
||||||
//低频过滤
|
//低频过滤
|
||||||
QLabel m_labLowerFrequencyFiltering;
|
QLabel m_labLowerFrequencyFiltering;
|
||||||
PerWidget m_PerLowerFreqWidget;
|
|
||||||
|
|
||||||
//时间常数
|
//时间常数
|
||||||
QLabel m_labTimeConst;
|
QLabel m_labTimeConst;
|
||||||
PerWidget m_PerTimeConst;
|
|
||||||
|
|
||||||
//工频馅波 Power-frequency notch
|
//工频馅波 Power-frequency notch
|
||||||
QLabel m_labPowerFreNotch;
|
QLabel m_labPowerFreNotch;
|
||||||
PerWidget m_PerPowerFreNotch;
|
|
||||||
//波幅
|
//波幅
|
||||||
QLabel m_labAmplitude;
|
QLabel m_labAmplitude;
|
||||||
PerWidget m_PerAmplitude;
|
|
||||||
//Wave velocity
|
//Wave velocity
|
||||||
//波速
|
//波速
|
||||||
QLabel m_labWavevelocity;
|
QLabel m_labWavevelocity;
|
||||||
PerWidget m_PerWavevelocity;
|
|
||||||
|
|
||||||
|
QPushButton m_btncanCel;
|
||||||
|
QPushButton m_btnOK;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
86
xyylMCWEACSystem/qssstyle.qss
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
QLineEdit
|
||||||
|
{
|
||||||
|
border: 1px solid #ABCDA0;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding-left: 5px;
|
||||||
|
background-color: #F2F2F2;
|
||||||
|
color: #A0A0A0;
|
||||||
|
selection-background-color: #A0A0A0;
|
||||||
|
selection-color: #F2F2F2;
|
||||||
|
font-family: "Microsoft YaHei";
|
||||||
|
font-size: 10pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit:hover
|
||||||
|
{
|
||||||
|
border: 1px solid #298DFF;
|
||||||
|
border-radius: 3px;
|
||||||
|
background-color: #F2F2F2;
|
||||||
|
color: #298DFF;
|
||||||
|
selection-background-color: #298DFF;
|
||||||
|
selection-color: #F2F2F2;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit[echoMode="2"]
|
||||||
|
{
|
||||||
|
lineedit-password-character: 9679;
|
||||||
|
lineedit-password-mask-delay: 2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit:disabled
|
||||||
|
{
|
||||||
|
border: 1px solid #CDCDCD;
|
||||||
|
background-color: #CDCDCD;
|
||||||
|
color: #B4B4B4;
|
||||||
|
}
|
||||||
|
|
||||||
|
QLineEdit:read-only
|
||||||
|
{
|
||||||
|
background-color: #CDCDCD;
|
||||||
|
color: #F2F2F2;
|
||||||
|
}
|
||||||
|
QTextEdit
|
||||||
|
{
|
||||||
|
color: black;
|
||||||
|
background-color: white;
|
||||||
|
border:1px solid black;
|
||||||
|
}
|
||||||
|
QPushButton
|
||||||
|
{border:1px solid black;}
|
||||||
|
QGroupBox
|
||||||
|
{
|
||||||
|
background-color: #4F4F4F;
|
||||||
|
border: 1px solid #969696;
|
||||||
|
color: rgb(13,157,219);
|
||||||
|
border-radius: 5px;
|
||||||
|
margin-top: 2ex;
|
||||||
|
}
|
||||||
|
QDateEdit
|
||||||
|
{
|
||||||
|
border: 1px solid rgb(22,63,23);
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
QPushButton
|
||||||
|
{
|
||||||
|
background: white;
|
||||||
|
border-radius:10px;
|
||||||
|
padding:7px 10px;
|
||||||
|
}
|
||||||
|
QPushButton:hover
|
||||||
|
{
|
||||||
|
background: #0d9ddb;
|
||||||
|
border-radius:10px;
|
||||||
|
padding:7px 10px;
|
||||||
|
}
|
||||||
|
QPushButton:pressed
|
||||||
|
{
|
||||||
|
background: #0d9aab;
|
||||||
|
border-radius:10px;
|
||||||
|
padding:7px 10px;
|
||||||
|
}
|
||||||
|
QPushButton:checked
|
||||||
|
{
|
||||||
|
background: #0d9ddb;
|
||||||
|
border-radius:10px;
|
||||||
|
padding:7px 10px;
|
||||||
|
};
|
||||||
@@ -22,49 +22,52 @@ SystemSettingWidget::~SystemSettingWidget()
|
|||||||
void SystemSettingWidget::init()
|
void SystemSettingWidget::init()
|
||||||
{
|
{
|
||||||
|
|
||||||
//this->setStyleSheet("QWidget{background: rgb(47, 61, 82);border:0px}");
|
|
||||||
this->setStyleSheet("QWidget{background: rgb(47, 61, 82);}");
|
this->setStyleSheet("QWidget{background: rgb(47, 61, 82);}");
|
||||||
m_labDes.setStyleSheet("border-image:url(:/image/systemsetting.png);}");
|
m_labDes.setText("系统设置");
|
||||||
m_btnRet.setStyleSheet("border-image:url(:/image/icon_back_2.png);}");
|
m_btnRet.setText("< 返回");
|
||||||
m_labDes.setMaximumSize(QSize(200,30));
|
m_labDes.setStyleSheet("QLabel{width: 330px;height: 58px;font-family:思源黑体;color:#555555;font-size: 40px;font-weight: 500;}");
|
||||||
m_labDes.setMinimumSize(QSize(200,30));
|
m_btnRet.setStyleSheet("QPushButton{width: 160px;height: 31px;font-size: 40px; border:0px ; font-weight: normal;color: #666666;font-family: Source Han Sans;}");
|
||||||
m_btnRet.setMaximumSize(QSize(100,30));
|
|
||||||
m_btnRet.setMinimumSize(QSize(100,30));
|
|
||||||
|
|
||||||
m_NavListWidget.setList(QStringList()<<"填写病例"<<"病例管理"<<"导联方案"<<"参数设置"<<"医院信息",
|
m_NavListWidget.setList(QStringList()<<"填写病例"<<"病例管理"<<"导联方案"<<"参数设置"<<"医院信息",
|
||||||
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter setting" << "hospital-information");
|
QStringList()<<"fill-in-the-Case" << "case-management" << "leading-scheme" << "Parameter-setting" << "hospital-information");
|
||||||
|
|
||||||
m_NavListWidget.setObjectName("NavList");
|
m_NavListWidget.setStyleSheet("QPushButton{\
|
||||||
m_NavListWidget.setStyleSheet("QPushButton{\
|
background: rgb(51, 71, 75);\
|
||||||
background: rgba(51, 71, 75);\
|
color: white;\
|
||||||
color: white;\
|
border-radius: 8px;\
|
||||||
border-radius: 30px;\
|
border:0px ; \
|
||||||
font-size: 16px;\
|
}\
|
||||||
font-weight: bold;\
|
QPushButton:hover{\
|
||||||
}\
|
color: black;\
|
||||||
QPushButton:hover{\
|
background: rgb(85, 85, 85);\
|
||||||
background: rgb(85, 85, 85);\
|
border-radius: 8px;\
|
||||||
border-radius: 30px;\
|
}\
|
||||||
}\
|
QPushButton:pressed{\
|
||||||
QPushButton:pressed{\
|
color: black;\
|
||||||
background: rgb(80, 80, 80);\
|
background: rgb(80, 80, 80);\
|
||||||
border-radius: 30px;\
|
border-radius: 8px;\
|
||||||
}\
|
}\
|
||||||
QPushButton:checked{\
|
QPushButton:checked{\
|
||||||
background: #0d9ddb;\
|
color: white;\
|
||||||
border-radius: 30px;\
|
background: #0d9ddb;\
|
||||||
}"\
|
border-radius: 8px;\
|
||||||
"QWidget#NavList{background-color:rgb(47, 61, 82);}"\
|
}"\
|
||||||
);
|
"QWidget#NavList1{background-color:rgb(47, 61, 82);}"\
|
||||||
|
);
|
||||||
}
|
}
|
||||||
void SystemSettingWidget::initLay()
|
void SystemSettingWidget::initLay()
|
||||||
{
|
{
|
||||||
QHBoxLayout * hlay = new QHBoxLayout;
|
QHBoxLayout * hlay = new QHBoxLayout;
|
||||||
|
hlay->addSpacing(35);
|
||||||
|
//hlay->setContentsMargins(125,34,34,34);
|
||||||
hlay->addWidget(&m_btnRet,1,Qt::AlignLeft);
|
hlay->addWidget(&m_btnRet,1,Qt::AlignLeft);
|
||||||
|
//hlay->addSpacing(589);
|
||||||
hlay->addWidget(&m_labDes,9, Qt::AlignHCenter);
|
hlay->addWidget(&m_labDes,9, Qt::AlignHCenter);
|
||||||
QWidget * w1 = new QWidget;
|
QWidget * w1 = new QWidget;
|
||||||
w1->setFixedHeight(60);
|
//0
|
||||||
w1->setStyleSheet("QWidget{background-color:#ffffff;}");
|
w1->setFixedHeight(80);
|
||||||
|
w1->setStyleSheet("QWidget{background-color:#ffffff;width: 1920px;height: 100px;}");
|
||||||
w1->setLayout(hlay);
|
w1->setLayout(hlay);
|
||||||
QVBoxLayout * vlay = new QVBoxLayout;
|
QVBoxLayout * vlay = new QVBoxLayout;
|
||||||
vlay->addWidget(w1,1);
|
vlay->addWidget(w1,1);
|
||||||
@@ -130,6 +133,27 @@ void SystemSettingWidget::slotClickedChanged()
|
|||||||
m_stackedWidget.addWidget(&m_MedicalRecordManagerWidget);
|
m_stackedWidget.addWidget(&m_MedicalRecordManagerWidget);
|
||||||
m_stackedWidget.setCurrentWidget(&m_MedicalRecordManagerWidget);
|
m_stackedWidget.setCurrentWidget(&m_MedicalRecordManagerWidget);
|
||||||
|
|
||||||
|
}//Parameter setting
|
||||||
|
else if(strName.compare("Parameter-setting")==0)
|
||||||
|
{
|
||||||
|
|
||||||
|
m_stackedWidget.addWidget(&m_ParameterSettingsWidget);
|
||||||
|
m_stackedWidget.setCurrentWidget(&m_ParameterSettingsWidget);
|
||||||
|
|
||||||
|
}//hospital-information
|
||||||
|
else if(strName.compare("hospital-information")==0)
|
||||||
|
{
|
||||||
|
m_hospitalinformationWidget.slotUpdateShow();
|
||||||
|
m_stackedWidget.addWidget(&m_hospitalinformationWidget);
|
||||||
|
m_stackedWidget.setCurrentWidget(&m_hospitalinformationWidget);
|
||||||
|
|
||||||
|
}//m_LeadSchemeWidget
|
||||||
|
else if(strName.compare("leading-scheme")==0)
|
||||||
|
{
|
||||||
|
|
||||||
|
m_stackedWidget.addWidget(&m_LeadSchemeWidget);
|
||||||
|
m_stackedWidget.setCurrentWidget(&m_LeadSchemeWidget);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
#include "medicalrecordwidget.h"
|
#include "medicalrecordwidget.h"
|
||||||
#include "medicalrecordmanager.h"
|
#include "medicalrecordmanager.h"
|
||||||
|
#include "parametersettingswidget.h"
|
||||||
|
#include "hospitalinfo.h"
|
||||||
|
#include "leadscheme.h"
|
||||||
class SystemSettingWidget: public QWidget
|
class SystemSettingWidget: public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -46,5 +49,8 @@ private:
|
|||||||
|
|
||||||
MedicalRecordWidget m_MedicalRecordWidget;
|
MedicalRecordWidget m_MedicalRecordWidget;
|
||||||
MedicalRecordManager m_MedicalRecordManagerWidget;
|
MedicalRecordManager m_MedicalRecordManagerWidget;
|
||||||
|
ParameterSettingsWidget m_ParameterSettingsWidget;
|
||||||
|
HospitalInfo m_hospitalinformationWidget;
|
||||||
|
LeadScheme m_LeadSchemeWidget;
|
||||||
};
|
};
|
||||||
#endif // SYSTEMSETTINGWIDGET_H
|
#endif // SYSTEMSETTINGWIDGET_H
|
||||||
|
|||||||
@@ -17,38 +17,32 @@ TitleWidget::~TitleWidget()
|
|||||||
|
|
||||||
void TitleWidget::init()
|
void TitleWidget::init()
|
||||||
{
|
{
|
||||||
setStyleSheet("QWidget{background-color:#ffffff;}");
|
setObjectName("title");
|
||||||
m_labDes.setStyleSheet("border-image:url(:/image/sunnyou_logo.png);}");
|
|
||||||
// m_labSystemName.setStyleSheet("border-image:url(:/image/index_bg_EEG_char.png);}");
|
|
||||||
//m_labSystemName.setText(tr("Multi-channel wireless EEG acquisition system"));
|
|
||||||
m_labSystemName.setStyleSheet("border-image:url(:/image/logo_txt.png);}");
|
|
||||||
m_btnRet.setStyleSheet("background-image:url(:/image/icon_exit.png);}");
|
|
||||||
|
|
||||||
|
m_labDes.setText("Sunnyou 翔宇");
|
||||||
|
m_labDes.setObjectName("titleDes");
|
||||||
|
m_btnRet.setObjectName("titleBtn");
|
||||||
|
m_labSystemName.setObjectName("titleSystemName");
|
||||||
|
m_labSystemName.setText("Sunlink 多通道无线脑电采集系统");
|
||||||
|
m_labDes.setFixedSize(QSize(360,59));
|
||||||
|
|
||||||
|
m_btnRet.setFixedSize(QSize(89,90));
|
||||||
|
|
||||||
m_btnRet.setStyleSheet("QPushButton{border-image:url(:/image/icon_exit.png);}"
|
m_labDes.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
"QPushButton:hover{border-image:url(:/image/icon_exit_hover.png);}"
|
m_labSystemName.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
"QPushButton:pressed{border-image:url(:/image/icon_exit_checked.png);}"
|
m_btnRet.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
m_labDes.setMaximumSize(QSize(300,40));
|
|
||||||
m_labSystemName.setFixedSize(QSize(500,40));
|
|
||||||
m_btnRet.setMaximumSize(QSize(60,60));
|
|
||||||
|
|
||||||
m_labDes.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
||||||
m_labSystemName.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
||||||
m_btnRet.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void TitleWidget::initLay()
|
void TitleWidget::initLay()
|
||||||
{
|
{
|
||||||
#if 0
|
#if 1
|
||||||
QHBoxLayout * hlay = new QHBoxLayout;
|
QHBoxLayout * hlay = new QHBoxLayout;
|
||||||
hlay->addWidget(&m_labDes,Qt::AlignLeft);
|
hlay->addSpacing(85);
|
||||||
|
hlay->addWidget(&m_labDes,1,Qt::AlignLeft);
|
||||||
hlay->addWidget(&m_labSystemName,1,Qt::AlignHCenter);
|
hlay->addWidget(&m_labSystemName,1,Qt::AlignHCenter);
|
||||||
//hlay->addStretch();
|
//hlay->addStretch();
|
||||||
hlay->addWidget(&m_btnRet,1,Qt::AlignRight);
|
hlay->addWidget(&m_btnRet,1,Qt::AlignRight);
|
||||||
|
hlay->addSpacing(85);
|
||||||
setLayout(hlay);
|
setLayout(hlay);
|
||||||
#else
|
#else
|
||||||
QGridLayout * hlay = new QGridLayout;
|
QGridLayout * hlay = new QGridLayout;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
|
|
||||||
QT += core gui sql
|
QT += core gui sql
|
||||||
|
Profile = Release with debug info
|
||||||
|
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
@@ -25,21 +26,31 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
|
MoveButton.cpp \
|
||||||
SqlCore.cpp \
|
SqlCore.cpp \
|
||||||
|
SqlExecute.cpp \
|
||||||
|
SqlGenerate.cpp \
|
||||||
btngroupwidget.cpp \
|
btngroupwidget.cpp \
|
||||||
|
cdateedit.cpp \
|
||||||
curchatwidget.cpp \
|
curchatwidget.cpp \
|
||||||
|
datamanager.cpp \
|
||||||
dataprocesswidget.cpp \
|
dataprocesswidget.cpp \
|
||||||
devconwidget.cpp \
|
devconwidget.cpp \
|
||||||
eggwidget.cpp \
|
eggwidget.cpp \
|
||||||
|
framebtn.cpp \
|
||||||
framelesswindow.cpp \
|
framelesswindow.cpp \
|
||||||
framewindow.cpp \
|
framewindow.cpp \
|
||||||
hospitalinfo.cpp \
|
hospitalinfo.cpp \
|
||||||
|
leadscheme.cpp \
|
||||||
|
logger.cpp \
|
||||||
loginwidget.cpp \
|
loginwidget.cpp \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
|
mainbtn.cpp \
|
||||||
mainwindow.cpp \
|
mainwindow.cpp \
|
||||||
medicalrecordmanager.cpp \
|
medicalrecordmanager.cpp \
|
||||||
medicalrecordwidget.cpp \
|
medicalrecordwidget.cpp \
|
||||||
navlistwidget.cpp \
|
navlistwidget.cpp \
|
||||||
|
operatorjson.cpp \
|
||||||
parametersettingswidget.cpp \
|
parametersettingswidget.cpp \
|
||||||
regwidget.cpp \
|
regwidget.cpp \
|
||||||
systemsettingwidget.cpp \
|
systemsettingwidget.cpp \
|
||||||
@@ -47,21 +58,30 @@ SOURCES += \
|
|||||||
widget.cpp
|
widget.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
|
MoveButton.h \
|
||||||
SqlCore.h \
|
SqlCore.h \
|
||||||
|
SqlExecute.h \
|
||||||
|
SqlGenerate.h \
|
||||||
btngroupwidget.h \
|
btngroupwidget.h \
|
||||||
|
cdateedit.h \
|
||||||
curchatwidget.h \
|
curchatwidget.h \
|
||||||
|
datamanager.h \
|
||||||
dataprocesswidget.h \
|
dataprocesswidget.h \
|
||||||
devconwidget.h \
|
devconwidget.h \
|
||||||
eggwidget.h \
|
eggwidget.h \
|
||||||
|
framebtn.h \
|
||||||
framelesswindow.h \
|
framelesswindow.h \
|
||||||
framewindow.h \
|
framewindow.h \
|
||||||
hospitalinfo.h \
|
hospitalinfo.h \
|
||||||
|
leadscheme.h \
|
||||||
|
logger.h \
|
||||||
loginwidget.h \
|
loginwidget.h \
|
||||||
|
mainbtn.h \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
medicalrecordmanager.h \
|
medicalrecordmanager.h \
|
||||||
medicalrecordwidget.h \
|
medicalrecordwidget.h \
|
||||||
mrmanagement.h \
|
|
||||||
navlistwidget.h \
|
navlistwidget.h \
|
||||||
|
operatorjson.h \
|
||||||
parametersettingswidget.h \
|
parametersettingswidget.h \
|
||||||
regwidget.h \
|
regwidget.h \
|
||||||
systemsettingwidget.h \
|
systemsettingwidget.h \
|
||||||
@@ -69,6 +89,7 @@ HEADERS += \
|
|||||||
widget.h
|
widget.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
framebtn.ui \
|
||||||
widget.ui
|
widget.ui
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
@@ -78,3 +99,6 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
|
|||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
egg.qrc
|
egg.qrc
|
||||||
|
|
||||||
|
DISTFILES += \
|
||||||
|
qssstyle.qss
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.9.1, 2024-11-08T18:00:40. -->
|
<!-- Written by QtCreator 4.9.1, 2024-12-09T09:05:51. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.13.0 MinGW 64-bit</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.13.0 MinGW 64-bit</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.13.0 MinGW 64-bit</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.13.0 MinGW 64-bit</value>
|
||||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5130.win64_mingw73_kit</value>
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5130.win64_mingw73_kit</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">2</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||||
|
|||||||