diff --git a/bin/xyylMCWEACSystem.exe b/bin/xyylMCWEACSystem.exe index 86c7125..65a6cac 100644 Binary files a/bin/xyylMCWEACSystem.exe and b/bin/xyylMCWEACSystem.exe differ diff --git a/xyylMCWEACSystem/curchatwidget.cpp b/xyylMCWEACSystem/curchatwidget.cpp index 0b52c66..fc5e790 100644 --- a/xyylMCWEACSystem/curchatwidget.cpp +++ b/xyylMCWEACSystem/curchatwidget.cpp @@ -66,7 +66,7 @@ void CurChatWidget::paintEvent(QPaintEvent *) // 设置画笔的颜色和样式 painter.setPen(Qt::black); - painteXY(painter); + painteXY(painter); diff --git a/xyylMCWEACSystem/framebtn.cpp b/xyylMCWEACSystem/framebtn.cpp new file mode 100644 index 0000000..218e948 --- /dev/null +++ b/xyylMCWEACSystem/framebtn.cpp @@ -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; +} diff --git a/xyylMCWEACSystem/framebtn.h b/xyylMCWEACSystem/framebtn.h new file mode 100644 index 0000000..94f6229 --- /dev/null +++ b/xyylMCWEACSystem/framebtn.h @@ -0,0 +1,22 @@ +#ifndef FRAMEBTN_H +#define FRAMEBTN_H + +#include + +namespace Ui { +class FrameBtn; +} + +class FrameBtn : public QFrame +{ + Q_OBJECT + +public: + explicit FrameBtn(QWidget *parent = nullptr); + ~FrameBtn(); + +private: + Ui::FrameBtn *ui; +}; + +#endif // FRAMEBTN_H diff --git a/xyylMCWEACSystem/framebtn.ui b/xyylMCWEACSystem/framebtn.ui new file mode 100644 index 0000000..156b751 --- /dev/null +++ b/xyylMCWEACSystem/framebtn.ui @@ -0,0 +1,98 @@ + + + FrameBtn + + + + 0 + 0 + 450 + 500 + + + + Frame + + + Qt::ImhNone + + + + + 45 + 52 + 240 + 87 + + + + + 30 + + + + Qt::LeftToRight + + + 脑电采集 + + + false + + + + + + 44 + 138 + 278 + 47 + + + + + 0 + 0 + + + + + Source Code Pro + 40 + + + + TextLabel + + + true + + + + + + 90 + 290 + 72 + 15 + + + + TextLabel + + + + + + 160 + 270 + 160 + 80 + + + + + + + + diff --git a/xyylMCWEACSystem/main.cpp b/xyylMCWEACSystem/main.cpp index b8cbb08..ca622bf 100644 --- a/xyylMCWEACSystem/main.cpp +++ b/xyylMCWEACSystem/main.cpp @@ -15,7 +15,9 @@ #include "framelesswindow.h" #include #include "logger.h" - +#include "hospitalinfo.h" +#include "framebtn.h" +#include "mainbtn.h" void LoadStyleFile(QString strStyle) { QFile qss(strStyle); @@ -27,6 +29,8 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); + +#if 0 // QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); //qInstallMessageHandler(MessageHandler); QTextCodec *codec = QTextCodec::codecForName("GBK"); @@ -36,9 +40,13 @@ int main(int argc, char *argv[]) //window->resize(300, 400); // window->showMaximized(); mainw->showMaximized(); - QFont globalFont; - globalFont.setFamily("黑体"); + QFont globalFont; + globalFont.setFamily("黑体"); QApplication::setFont(globalFont); LoadStyleFile(QApplication::applicationDirPath()+"/defaultstyle.qss"); - return a.exec(); +#endif + MainBtn ll; + ll.setTxt("系统设置","EGG acquisition",""); + ll.show(); + return a.exec(); } diff --git a/xyylMCWEACSystem/mainbtn.cpp b/xyylMCWEACSystem/mainbtn.cpp new file mode 100644 index 0000000..6668f46 --- /dev/null +++ b/xyylMCWEACSystem/mainbtn.cpp @@ -0,0 +1,52 @@ +#include "mainbtn.h" +#include +#include + void MainBtn::setTxt(QString str,QString str2,QString str3) + { + m_labTxt.setText(str); + m_labEgTxt.setText(str2) ; + m_labImage.setText(str3); + setObjectName("MinBtn"); + this->setStyleSheet("QFrame#MinBtn{border-image:url(:/image/index_bg_data.png);border-radius: 40px;} "); + m_labTxt.setStyleSheet("font-size: 60px;font-weight: 500;color:white;"); + m_labEgTxt.setStyleSheet("font-size: 60px;font-weight:normal;color:white;"); + } +MainBtn::MainBtn(QWidget * parent ) +{ + setWindowFlags(Qt::FramelessWindowHint); // 去掉边框 + setAttribute(Qt::WA_TranslucentBackground); // 背景透明 + m_labTxt.setFixedSize(QSize(240,87)); + //m_labEgTxt.setFixedSize(QSize(302,58)); + m_labImage.setFixedSize(QSize(129,117)); + + + 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() +{ + +} + +void MainBtn::mouseReleaseEvent(QMouseEvent * ev) +{ + +} diff --git a/xyylMCWEACSystem/mainbtn.h b/xyylMCWEACSystem/mainbtn.h new file mode 100644 index 0000000..b7ef2af --- /dev/null +++ b/xyylMCWEACSystem/mainbtn.h @@ -0,0 +1,32 @@ +#ifndef MAINBTN_H +#define MAINBTN_H +#include +#include +#include +#include +#include +#include +class MainBtn:public QFrame +{ + Q_OBJECT +public: + MainBtn(QWidget * parent =NULL); + ~MainBtn(); + void setTxt(QString str,QString str2,QString str3); + 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 diff --git a/xyylMCWEACSystem/xyylMCWEACSystem.pro b/xyylMCWEACSystem/xyylMCWEACSystem.pro index 815c07d..2e72a56 100644 --- a/xyylMCWEACSystem/xyylMCWEACSystem.pro +++ b/xyylMCWEACSystem/xyylMCWEACSystem.pro @@ -36,6 +36,7 @@ SOURCES += \ dataprocesswidget.cpp \ devconwidget.cpp \ eggwidget.cpp \ + framebtn.cpp \ framelesswindow.cpp \ framewindow.cpp \ hospitalinfo.cpp \ @@ -43,6 +44,7 @@ SOURCES += \ logger.cpp \ loginwidget.cpp \ main.cpp \ + mainbtn.cpp \ mainwindow.cpp \ medicalrecordmanager.cpp \ medicalrecordwidget.cpp \ @@ -65,12 +67,14 @@ HEADERS += \ dataprocesswidget.h \ devconwidget.h \ eggwidget.h \ + framebtn.h \ framelesswindow.h \ framewindow.h \ hospitalinfo.h \ leadscheme.h \ logger.h \ loginwidget.h \ + mainbtn.h \ mainwindow.h \ medicalrecordmanager.h \ medicalrecordwidget.h \ @@ -83,6 +87,7 @@ HEADERS += \ widget.h FORMS += \ + framebtn.ui \ widget.ui # Default rules for deployment.