├── .gitignore ├── .idea ├── .name ├── CDoc.iml ├── misc.xml ├── modules.xml ├── vcs.xml └── workspace.xml ├── CDoc.pro ├── LICENSE ├── README.MD ├── activitydetail.cpp ├── activitydetail.h ├── activitydetail.ui ├── app ├── app.cpp ├── app.h ├── appinit.cpp ├── appinit.h ├── applive.cpp ├── applive.h ├── applog.cpp ├── applog.h ├── iconhelper.cpp ├── iconhelper.h └── myhelper.h ├── basedialog.cpp ├── basedialog.h ├── basedialog.ui ├── db ├── activitydao.cpp ├── activitydao.h ├── basedao.cpp ├── basedao.h ├── userdao.cpp └── userdao.h ├── editprofile.cpp ├── editprofile.h ├── editprofile.ui ├── frmconfig.cpp ├── frmconfig.h ├── frmconfig.ui ├── login.cpp ├── login.h ├── login.ui ├── main.cpp ├── maindialog.cpp ├── maindialog.h ├── maindialog.ui ├── model ├── activity.cpp ├── activity.h ├── relation.cpp ├── relation.h ├── user.cpp └── user.h ├── myactivity.cpp ├── myactivity.h ├── myactivity.ui ├── newactivity.cpp ├── newactivity.h ├── newactivity.ui ├── other ├── image │ ├── Font Awesome Cheatsheet.png │ ├── add.png │ ├── add_2.png │ ├── add_bottom.png │ ├── add_left.png │ ├── add_right.png │ ├── add_top.png │ ├── bg_main.png │ ├── btn_close.png │ ├── btn_ok.png │ ├── checkbox_checked.png │ ├── checkbox_unchecked.png │ ├── fontawesome-webfont.ttf │ ├── icon.png │ ├── join.png │ ├── join_2.png │ ├── look.png │ ├── look_2.png │ ├── msg_error.png │ ├── msg_info.png │ ├── msg_question.png │ ├── profile.png │ ├── qt_zh_CN.qm │ ├── radio_normal.png │ ├── radio_selected.png │ ├── setting.png │ └── title.png ├── main.ico ├── main.rc ├── qss │ ├── black.css │ ├── blue.css │ ├── brown.css │ ├── darkgray.css │ ├── dev.css │ ├── gray.css │ ├── lightgray.css │ └── silvery.css └── rc.qrc ├── screenshots ├── 0.jpg ├── 1.jpg ├── 2.jpg ├── 3.jpg ├── 4.jpg ├── 5.jpg ├── 6.jpg └── icon.png ├── tool ├── exportexcelobject.cpp ├── exportexcelobject.h ├── l.cpp ├── l.h ├── sql.h └── text.h └── widget ├── frminputbox.cpp ├── frminputbox.h ├── frminputbox.ui ├── frmmessagebox.cpp ├── frmmessagebox.h └── frmmessagebox.ui /.gitignore: -------------------------------------------------------------------------------- 1 | GAS.pro.user 2 | *.pro.user 3 | *.user -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | CDoc -------------------------------------------------------------------------------- /.idea/CDoc.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CDoc.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2015-06-15T14:34:50 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network sql widgets 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport 10 | 11 | TARGET = CDoc 12 | TEMPLATE = app 13 | 14 | FORMS += \ 15 | widget/frmmessagebox.ui \ 16 | widget/frminputbox.ui \ 17 | frmconfig.ui \ 18 | login.ui \ 19 | newactivity.ui \ 20 | editprofile.ui \ 21 | activitydetail.ui \ 22 | myactivity.ui \ 23 | maindialog.ui \ 24 | basedialog.ui 25 | 26 | RESOURCES += \ 27 | other/rc.qrc 28 | 29 | 30 | INCLUDEPATH += $$PWD 31 | INCLUDEPATH += $$PWD/usercontrol 32 | INCLUDEPATH += $$PWD/api 33 | INCLUDEPATH += $$PWD/sql 34 | 35 | DESTDIR = bin 36 | 37 | 38 | DISTFILES += \ 39 | other/image/add.png \ 40 | other/image/bg_main.png \ 41 | other/image/join.png \ 42 | other/image/look.png \ 43 | other/image/title.png \ 44 | other/image/icon.png 45 | 46 | INCLUDEPATH += $$PWD 47 | INCLUDEPATH += $$PWD/widget 48 | INCLUDEPATH += $$PWD/db 49 | INCLUDEPATH += $$PWD/model 50 | INCLUDEPATH += $$PWD/tool 51 | INCLUDEPATH += $$PWD/app 52 | 53 | HEADERS += \ 54 | app/app.h \ 55 | app/appinit.h \ 56 | app/applive.h \ 57 | app/applog.h \ 58 | app/iconhelper.h \ 59 | app/myhelper.h \ 60 | db/activitydao.h \ 61 | db/basedao.h \ 62 | db/userdao.h \ 63 | model/activity.h \ 64 | model/relation.h \ 65 | model/user.h \ 66 | tool/exportexcelobject.h \ 67 | tool/l.h \ 68 | tool/sql.h \ 69 | tool/text.h \ 70 | widget/frminputbox.h \ 71 | widget/frmmessagebox.h \ 72 | activitydetail.h \ 73 | editprofile.h \ 74 | frmconfig.h \ 75 | login.h \ 76 | maindialog.h \ 77 | myactivity.h \ 78 | newactivity.h \ 79 | basedialog.h 80 | 81 | SOURCES += \ 82 | app/app.cpp \ 83 | app/appinit.cpp \ 84 | app/applive.cpp \ 85 | app/applog.cpp \ 86 | app/iconhelper.cpp \ 87 | db/activitydao.cpp \ 88 | db/basedao.cpp \ 89 | db/userdao.cpp \ 90 | model/activity.cpp \ 91 | model/relation.cpp \ 92 | model/user.cpp \ 93 | tool/exportexcelobject.cpp \ 94 | tool/l.cpp \ 95 | widget/frminputbox.cpp \ 96 | widget/frmmessagebox.cpp \ 97 | activitydetail.cpp \ 98 | editprofile.cpp \ 99 | frmconfig.cpp \ 100 | login.cpp \ 101 | main.cpp \ 102 | maindialog.cpp \ 103 | myactivity.cpp \ 104 | newactivity.cpp \ 105 | basedialog.cpp 106 | -------------------------------------------------------------------------------- /README.MD: -------------------------------------------------------------------------------- 1 | ![CDoc](screenshots/icon.png) 2 | #云DOC 3 | 4 | 项目背景:假期活动聚会频繁,如何清楚、明了的管理自己的各个活动成为当下大家急需解决的问题。项目立足于解决活动信息共享与管理的问题,实现了云端发起活动、报名参与活动、修改活动信息内容等功能,使得活动参与者足不出户了解各个活动的最新动态和安排,活动组织者更为高效的管理和设计活动。 5 | 6 | #### [体验地址](http://7xlkp1.dl1.z0.glb.clouddn.com/CDoc.exe) 7 | 8 | ###展示: 9 | #####登录页面 10 |
11 | #####主页 12 |
13 | #####填写用户信息 14 |
15 | #####发起活动 16 |
17 | #####活动详情 18 |
19 | #####活动邀请码 20 |
21 | #####我的活动 22 |
23 | 24 | ###简要说明 25 | 26 | 1.数据库用的是sqlite,配置好mysql环境,也能轻易连上mysql, 27 | 28 | (1)取消 main.cpp的注释 29 | 30 | //BaseDao::set_driver("QMYSQL"); 31 | 32 | 33 | (2)配置 basedao.cpp的账户密码即可 34 | 35 | if(db_driver=="QMYSQL") 36 | { 37 | db=QSqlDatabase::addDatabase("QMYSQL"); 38 | db.setHostName("localhost"); 39 | db.setDatabaseName("cdoc"); 40 | db.setUserName("klob"); 41 | } 42 | 2.换肤功能实现参考 [http://www.qtcn.org/bbs/read.php?tid=58060](http://www.qtcn.org/bbs/read.php?tid=58060) 43 | 44 | 3.采用MVC模式,代码逻辑结构简单,容易理清,适合新手阅读参考 45 | 46 | ###编译配置 47 | 1. 48 | 49 | IDE: Qt Creator 3.1.2 (opensource) Based on Qt 5.3.1 (MSVC 2010, 32 bit) 50 | 51 | Compiler: Qt 5.3 MinGW 32bit 52 | 53 | OS: Windows 8.1 54 | 55 | 2. 56 | 57 | 可以直接下载,删除CDoc.pro.user,打开CDoc.pro即可编译 58 | 59 | 60 | ## Contact Me 61 | * email:kloblic@gmail.com 62 | * blog: [klob.diandi.life](http://klob.diandi.life) 63 | 64 | ## License 65 | 66 | Copyright 2015 klob.diandi.life 67 | 68 | Licensed under the Apache License, Version 2.0 (the "License"); 69 | you may not use this file except in compliance with the License. 70 | You may obtain a copy of the License at 71 | 72 | http://www.apache.org/licenses/LICENSE-2.0 73 | 74 | Unless required by applicable law or agreed to in writing, software 75 | distributed under the License is distributed on an "AS IS" BASIS, 76 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 77 | See the License for the specific language governing permissions and 78 | limitations under the License. 79 | -------------------------------------------------------------------------------- /activitydetail.cpp: -------------------------------------------------------------------------------- 1 | #include "activitydetail.h" 2 | #include "ui_activitydetail.h" 3 | 4 | /* 5 | * 活动详情页 6 | * 管理员可以修改和导出表格 7 | * 普通参与人员则不行 8 | */ 9 | 10 | ActivityDetail::ActivityDetail(QWidget *parent) : 11 | QDialog(parent), 12 | ui(new Ui::ActivityDetail) 13 | { 14 | 15 | //初始化UI 16 | ui->setupUi(this); 17 | this->setProperty("Form", true); 18 | this->setProperty("CanMove", false); 19 | this->setWindowIcon(QIcon(":/image/icon")); 20 | this->setWindowTitle("云Doc信息管理系统"); 21 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 22 | ui->lab_Title->installEventFilter(this); 23 | IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d)); 24 | IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068)); 25 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 26 | connect(ui->btnMenu_Min, SIGNAL(clicked()), this, SLOT(showMinimized())); 27 | 28 | } 29 | 30 | //初始化人员列表 31 | void ActivityDetail::init_user() 32 | { 33 | 34 | QStandardItemModel *student_model = new QStandardItemModel(); 35 | student_model->setHorizontalHeaderItem(0, new QStandardItem(QObject::tr("姓名"))); 36 | student_model->setHorizontalHeaderItem(1, new QStandardItem(QObject::tr("手机"))); 37 | student_model->setHorizontalHeaderItem(2, new QStandardItem(QObject::tr("QQ"))); 38 | student_model->setHorizontalHeaderItem(3, new QStandardItem(QObject::tr("备注"))); 39 | QList users=UserDao::get_instance()->query_by_relation(activity.userrelations); 40 | for(int i=0;isetItem(i, 0, new QStandardItem(users.at(i).username)); 43 | student_model->setItem(i, 1, new QStandardItem(users.at(i).phone)); 44 | student_model->setItem(i, 2, new QStandardItem(users.at(i).qq)); 45 | } 46 | 47 | ui->tableView->setModel(student_model); 48 | 49 | } 50 | 51 | //初始化活动详情 52 | void ActivityDetail::init(int id) 53 | { 54 | 55 | activity=ActivityDao::get_instance()->query_by_id(id); 56 | 57 | is_manager=(activity.managerid==UserDao::get_currentUser().id); 58 | ui->title->setText(activity.title); 59 | ui->date->setText(activity.date.toString(Activity::FORMAT)); 60 | ui->address->setText(activity.address); 61 | ui->budget->setText(L::w(activity.budget)); 62 | ui->code->setText(activity.code); 63 | ui->detail->setText(activity.detail); 64 | ui->detail->setWordWrap(true); 65 | ui->detail->setAlignment(Qt::AlignTop); 66 | init_user(); 67 | if(!is_manager) 68 | { 69 | 70 | ui->edit->hide(); 71 | ui->export_excel->hide(); 72 | } 73 | else{ 74 | 75 | ui->edit->show(); 76 | ui->export_excel->show(); 77 | } 78 | 79 | } 80 | 81 | ActivityDetail::~ActivityDetail() 82 | { 83 | delete ui; 84 | } 85 | 86 | //导出excel表格 87 | void ActivityDetail::on_export_excel_clicked() 88 | { 89 | 90 | QString fileName = QFileDialog::getSaveFileName(this, tr("Excel file"), qApp->applicationDirPath (), 91 | tr("Excel Files (*.xls)")); 92 | if (fileName.isEmpty()) 93 | return; 94 | 95 | ExportExcelObject obj(fileName, "mydata", ui->tableView); 96 | 97 | 98 | obj.addField(0, "姓名", "char(20)"); 99 | obj.addField(1, "手机", "char(20)"); 100 | obj.addField(2, "QQ", "char(20)"); 101 | obj.addField(3, "备注", "char(20)"); 102 | 103 | int retVal = obj.export2Excel(); 104 | if( retVal > 0) 105 | { 106 | QMessageBox::information(this, tr("Done"),QString(tr("%1 records exported!")).arg(retVal)); 107 | } 108 | } 109 | 110 | //进入修改详情页 111 | void ActivityDetail::on_edit_clicked() 112 | { 113 | NewActivity newac; 114 | newac.set_update(true,activity.id); 115 | int i =newac.exec(); 116 | L::i("activitydetail",L::w(activity.id)); 117 | if(i) 118 | { 119 | init(activity.id); 120 | } 121 | 122 | } 123 | -------------------------------------------------------------------------------- /activitydetail.h: -------------------------------------------------------------------------------- 1 | #ifndef ACTIVITYDETAIL_H 2 | #define ACTIVITYDETAIL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include"myhelper.h" 9 | #include"text.h" 10 | #include"userdao.h" 11 | #include"activitydao.h" 12 | #include"exportexcelobject.h" 13 | #include"newactivity.h" 14 | 15 | namespace Ui { 16 | class ActivityDetail; 17 | } 18 | 19 | class ActivityDetail : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit ActivityDetail(QWidget *parent = 0); 25 | 26 | void init(int id); 27 | void init_user(); 28 | ~ActivityDetail(); 29 | 30 | private slots: 31 | void on_export_excel_clicked(); 32 | 33 | void on_edit_clicked(); 34 | 35 | private: 36 | Activity activity; 37 | bool is_manager; 38 | Ui::ActivityDetail *ui; 39 | }; 40 | 41 | #endif // ACTIVITYDETAIL_H 42 | -------------------------------------------------------------------------------- /app/app.cpp: -------------------------------------------------------------------------------- 1 | #include "app.h" 2 | #include "myhelper.h" 3 | 4 | QString App::AppPath = ""; 5 | 6 | #ifdef Q_OS_WIN 7 | int App::AppFontSize = 10; 8 | QString App::AppFontName = "Microsoft YaHei"; 9 | #endif 10 | 11 | #ifdef Q_OS_LINUX 12 | #ifdef __arm__ 13 | int App::AppFontSize = 11; 14 | QString App::AppFontName = "WenQuanYi Micro Hei"; 15 | #else 16 | int App::AppFontSize = 11; 17 | QString App::AppFontName = "WenQuanYi"; 18 | #endif 19 | #endif 20 | 21 | #ifdef Q_OS_MAC 22 | int App::AppFontSize = 11; 23 | QString App::AppFontName = "Heiti SC"; 24 | #endif 25 | 26 | QString App::AppStyle = ":/qss/brown.css"; 27 | 28 | int App::IcoMain = 0xf015; 29 | int App::IcoMin = 0xf068; 30 | int App::IcoClose = 0xf00d; 31 | int App::IcoMax = 0xf079; 32 | int App::IcoNormal = 0xf096; 33 | 34 | /* 35 | * APP配置读取 36 | */ 37 | 38 | void App::ReadConfig() 39 | { 40 | QString fileName = App::AppPath + "/GAS_Config.ini"; 41 | //如果配置文件不存在,则以初始值继续运行,并生成配置文件 42 | if (!MyHelper::FileIsExist(fileName)) { 43 | WriteConfig(); 44 | return; 45 | } 46 | 47 | QSettings *set = new QSettings(fileName, QSettings::IniFormat); 48 | set->beginGroup("AppConfig"); 49 | 50 | App::AppStyle = set->value("AppStyle").toString(); 51 | 52 | set->endGroup(); 53 | } 54 | 55 | /* 56 | * APP配置保存 57 | */ 58 | 59 | void App::WriteConfig() 60 | { 61 | QString fileName = App::AppPath + "/GAS_Config.ini"; 62 | QSettings *set = new QSettings(fileName, QSettings::IniFormat); 63 | set->beginGroup("AppConfig"); 64 | 65 | set->setValue("AppStyle", App::AppStyle); 66 | 67 | set->endGroup(); 68 | } 69 | -------------------------------------------------------------------------------- /app/app.h: -------------------------------------------------------------------------------- 1 | #ifndef APP_H 2 | #define APP_H 3 | 4 | class QString; 5 | 6 | class App 7 | { 8 | public: 9 | static QString AppPath; //应用程序路径 10 | static int AppFontSize; //应用程序字体大小 11 | static QString AppFontName; //应用程序字体名称 12 | static QString AppStyle; //应用程序样式 13 | 14 | static int IcoMain; //左上角图标 15 | static int IcoMin; //最小化图标 16 | static int IcoClose; //关闭图标 17 | static int IcoMax; //最大化图标 18 | static int IcoNormal; //正常图标 19 | 20 | static void ReadConfig(); //读取配置文件,在main函数最开始加载程序载入 21 | static void WriteConfig(); //写入配置文件,在更改配置文件程序关闭时调用 22 | 23 | }; 24 | 25 | #endif // APP_H 26 | -------------------------------------------------------------------------------- /app/appinit.cpp: -------------------------------------------------------------------------------- 1 | #include "appinit.h" 2 | #include "myhelper.h" 3 | /* 4 | * APP初始化化类 5 | */ 6 | AppInit::AppInit(QObject *parent) : QObject(parent) 7 | { 8 | mousePressed = false; 9 | qApp->installEventFilter(this); 10 | } 11 | 12 | bool AppInit::eventFilter(QObject *obj, QEvent *evt) 13 | { 14 | QWidget *w = (QWidget *)obj; 15 | if (!w->property("CanMove").toBool()) { 16 | return QObject::eventFilter(obj, evt); 17 | } 18 | 19 | QMouseEvent *event = static_cast(evt); 20 | if (event->type() == QEvent::MouseButtonPress) { 21 | if (event->button() == Qt::LeftButton) { 22 | mousePressed = true; 23 | mousePoint = event->globalPos() - w->pos(); 24 | return true; 25 | } 26 | } else if (event->type() == QEvent::MouseButtonRelease) { 27 | mousePressed = false; 28 | return true; 29 | } else if (event->type() == QEvent::MouseMove) { 30 | if (mousePressed && (event->buttons() && Qt::LeftButton)) { 31 | w->move(event->globalPos() - mousePoint); 32 | return true; 33 | } 34 | } 35 | 36 | return QObject::eventFilter(obj, evt); 37 | } 38 | 39 | //加载 40 | void AppInit::Load() 41 | { 42 | MyHelper::SetUTF8Code(); 43 | MyHelper::SetChinese(); 44 | MyHelper::SetFont(); 45 | 46 | App::AppPath = QApplication::applicationDirPath(); 47 | App::ReadConfig(); 48 | MyHelper::SetStyle(App::AppStyle); 49 | } 50 | -------------------------------------------------------------------------------- /app/appinit.h: -------------------------------------------------------------------------------- 1 | #ifndef APPINIT_H 2 | #define APPINIT_H 3 | 4 | #include 5 | #include 6 | 7 | class AppInit : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit AppInit(QObject *parent = 0); 12 | 13 | void Load(); 14 | 15 | private: 16 | QPoint mousePoint; //鼠标拖动时的坐标 17 | bool mousePressed; //鼠标是否按下 18 | 19 | protected: 20 | bool eventFilter(QObject *obj, QEvent *evt); 21 | 22 | signals: 23 | 24 | public slots: 25 | }; 26 | 27 | #endif // APPINIT_H 28 | -------------------------------------------------------------------------------- /app/applive.cpp: -------------------------------------------------------------------------------- 1 | #include "applive.h" 2 | 3 | AppLive::AppLive(QObject *parent) : QObject(parent) 4 | { 5 | udpServer = new QUdpSocket(this); 6 | } 7 | 8 | AppLive::~AppLive() 9 | { 10 | 11 | } 12 | 13 | void AppLive::Start() 14 | { 15 | udpServer->bind(6008); 16 | connect(udpServer, SIGNAL(readyRead()), this, SLOT(ReadData())); 17 | } 18 | 19 | void AppLive::ReadData() 20 | { 21 | QByteArray tempData; 22 | do { 23 | tempData.resize(udpServer->pendingDatagramSize()); 24 | QHostAddress sender; 25 | quint16 senderPort; 26 | udpServer->readDatagram(tempData.data(), tempData.size(), &sender, &senderPort); 27 | QString data = QLatin1String(tempData); 28 | if (data == "hello") { 29 | udpServer->writeDatagram("GASOK", sender, senderPort); 30 | } 31 | } while (udpServer->hasPendingDatagrams()); 32 | } 33 | -------------------------------------------------------------------------------- /app/applive.h: -------------------------------------------------------------------------------- 1 | #ifndef APPLIVE_H 2 | #define APPLIVE_H 3 | 4 | #include 5 | #include 6 | 7 | class AppLive : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit AppLive(QObject *parent = 0); 12 | ~AppLive(); 13 | 14 | void Start(); 15 | 16 | private slots: 17 | void ReadData(); 18 | 19 | private: 20 | QUdpSocket *udpServer; 21 | 22 | signals: 23 | 24 | public slots: 25 | }; 26 | 27 | #endif // APPLIVE_H 28 | -------------------------------------------------------------------------------- /app/applog.cpp: -------------------------------------------------------------------------------- 1 | #include "applog.h" 2 | #include "myhelper.h" 3 | 4 | /* 5 | * 日志打印 6 | */ 7 | //输出所有打印调试信息到日志文件 8 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 9 | void Log(QtMsgType type, const char *msg) 10 | { 11 | QString content; 12 | switch (type) { 13 | case QtDebugMsg: 14 | content = QString("%1").arg(msg); 15 | break; 16 | case QtWarningMsg: 17 | content = QString("%1").arg(msg); 18 | break; 19 | case QtCriticalMsg: 20 | content = QString("%1").arg(msg); 21 | break; 22 | case QtFatalMsg: 23 | content = QString("%1").arg(msg); 24 | exit(0); 25 | } 26 | 27 | QString logFile = QString("%1/LOG/GAS_Log_%2.txt") 28 | .arg(App::AppPath) 29 | .arg(DATE); 30 | QFile log(logFile); 31 | log.open(QIODevice::WriteOnly | QIODevice::Append); 32 | QTextStream logStream(&log); 33 | logStream << content << "\r\n"; 34 | } 35 | #else 36 | void Log(QtMsgType type, const QMessageLogContext &, const QString &msg) 37 | { 38 | QString content; 39 | switch (type) { 40 | case QtDebugMsg: 41 | content = QString("%1").arg(msg); 42 | break; 43 | case QtWarningMsg: 44 | content = QString("%1").arg(msg); 45 | break; 46 | case QtCriticalMsg: 47 | content = QString("%1").arg(msg); 48 | break; 49 | case QtFatalMsg: 50 | content = QString("%1").arg(msg); 51 | exit(0); 52 | } 53 | 54 | QString logFile = QString("%1/LOG/GAS_Log_%2.txt") 55 | .arg(App::AppPath) 56 | .arg(DATEP); 57 | QFile log(logFile); 58 | log.open(QIODevice::WriteOnly | QIODevice::Append); 59 | QTextStream logStream(&log); 60 | logStream << content << "\r\n"; 61 | } 62 | #endif 63 | 64 | AppLog::AppLog(QObject *parent) : QObject(parent) 65 | { 66 | 67 | } 68 | 69 | void AppLog::Load() 70 | { 71 | //如果日志文件夹不存在则创建 72 | QString logDir = QString("%1/LOG").arg(App::AppPath); 73 | QDir log(logDir); 74 | if (!log.exists()) { 75 | log.mkpath(logDir); 76 | } 77 | 78 | //安装日志钩子,输出调试信息到文件,便于调试 79 | #if (QT_VERSION <= QT_VERSION_CHECK(5,0,0)) 80 | qInstallMsgHandler(Log); 81 | #else 82 | qInstallMessageHandler(Log); 83 | #endif 84 | } 85 | 86 | -------------------------------------------------------------------------------- /app/applog.h: -------------------------------------------------------------------------------- 1 | #ifndef APPLOG_H 2 | #define APPLOG_H 3 | 4 | #include 5 | 6 | class AppLog : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit AppLog(QObject *parent = 0); 11 | 12 | void Load(); 13 | 14 | signals: 15 | 16 | public slots: 17 | }; 18 | 19 | #endif // APPLOG_H 20 | -------------------------------------------------------------------------------- /app/iconhelper.cpp: -------------------------------------------------------------------------------- 1 | #include "iconhelper.h" 2 | #include "app.h" 3 | 4 | IconHelper *IconHelper::_instance = 0; 5 | /* 6 | * 图标帮助 7 | */ 8 | IconHelper::IconHelper(QObject *): 9 | QObject(qApp) 10 | { 11 | int fontId = QFontDatabase::addApplicationFont(":/image/fontawesome-webfont.ttf"); 12 | QString fontName = QFontDatabase::applicationFontFamilies(fontId).at(0); 13 | iconFont = QFont(fontName); 14 | } 15 | 16 | void IconHelper::SetIcon(QLabel *lab, QChar c) 17 | { 18 | SetIcon(lab, c, App::AppFontSize); 19 | } 20 | 21 | void IconHelper::SetIcon(QPushButton *btn, QChar c) 22 | { 23 | SetIcon(btn, c, App::AppFontSize); 24 | } 25 | 26 | void IconHelper::SetIcon(QLabel *lab, QChar c, int size) 27 | { 28 | iconFont.setPointSize(size); 29 | lab->setFont(iconFont); 30 | lab->setText(c); 31 | } 32 | 33 | void IconHelper::SetIcon(QPushButton *btn, QChar c, int size) 34 | { 35 | iconFont.setPointSize(size); 36 | btn->setFont(iconFont); 37 | btn->setText(c); 38 | } 39 | 40 | void IconHelper::SetIcoMain(QLabel *labMain) 41 | { 42 | SetIcoMain(labMain, App::AppFontSize); 43 | } 44 | 45 | void IconHelper::SetIcoMin(QPushButton *btnMin) 46 | { 47 | SetIcoMin(btnMin, App::AppFontSize); 48 | } 49 | 50 | void IconHelper::SetIcoClose(QPushButton *btnClose) 51 | { 52 | SetIcoClose(btnClose, App::AppFontSize); 53 | } 54 | 55 | void IconHelper::SetIcoMax(QPushButton *btnMax) 56 | { 57 | SetIcoMax(btnMax, App::AppFontSize); 58 | } 59 | 60 | void IconHelper::SetIcoNormal(QPushButton *btnNormal) 61 | { 62 | SetIcoNormal(btnNormal, App::AppFontSize); 63 | } 64 | 65 | void IconHelper::SetIcoMain(QLabel *labMain, int size) 66 | { 67 | iconFont.setPointSize(size); 68 | labMain->setFont(iconFont); 69 | labMain->setText(QChar(App::IcoMain)); 70 | } 71 | 72 | void IconHelper::SetIcoMin(QPushButton *btnMin, int size) 73 | { 74 | iconFont.setPointSize(size); 75 | btnMin->setFont(iconFont); 76 | btnMin->setText(QChar(App::IcoMin)); 77 | } 78 | 79 | void IconHelper::SetIcoClose(QPushButton *btnClose, int size) 80 | { 81 | iconFont.setPointSize(size); 82 | btnClose->setFont(iconFont); 83 | btnClose->setText(QChar(App::IcoClose)); 84 | } 85 | 86 | void IconHelper::SetIcoMax(QPushButton *btnMax, int size) 87 | { 88 | iconFont.setPointSize(size); 89 | btnMax->setFont(iconFont); 90 | btnMax->setText(QChar(App::IcoMax)); 91 | } 92 | 93 | void IconHelper::SetIcoNormal(QPushButton *btnNormal, int size) 94 | { 95 | iconFont.setPointSize(size); 96 | btnNormal->setFont(iconFont); 97 | btnNormal->setText(QChar(App::IcoNormal)); 98 | } 99 | -------------------------------------------------------------------------------- /app/iconhelper.h: -------------------------------------------------------------------------------- 1 | #ifndef ICONHELPER_H 2 | #define ICONHELPER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class IconHelper : public QObject 13 | { 14 | private: 15 | explicit IconHelper(QObject *parent = 0); 16 | QFont iconFont; 17 | static IconHelper *_instance; 18 | 19 | public: 20 | static IconHelper *Instance() { 21 | static QMutex mutex; 22 | if (!_instance) { 23 | QMutexLocker locker(&mutex); 24 | if (!_instance) { 25 | _instance = new IconHelper; 26 | } 27 | } 28 | return _instance; 29 | } 30 | 31 | void SetIcon(QLabel *lab, QChar c); 32 | void SetIcon(QPushButton *btn, QChar c); 33 | void SetIcon(QLabel *lab, QChar c, int size); 34 | void SetIcon(QPushButton *btn, QChar c, int size); 35 | 36 | void SetIcoMain(QLabel *labMain); 37 | void SetIcoMin(QPushButton *btnMin); 38 | void SetIcoClose(QPushButton *btnClose); 39 | void SetIcoMax(QPushButton *btnMax); 40 | void SetIcoNormal(QPushButton *btnNormal); 41 | 42 | void SetIcoMain(QLabel *labMain, int size); 43 | void SetIcoMin(QPushButton *btnMin, int size); 44 | void SetIcoClose(QPushButton *btnClose, int size); 45 | void SetIcoMax(QPushButton *btnMax, int size); 46 | void SetIcoNormal(QPushButton *btnNormal, int size); 47 | 48 | }; 49 | 50 | #endif // ICONHELPER_H 51 | -------------------------------------------------------------------------------- /basedialog.cpp: -------------------------------------------------------------------------------- 1 | #include "basedialog.h" 2 | #include "ui_basedialog.h" 3 | 4 | BaseDialog::BaseDialog(QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::BaseDialog) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | BaseDialog::~BaseDialog() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /basedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef BASEDIALOG_H 2 | #define BASEDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class BaseDialog; 8 | } 9 | 10 | class BaseDialog : public QDialog 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit BaseDialog(QWidget *parent = 0); 16 | ~BaseDialog(); 17 | 18 | private: 19 | Ui::BaseDialog *ui; 20 | }; 21 | 22 | #endif // BASEDIALOG_H 23 | -------------------------------------------------------------------------------- /basedialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | BaseDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 0 20 | 0 21 | 800 22 | 28 23 | 24 | 25 | 26 | 27 | 0 28 | 0 29 | 30 | 31 | 32 | 33 | 100 34 | 28 35 | 36 | 37 | 38 | 39 | 0 40 | 41 | 42 | 0 43 | 44 | 45 | 0 46 | 47 | 48 | 0 49 | 50 | 51 | 0 52 | 53 | 54 | 55 | 56 | 57 | 0 58 | 0 59 | 60 | 61 | 62 | 63 | 0 64 | 65 | 66 | 0 67 | 68 | 69 | 0 70 | 71 | 72 | 0 73 | 74 | 75 | 0 76 | 77 | 78 | 79 | 80 | 81 | 0 82 | 0 83 | 84 | 85 | 86 | font: 75 14pt "Aharoni"; 87 | font: 75 9pt "微软雅黑"; 88 | 89 | 90 | 91 | 92 | 93 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 0 102 | 0 103 | 104 | 105 | 106 | 107 | 40 108 | 0 109 | 110 | 111 | 112 | ArrowCursor 113 | 114 | 115 | Qt::NoFocus 116 | 117 | 118 | 关闭 119 | 120 | 121 | 122 | 123 | 124 | true 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 0 133 | 0 134 | 135 | 136 | 137 | 138 | 40 139 | 0 140 | 141 | 142 | 143 | ArrowCursor 144 | 145 | 146 | Qt::NoFocus 147 | 148 | 149 | 最小化 150 | 151 | 152 | 153 | 154 | 155 | true 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 0 168 | 60 169 | 800 170 | 28 171 | 172 | 173 | 174 | 175 | 0 176 | 0 177 | 178 | 179 | 180 | 181 | 100 182 | 28 183 | 184 | 185 | 186 | 187 | 16777215 188 | 16777215 189 | 190 | 191 | 192 | 193 | 194 | 80 195 | 0 196 | 800 197 | 28 198 | 199 | 200 | 201 | 202 | 0 203 | 0 204 | 205 | 206 | 207 | 208 | 100 209 | 28 210 | 211 | 212 | 213 | 214 | 215 | 640 216 | 0 217 | 75 218 | 23 219 | 220 | 221 | 222 | PushButton 223 | 224 | 225 | true 226 | 227 | 228 | 229 | 230 | 231 | 550 232 | 0 233 | 75 234 | 23 235 | 236 | 237 | 238 | PushButton 239 | 240 | 241 | true 242 | 243 | 244 | 245 | 246 | 247 | 110 248 | 10 249 | 54 250 | 12 251 | 252 | 253 | 254 | 255 | 0 256 | 0 257 | 258 | 259 | 260 | TextLabel 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | -------------------------------------------------------------------------------- /db/activitydao.cpp: -------------------------------------------------------------------------------- 1 | #include"activitydao.h" 2 | 3 | 4 | ActivityDao * ActivityDao::m_instance=NULL; 5 | QString TAG = "ActivityDao"; 6 | 7 | /* 8 | * Activity 数据库访问类 采用单例模式 9 | */ 10 | 11 | ActivityDao * ActivityDao::get_instance() 12 | { 13 | if(m_instance==NULL) 14 | { 15 | m_instance=new ActivityDao(); 16 | } 17 | return m_instance; 18 | } 19 | 20 | ActivityDao::ActivityDao() 21 | { 22 | 23 | 24 | } 25 | 26 | //增 27 | bool ActivityDao::save(Activity activity){ 28 | QString sql="insert into activity " + activity.get_sql(); 29 | return doSql(sql); 30 | } 31 | 32 | //删 33 | bool ActivityDao::delete_activty(Activity activity){ 34 | return deleteById(activity.id); 35 | } 36 | 37 | 38 | bool ActivityDao::deleteById(int id){ 39 | QString sql = " delete from activity where id = " +L::wraper(id); 40 | return doSql(sql); 41 | } 42 | 43 | //查 44 | QList ActivityDao::query_all(){ 45 | QList list; 46 | QList activity_list; 47 | QString sql= "select * from activity"; 48 | doSql(sql); 49 | while(excutor.next()) 50 | { 51 | list< ActivityDao::query_by_managerid(int managerid){ 74 | 75 | QString sql ="select * from activity where managerid = " +L::wraper(managerid); 76 | QList list; 77 | QList activity_list; 78 | doSql(sql); 79 | while(excutor.next()) 80 | { 81 | list< ActivityDao::query_by_relation(Relation relation) 109 | { 110 | 111 | QListacs; 112 | ActivityDao * dao = ActivityDao::get_instance(); 113 | foreach (int id, relation.sql_to_ids()) { 114 | if(id!=0){ 115 | acs.append(dao->query_by_id(id)); 116 | } 117 | } 118 | return acs; 119 | } 120 | 121 | //改 122 | bool ActivityDao::update(Activity activity){ 123 | QString sql = "update activity set " +activity.get_update_sql(); 124 | return doSql(sql); 125 | } 126 | 127 | ActivityDao::~ActivityDao() 128 | { 129 | db.close(); 130 | } 131 | 132 | //sql语句解析成Activity model 133 | Activity ActivityDao::parse(QSqlRecord record) 134 | { 135 | Activity activity; 136 | 137 | activity.id=record.value(Activity::ID).toInt(); 138 | 139 | activity.date=record.value(Activity::DATE).toDateTime(); 140 | activity.title=record.value(Activity::TITLE).toString(); 141 | activity.address=record.value(Activity::ADDRESS).toString(); 142 | activity.managerid=record.value(Activity::MANAGERID).toInt(); 143 | 144 | 145 | activity.detail=record.value(Activity::DETAIL).toString(); 146 | activity.code=record.value(Activity::CODE).toString(); 147 | activity.budget=record.value(Activity::BUDGET).toInt(); 148 | 149 | activity.privacy=record.value(Activity::PRIVACY).toInt(); 150 | activity.state=record.value(Activity::STATE).toInt(); 151 | activity.userrelations.set_sql(record.value(Activity::USERRELATION).toString()); 152 | 153 | 154 | return activity; 155 | } 156 | 157 | 158 | -------------------------------------------------------------------------------- /db/activitydao.h: -------------------------------------------------------------------------------- 1 | #ifndef ACTIVITYDAO_H 2 | #define ACTIVITYDAO_H 3 | 4 | #include"../model/activity.h" 5 | #include"basedao.h" 6 | #include"../model/relation.h" 7 | class ActivityDao : public BaseDao 8 | { 9 | private: 10 | ActivityDao(); 11 | ~ActivityDao(); 12 | static ActivityDao * m_instance; 13 | public: 14 | static ActivityDao * get_instance(); 15 | 16 | bool save(Activity); 17 | 18 | bool deleteById(int id); 19 | bool delete_activty(Activity activity); 20 | 21 | bool update(Activity activity); 22 | 23 | QList query_all(); 24 | Activity query_by_id(int id); 25 | Activity query_by_code(QString code); 26 | QList query_by_managerid(int managerid); 27 | QList query_by_relation(Relation relation); 28 | 29 | bool doSql(QString sql); 30 | 31 | Activity parse(QSqlRecord record); 32 | }; 33 | 34 | #endif // ACTIVITYDAO_H 35 | -------------------------------------------------------------------------------- /db/basedao.cpp: -------------------------------------------------------------------------------- 1 | #include "basedao.h" 2 | 3 | static const QString TAG= "Basedao"; 4 | QSqlDatabase BaseDao::db; 5 | QSqlQuery BaseDao::excutor=QSqlQuery(BaseDao::db); 6 | bool BaseDao::is_open=false; 7 | QString BaseDao::db_driver="QSQLITE"; 8 | 9 | /* 10 | * 数据基础类 11 | */ 12 | 13 | BaseDao::BaseDao() 14 | { 15 | 16 | } 17 | 18 | BaseDao::~BaseDao() 19 | { 20 | close(); 21 | } 22 | 23 | void BaseDao::set_driver(QString dbdriver) 24 | { 25 | db_driver = dbdriver; 26 | } 27 | //初始化 28 | bool BaseDao::init (){ 29 | if( BaseDao::is_open==false){ 30 | 31 | if(db_driver=="QMYSQL") 32 | { 33 | db=QSqlDatabase::addDatabase("QMYSQL"); 34 | 35 | db.setHostName("localhost"); 36 | db.setDatabaseName("cdoc"); 37 | db.setUserName("klob"); 38 | db.setPassword("liuping"); 39 | } 40 | else 41 | { 42 | db=QSqlDatabase::addDatabase("QSQLITE"); 43 | db.setDatabaseName("cdoc.db"); 44 | } 45 | } 46 | if(BaseDao::is_open==false){ 47 | if (BaseDao::db.open()) 48 | { 49 | excutor =QSqlQuery(BaseDao::db); 50 | create_table(); 51 | L::i(TAG,"connect success"); 52 | BaseDao::is_open=true; 53 | } 54 | else 55 | { 56 | L::i(TAG,"connect failed"); 57 | } 58 | return true; 59 | } 60 | else 61 | { 62 | excutor =QSqlQuery(BaseDao::db); 63 | L::i("db","user cache db"); 64 | BaseDao::is_open=true; 65 | return true; 66 | } 67 | 68 | } 69 | 70 | //执行sql语句 71 | bool BaseDao::doSql(QString sql){ 72 | L::i(TAG,sql); 73 | return excutor.exec(sql); 74 | } 75 | 76 | void BaseDao::close(){ 77 | db.close(); 78 | } 79 | 80 | //建表 81 | bool BaseDao::create_table() 82 | { 83 | bool flag1,flag2; 84 | QString mysqlac="CREATE TABLE activity(id INTEGER PRIMARY KEY AUTO_INCREMENT ,title VARCHAR( 100 ) DEFAULT '0' NOT NULL ,DATE DATE DEFAULT '0' NOT NULL ,address NVARCHAR( 100 ) DEFAULT '0' NOT NULL ,managerid INTEGER NOT NULL ,detail NVARCHAR( 200 ) DEFAULT '0' NULL ,userrelation NVARCHAR( 200 ) DEFAULT '0' NULL ,budget INTEGER NULL ,privacy INTEGER DEFAULT '0' NULL ,code NVARCHAR( 100 ) NULL ,state INTEGER DEFAULT '0' NULL)"; 85 | QString myluser="CREATE TABLE USER( " 86 | "id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL , " 87 | "username VARCHAR( 20 ) DEFAULT '0' NULL , " 88 | "passward VARCHAR( 20 ) DEFAULT '0' NULL , " 89 | "phone VARCHAR( 40 ) DEFAULT '0' UNIQUE NULL , " 90 | "qq VARCHAR( 20 ) DEFAULT '0' NULL , " 91 | "activityrelation NVARCHAR(200) DEFAULT '0' NULL," 92 | "signature NVARCHAR( 140 ) DEFAULT '0' NULL , TYPE INTEGER DEFAULT '0' NOT NULL )"; 93 | 94 | QString sqlite1 = "CREATE TABLE [user] (" 95 | "[id] INTEGER DEFAULT '1' PRIMARY KEY AUTOINCREMENT NOT NULL," 96 | "[username] varchar(20) DEFAULT '0' NULL," 97 | "[passward] varchar(20) DEFAULT '0' NULL," 98 | "[phone] VARCHAR(40) DEFAULT '0' UNIQUE NULL," 99 | "[qq] VARCHAR(20) DEFAULT '0' NULL," 100 | "[activityrelation] NVARCHAR(200) DEFAULT '0' NULL," 101 | "[signature] NVARCHAR(140) DEFAULT '0' NULL," 102 | "[type] INTEGER DEFAULT '0' NOT NULL)"; 103 | 104 | QString sqlite2 = "CREATE TABLE " 105 | "[activity] (" 106 | "[id] INTEGER DEFAULT '1' NOT NULL PRIMARY KEY AUTOINCREMENT," 107 | "[title] VARCHAR(100) DEFAULT '0' NOT NULL," 108 | "[date] DATE DEFAULT CURRENT_TIME NOT NULL," 109 | "[address] NVARCHAR(100) DEFAULT '0' NOT NULL," 110 | "[managerid] INTEGER NOT NULL," 111 | "[detail] NVARCHAR(200) DEFAULT '0' NULL," 112 | "[userrelation] NVARCHAR(200) DEFAULT '0' NULL," 113 | "[budget] INTEGER NULL,[privacy] INTEGER DEFAULT '0' NULL," 114 | "[code] NVARCHAR(100) NULL," 115 | "[state] INTEGER DEFAULT '0' NULL)"; 116 | if(db_driver=="QMYSQL") 117 | { 118 | excutor.clear(); 119 | flag1= excutor.exec(mysqlac); 120 | 121 | excutor.clear(); 122 | flag2= excutor.exec(myluser); 123 | } 124 | else 125 | { 126 | excutor.clear(); 127 | flag1= excutor.exec(sqlite1); 128 | 129 | excutor.clear(); 130 | flag2= excutor.exec(sqlite2); 131 | } 132 | 133 | return flag1&&flag2; 134 | 135 | } 136 | -------------------------------------------------------------------------------- /db/basedao.h: -------------------------------------------------------------------------------- 1 | #ifndef BASEDAO_H 2 | #define BASEDAO_H 3 | #include"tool/text.h" 4 | #include"sql.h" 5 | 6 | class BaseDao 7 | { 8 | public: 9 | 10 | 11 | BaseDao(); 12 | ~BaseDao(); 13 | bool init(); 14 | bool doSql(QString sql); 15 | void close(); 16 | bool create_table(); 17 | void static set_driver(QString dbdriver); 18 | 19 | protected: 20 | 21 | static QSqlDatabase db; 22 | static QSqlQuery excutor; 23 | private: 24 | static QString db_driver; 25 | static bool is_open; 26 | private: 27 | 28 | 29 | }; 30 | 31 | #endif // BASEDAO_H 32 | -------------------------------------------------------------------------------- /db/userdao.cpp: -------------------------------------------------------------------------------- 1 | #include"userdao.h" 2 | 3 | 4 | UserDao * UserDao::m_instance=NULL; 5 | User UserDao::current_user; 6 | 7 | /* 8 | * User 数据库访问类 采用单例模式 9 | */ 10 | 11 | UserDao * UserDao::get_instance() 12 | { 13 | if(m_instance==NULL) 14 | { 15 | L::i("userdao ","instacnce"); 16 | current_user.id=-1; 17 | m_instance=new UserDao(); 18 | } 19 | return m_instance; 20 | } 21 | UserDao::UserDao() 22 | { 23 | L::i("userdao ","userdao"); 24 | BaseDao::init(); 25 | 26 | } 27 | 28 | //得到当前用户 29 | User UserDao::get_currentUser(){ 30 | L::i("userdao",current_user.get_update_sql()); 31 | return current_user; 32 | } 33 | 34 | //设置当期用户 35 | void UserDao::set_currentUser(User user){ 36 | current_user =user; 37 | } 38 | 39 | UserDao::~UserDao(){ 40 | db.close(); 41 | } 42 | 43 | //注册 44 | bool UserDao::signup(User user) 45 | { 46 | 47 | return save(user); 48 | } 49 | 50 | //登录 51 | bool UserDao::signin(User user) 52 | { 53 | 54 | current_user= query_by_phone(user.phone); 55 | if(current_user.id<0) 56 | { 57 | L::i("USERDAO","账户不存在"); 58 | return false; 59 | } 60 | else if(user.passward==current_user.passward) 61 | { 62 | set_currentUser(current_user); 63 | 64 | // L::i(TAG,); 65 | return true; 66 | } 67 | 68 | else return false; 69 | } 70 | 71 | //增 72 | bool UserDao::save(User user){ 73 | 74 | QString sql="insert into user " + user.get_sql(); 75 | 76 | return doSql(sql); 77 | } 78 | 79 | //删 80 | bool UserDao::delete_user(User user){ 81 | return delete_by_id(user.id); 82 | } 83 | bool UserDao::delete_by_id(int id){ 84 | QString sql = " delete from user where id = " +L::wraper(id); 85 | return doSql(sql); 86 | } 87 | 88 | bool UserDao::delete_by_phone(QString phone){ 89 | QString sql = " delete from user where phone = '" +phone+"'"; 90 | return doSql(sql); 91 | } 92 | 93 | //查 94 | QList UserDao::query_all(){ 95 | QList list; 96 | QList user_list; 97 | QString sql= "select * from user"; 98 | doSql(sql); 99 | while(excutor.next()) 100 | { 101 | list< UserDao::query_by_relation(Relation relation) 131 | { 132 | 133 | QListacs; 134 | UserDao * dao = UserDao::get_instance(); 135 | foreach (int id, relation.sql_to_ids()) { 136 | if(id!=0){ 137 | acs.append(dao->query_by_id(id)); 138 | } 139 | } 140 | return acs; 141 | } 142 | //改 143 | bool UserDao::update(User user){ 144 | current_user=user; 145 | QString sql = "update user set " +user.get_update_sql(); 146 | return doSql(sql); 147 | } 148 | 149 | bool UserDao::doSql(QString sql) 150 | { 151 | return BaseDao::doSql(sql); 152 | } 153 | 154 | void UserDao::close(){ 155 | db.close(); 156 | } 157 | 158 | //User model 159 | User UserDao::parse(QSqlRecord record) 160 | { 161 | 162 | User user; 163 | user.id=record.value("id").toInt(); 164 | user.username=record.value("username").toString(); 165 | user.passward=record.value("passward").toString(); 166 | user.phone=record.value("phone").toString(); 167 | user.qq=record.value("qq").toString(); 168 | user.signature=record.value("signature").toString(); 169 | L::i("userdao",record.value(User::ACTIVITYRELATION).toString()); 170 | user.activityrelations.set_sql(record.value(User::ACTIVITYRELATION).toString()); 171 | return user; 172 | } 173 | -------------------------------------------------------------------------------- /db/userdao.h: -------------------------------------------------------------------------------- 1 | #ifndef USERDAO_H 2 | #define USERDAO_H 3 | 4 | #include"../model/user.h" 5 | #include"basedao.h" 6 | 7 | 8 | class UserDao : public BaseDao 9 | { 10 | private: 11 | UserDao(); 12 | 13 | static UserDao * m_instance; 14 | static User current_user; 15 | public: 16 | 17 | ~UserDao(); 18 | static UserDao * get_instance(); 19 | static User get_currentUser(); 20 | static void set_currentUser(User user); 21 | QList query_by_relation(Relation relation); 22 | 23 | QList query_all(); 24 | User query_by_id(int id); 25 | User query_by_phone(QString phone); 26 | 27 | bool delete_user(User user); 28 | bool delete_by_id(int id); 29 | bool delete_by_phone(QString phone); 30 | 31 | bool save(User user); 32 | bool update(User t); 33 | 34 | bool doSql(QString sql); 35 | 36 | void close(); 37 | bool signup(User user); 38 | bool signin(User user); 39 | 40 | 41 | User parse(QSqlRecord record); 42 | 43 | }; 44 | 45 | #endif // USERDAO_H 46 | -------------------------------------------------------------------------------- /editprofile.cpp: -------------------------------------------------------------------------------- 1 | #include "editprofile.h" 2 | #include "ui_editprofile.h" 3 | 4 | /* 5 | * 编辑个人资料页 6 | */ 7 | 8 | EditProfile::EditProfile(QWidget *parent) : 9 | QDialog(parent), 10 | ui(new Ui::EditProfile) 11 | { 12 | //初始化UI 13 | ui->setupUi(this); 14 | this->setProperty("Form", true); 15 | this->setProperty("CanMove", false); 16 | this->setWindowIcon(QIcon(":/image/icon")); 17 | this->setWindowTitle("云Doc信息管理系统"); 18 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 19 | ui->lab_Title->installEventFilter(this); 20 | IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d)); 21 | IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068)); 22 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 23 | connect(ui->btnMenu_Min, SIGNAL(clicked()), this, SLOT(showMinimized())); 24 | 25 | user=UserDao::get_currentUser(); 26 | QRegExp regx("[1-9][0-9]+$"); 27 | QValidator *validator = new QRegExpValidator(regx, ui->phone ); 28 | ui->phone->setValidator(validator); 29 | init(); 30 | } 31 | 32 | EditProfile::~EditProfile() 33 | { 34 | delete ui; 35 | } 36 | 37 | //初始化个人资料 38 | void EditProfile::init() 39 | { 40 | 41 | ui->id->setEnabled(false); 42 | if(user.id!=-1){ 43 | ui->id->setText(L::w(user.id)); 44 | ui->username->setText(user.username); 45 | ui->phone->setText(user.phone); 46 | ui->qq->setText(user.qq); 47 | } 48 | 49 | } 50 | 51 | //确认修改 52 | void EditProfile::on_btnOk_clicked() 53 | { 54 | user.username= ui->username->text(); 55 | user.phone= ui->phone->text(); 56 | user.qq= ui->qq->text(); 57 | UserDao::get_instance()->update(user); 58 | accept(); 59 | 60 | } 61 | 62 | //取消修改 63 | void EditProfile::on_btnCancel_clicked() 64 | { 65 | accept(); 66 | } 67 | -------------------------------------------------------------------------------- /editprofile.h: -------------------------------------------------------------------------------- 1 | #ifndef EDITPROFILE_H 2 | #define EDITPROFILE_H 3 | 4 | #include 5 | #include"userdao.h" 6 | #include"myhelper.h" 7 | #include"text.h" 8 | 9 | namespace Ui { 10 | class EditProfile; 11 | } 12 | 13 | class EditProfile : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit EditProfile(QWidget *parent = 0); 19 | ~EditProfile(); 20 | void init(); 21 | 22 | private slots: 23 | 24 | 25 | void on_btnOk_clicked(); 26 | 27 | void on_btnCancel_clicked(); 28 | 29 | private: 30 | Ui::EditProfile *ui; 31 | User user; 32 | }; 33 | 34 | #endif // EDITPROFILE_H 35 | -------------------------------------------------------------------------------- /frmconfig.cpp: -------------------------------------------------------------------------------- 1 | #include "frmconfig.h" 2 | #include "ui_frmconfig.h" 3 | 4 | /* 5 | * 设置页 6 | */ 7 | 8 | FrmConfig::FrmConfig(QWidget *parent) : 9 | QDialog(parent), 10 | ui(new Ui::FrmConfig) 11 | { 12 | ui->setupUi(this); 13 | this->InitStyle(); 14 | this->InitForm(); 15 | MyHelper::FormInCenter(this); 16 | } 17 | 18 | FrmConfig::~FrmConfig() 19 | { 20 | delete ui; 21 | } 22 | 23 | void FrmConfig::InitStyle() 24 | { 25 | this->setProperty("Form", true); 26 | this->setProperty("CanMove", true); 27 | this->setWindowTitle(ui->lab_Title->text()); 28 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 29 | IconHelper::Instance()->SetIcoMain(ui->lab_Ico); 30 | IconHelper::Instance()->SetIcoClose(ui->btnMenu_Close); 31 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 32 | } 33 | 34 | //选择皮肤 35 | void FrmConfig::InitForm() 36 | { 37 | QStringList qssName; 38 | qssName << "黑色" << "灰黑色" << "灰色" << "浅灰色" << "深灰色" << "银色" << "淡蓝色" << "蓝色"; 39 | ui->cboxAppStyle->addItems(qssName); 40 | if (App::AppStyle == ":/qss/black.css") { 41 | ui->cboxAppStyle->setCurrentIndex(0); 42 | } else if (App::AppStyle == ":/qss/brown.css") { 43 | ui->cboxAppStyle->setCurrentIndex(1); 44 | } else if (App::AppStyle == ":/qss/gray.css") { 45 | ui->cboxAppStyle->setCurrentIndex(2); 46 | } else if (App::AppStyle == ":/qss/lightgray.css") { 47 | ui->cboxAppStyle->setCurrentIndex(3); 48 | } else if (App::AppStyle == ":/qss/darkgray.css") { 49 | ui->cboxAppStyle->setCurrentIndex(4); 50 | } else if (App::AppStyle == ":/qss/silvery.css") { 51 | ui->cboxAppStyle->setCurrentIndex(5); 52 | } else if (App::AppStyle == ":/qss/blue.css") { 53 | ui->cboxAppStyle->setCurrentIndex(6); 54 | } else if (App::AppStyle == ":/qss/dev.css") { 55 | ui->cboxAppStyle->setCurrentIndex(7); 56 | } 57 | 58 | connect(ui->cboxAppStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(SaveConfig())); 59 | 60 | QList btns = ui->widget_left->findChildren(); 61 | foreach (QPushButton * btn, btns) { 62 | connect(btn, SIGNAL(clicked()), this, SLOT(button_clicked())); 63 | } 64 | 65 | } 66 | 67 | 68 | 69 | void FrmConfig::button_clicked() 70 | { 71 | QPushButton *btn = (QPushButton *)sender(); 72 | QString name = btn->text(); 73 | 74 | QList btns = ui->widget_left->findChildren(); 75 | foreach (QPushButton * b, btns) { 76 | b->setChecked(false); 77 | } 78 | btn->setChecked(true); 79 | 80 | } 81 | 82 | //确认保存皮肤 83 | void FrmConfig::SaveConfig() 84 | { 85 | QString style = ui->cboxAppStyle->currentText(); 86 | if (style == "黑色") { 87 | App::AppStyle = ":/qss/black.css"; 88 | } else if (style == "灰黑色") { 89 | App::AppStyle = ":/qss/brown.css"; 90 | } else if (style == "灰色") { 91 | App::AppStyle = ":/qss/gray.css"; 92 | } else if (style == "浅灰色") { 93 | App::AppStyle = ":/qss/lightgray.css"; 94 | } else if (style == "深灰色") { 95 | App::AppStyle = ":/qss/darkgray.css"; 96 | } else if (style == "银色") { 97 | App::AppStyle = ":/qss/silvery.css"; 98 | } else if (style == "淡蓝色") { 99 | App::AppStyle = ":/qss/blue.css"; 100 | } else if (style == "蓝色") { 101 | App::AppStyle = ":/qss/dev.css"; 102 | } 103 | 104 | App::WriteConfig(); 105 | MyHelper::SetStyle(App::AppStyle); 106 | } 107 | -------------------------------------------------------------------------------- /frmconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMCONFIG_H 2 | #define FRMCONFIG_H 3 | 4 | #include 5 | #include "myhelper.h" 6 | 7 | namespace Ui 8 | { 9 | class FrmConfig; 10 | } 11 | 12 | class FrmConfig : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit FrmConfig(QWidget *parent = 0); 18 | ~FrmConfig(); 19 | 20 | private slots: 21 | void SaveConfig(); 22 | 23 | void button_clicked(); 24 | 25 | private: 26 | Ui::FrmConfig *ui; 27 | 28 | void InitStyle(); //初始化无边框窗体 29 | void InitForm(); //初始化窗体数据 30 | }; 31 | 32 | #endif // FRMCONFIG_H 33 | -------------------------------------------------------------------------------- /frmconfig.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | FrmConfig 4 | 5 | 6 | 7 | 0 8 | 0 9 | 320 10 | 121 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 0 19 | 20 | 21 | 1 22 | 23 | 24 | 1 25 | 26 | 27 | 1 28 | 29 | 30 | 1 31 | 32 | 33 | 34 | 35 | 36 | 0 37 | 0 38 | 39 | 40 | 41 | 42 | 100 43 | 28 44 | 45 | 46 | 47 | 48 | 0 49 | 50 | 51 | 0 52 | 53 | 54 | 0 55 | 56 | 57 | 0 58 | 59 | 60 | 0 61 | 62 | 63 | 64 | 65 | 66 | 0 67 | 0 68 | 69 | 70 | 71 | 72 | 31 73 | 0 74 | 75 | 76 | 77 | 78 | 79 | 80 | Qt::AlignCenter 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 0 89 | 0 90 | 91 | 92 | 93 | 94 | 95 | 96 | 系统设置 97 | 98 | 99 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 0 108 | 0 109 | 110 | 111 | 112 | 113 | 0 114 | 115 | 116 | 0 117 | 118 | 119 | 0 120 | 121 | 122 | 0 123 | 124 | 125 | 0 126 | 127 | 128 | 129 | 130 | 131 | 0 132 | 0 133 | 134 | 135 | 136 | 137 | 40 138 | 0 139 | 140 | 141 | 142 | ArrowCursor 143 | 144 | 145 | Qt::NoFocus 146 | 147 | 148 | 关闭 149 | 150 | 151 | 152 | 153 | 154 | true 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 0 172 | 173 | 174 | 0 175 | 176 | 177 | 0 178 | 179 | 180 | 0 181 | 182 | 183 | 0 184 | 185 | 186 | 187 | 188 | 189 | 100 190 | 0 191 | 192 | 193 | 194 | 195 | 0 196 | 197 | 198 | 0 199 | 200 | 201 | 0 202 | 203 | 204 | 0 205 | 206 | 207 | 0 208 | 209 | 210 | 211 | 212 | 主题设置 213 | 214 | 215 | true 216 | 217 | 218 | true 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 0 227 | 0 228 | 229 | 230 | 231 | 232 | 120 233 | 0 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | btn1 248 | 249 | 250 | 251 | 252 | -------------------------------------------------------------------------------- /login.cpp: -------------------------------------------------------------------------------- 1 | #include"login.h" 2 | #include "ui_login.h" 3 | 4 | /** 5 | * 登录注册页 6 | */ 7 | 8 | Login::Login(QWidget *parent) : 9 | QDialog(parent), 10 | ui(new Ui::Login) 11 | { 12 | //初始化UI 13 | ui->setupUi(this); 14 | this->setProperty("Form", true); 15 | this->setProperty("CanMove", false); 16 | this->setWindowIcon(QIcon(":/image/icon")); 17 | this->setWindowTitle("云Doc信息管理系统"); 18 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 19 | ui->lab_Title->installEventFilter(this); 20 | IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d)); 21 | IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068)); 22 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 23 | connect(ui->btnMenu_Min, SIGNAL(clicked()), this, SLOT(showMinimized())); 24 | 25 | QRegExp regx("[1-9][0-9]+$"); 26 | QValidator *validator = new QRegExpValidator(regx, ui->lineEdit ); 27 | ui->lineEdit->setValidator(validator); 28 | 29 | } 30 | 31 | Login::~Login() 32 | { 33 | delete ui; 34 | } 35 | 36 | //登录函数 37 | bool Login::signin( ) 38 | { 39 | 40 | phone = ui->lineEdit->text(); 41 | passward=ui->lineEdit_2->text(); 42 | User user; 43 | user.phone=phone; 44 | user.passward=passward; 45 | bool flag =UserDao::get_instance()->signin(user); 46 | return flag; 47 | } 48 | 49 | //登录 50 | void Login::on_login_btn_clicked() 51 | { 52 | if(signin()) 53 | { 54 | accept(); 55 | } 56 | else 57 | { 58 | MyHelper::ShowMessageBoxInfo("用户名或密码错误"); 59 | } 60 | } 61 | 62 | //注册然后登录 63 | void Login::on_regiser_btn_clicked() 64 | { 65 | phone = ui->lineEdit->text(); 66 | passward=ui->lineEdit_2->text(); 67 | User user; 68 | user.phone=phone; 69 | user.passward=passward; 70 | 71 | bool flag =UserDao::get_instance()->signup(user); 72 | 73 | if(flag) { 74 | MyHelper::ShowMessageBoxInfo("欢迎使用"); 75 | signin(); 76 | accept(); 77 | } 78 | else 79 | { 80 | MyHelper::ShowMessageBoxInfo("用户已存在"); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /login.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGIN_H 2 | #define LOGIN_H 3 | 4 | #include 5 | #include"userdao.h" 6 | #include"myhelper.h" 7 | #include"text.h" 8 | #include"activitydao.h" 9 | 10 | namespace Ui { 11 | class Login; 12 | } 13 | 14 | class Login : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Login(QWidget *parent = 0); 20 | 21 | QString phone; 22 | QString passward; 23 | bool signin(); 24 | ~Login(); 25 | 26 | private slots: 27 | 28 | 29 | void on_login_btn_clicked(); 30 | 31 | void on_regiser_btn_clicked(); 32 | 33 | private: 34 | Ui::Login *ui; 35 | }; 36 | 37 | #endif // LOGIN_H 38 | -------------------------------------------------------------------------------- /login.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Login 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | true 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 350 26 | 250 27 | 191 28 | 41 29 | 30 | 31 | 32 | font: 14pt "微软雅黑"; 33 | 34 | 35 | 36 | 37 | 38 | 16 39 | 40 | 41 | 42 | 43 | 44 | 350 45 | 310 46 | 191 47 | 41 48 | 49 | 50 | 51 | font: 14pt "微软雅黑"; 52 | 53 | 54 | 55 | 56 | 57 | 16 58 | 59 | 60 | QLineEdit::Password 61 | 62 | 63 | 64 | 65 | 66 | 300 67 | 390 68 | 81 69 | 41 70 | 71 | 72 | 73 | font: 14pt "微软雅黑"; 74 | 75 | 76 | 登录 77 | 78 | 79 | 80 | 81 | 82 | 430 83 | 390 84 | 81 85 | 41 86 | 87 | 88 | 89 | font: 14pt "微软雅黑"; 90 | 91 | 92 | 注册 93 | 94 | 95 | 96 | 97 | 98 | 280 99 | 260 100 | 54 101 | 21 102 | 103 | 104 | 105 | font: 14pt "微软雅黑"; 106 | 107 | 108 | 账号 109 | 110 | 111 | 112 | 113 | 114 | 280 115 | 320 116 | 54 117 | 21 118 | 119 | 120 | 121 | font: 14pt "微软雅黑"; 122 | 123 | 124 | 密码 125 | 126 | 127 | 128 | 129 | 130 | 220 131 | 110 132 | 441 133 | 101 134 | 135 | 136 | 137 | font: 35pt "微软雅黑"; 138 | 139 | 140 | 云Doc信息管理系统 141 | 142 | 143 | 144 | 145 | 146 | 0 147 | 0 148 | 800 149 | 28 150 | 151 | 152 | 153 | 154 | 0 155 | 0 156 | 157 | 158 | 159 | 160 | 100 161 | 28 162 | 163 | 164 | 165 | 166 | 0 167 | 168 | 169 | 0 170 | 171 | 172 | 0 173 | 174 | 175 | 0 176 | 177 | 178 | 0 179 | 180 | 181 | 182 | 183 | 184 | 0 185 | 0 186 | 187 | 188 | 189 | 190 | 0 191 | 192 | 193 | 0 194 | 195 | 196 | 0 197 | 198 | 199 | 0 200 | 201 | 202 | 0 203 | 204 | 205 | 206 | 207 | 208 | 0 209 | 0 210 | 211 | 212 | 213 | font: 75 14pt "Aharoni"; 214 | font: 75 9pt "微软雅黑"; 215 | 216 | 217 | 218 | 219 | 220 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 0 229 | 0 230 | 231 | 232 | 233 | 234 | 40 235 | 0 236 | 237 | 238 | 239 | ArrowCursor 240 | 241 | 242 | Qt::NoFocus 243 | 244 | 245 | 最小化 246 | 247 | 248 | 249 | 250 | 251 | true 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 0 260 | 0 261 | 262 | 263 | 264 | 265 | 40 266 | 0 267 | 268 | 269 | 270 | ArrowCursor 271 | 272 | 273 | Qt::NoFocus 274 | 275 | 276 | 关闭 277 | 278 | 279 | 280 | 281 | 282 | true 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include"maindialog.h" 3 | #include"login.h" 4 | #include "app/appinit.h" 5 | #include"basedao.h" 6 | 7 | /* 8 | * 程序入口 9 | */ 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | QApplication a(argc, argv); 14 | 15 | //初始化APP 16 | AppInit *init = new AppInit; 17 | init->Load(); 18 | //直接进去登录页面 19 | //BaseDao::set_driver("QMYSQL"); 20 | Login w; 21 | 22 | if(w.exec()==QDialog::Accepted) 23 | { 24 | //登录成功进入主页面 25 | MainDialog mainwindow; 26 | return mainwindow.exec(); 27 | } 28 | 29 | return a.exec(); 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /maindialog.cpp: -------------------------------------------------------------------------------- 1 | #include "maindialog.h" 2 | #include "ui_maindialog.h" 3 | 4 | /** 5 | * 主页 6 | */ 7 | 8 | MainDialog::MainDialog(QWidget *parent) : 9 | QDialog(parent), 10 | ui(new Ui::MainDialog) 11 | { 12 | //初始化UI 13 | ui->setupUi(this); 14 | this->setProperty("Form", true); 15 | this->setProperty("CanMove", false); 16 | this->setWindowIcon(QIcon(":/image/icon")); 17 | this->setWindowTitle("云Doc信息管理系统"); 18 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 19 | ui->lab_Title->installEventFilter(this); 20 | IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d)); 21 | IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068)); 22 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 23 | connect(ui->btnMenu_Min, SIGNAL(clicked()), this, SLOT(showMinimized())); 24 | } 25 | 26 | MainDialog::~MainDialog() 27 | { 28 | delete ui; 29 | } 30 | 31 | //进入发起活动页 32 | void MainDialog::on_go_new_clicked() 33 | { 34 | User user=UserDao::get_currentUser(); 35 | if(user.phone==""||user.username==""||user.qq=="") 36 | { 37 | MyHelper::ShowMessageBoxInfo("信息不完整,无法发起活动"); 38 | return ; 39 | } 40 | NewActivity newac; 41 | newac.exec(); 42 | } 43 | 44 | //参与活动 45 | void MainDialog::on_join_activity_clicked() 46 | { 47 | bool ok; 48 | QString value; 49 | User user=UserDao::get_currentUser(); 50 | if(user.phone==""||user.username==""||user.qq=="") 51 | { 52 | MyHelper::ShowMessageBoxInfo("信息不完整,无法参加活动"); 53 | return ; 54 | } 55 | value = MyHelper::ShowInputBox("请输入活动邀请码:", ok); 56 | if (ok) { 57 | Activity activity= ActivityDao::get_instance()->query_by_code(value); 58 | if(activity.id==-1) 59 | { 60 | MyHelper::ShowMessageBoxInfo("邀请码无效"); 61 | return ; 62 | } 63 | bool flag= activity.userrelations.add_obj(UserDao::get_currentUser().id); 64 | if(!flag) 65 | { 66 | MyHelper::ShowMessageBoxInfo("已参与活动"); 67 | } 68 | else if(ActivityDao::get_instance()->update(activity)){ 69 | user.activityrelations.add_obj(activity.id); 70 | bool isOk= UserDao::get_instance()->update(user); 71 | if(isOk) 72 | { 73 | MyHelper::ShowMessageBoxInfo("成功参与活动,请前往我的活动查看"); 74 | } 75 | else 76 | { 77 | MyHelper::ShowMessageBoxInfo("邀请码无效"); 78 | } 79 | } 80 | } 81 | } 82 | 83 | //进入查看活动 84 | void MainDialog::on_go_look_clicked() 85 | { 86 | MyActivity myactivity; 87 | myactivity.exec(); 88 | } 89 | 90 | //进入个人资料页 91 | void MainDialog::on_go_person_clicked() 92 | { 93 | EditProfile edit; 94 | edit.exec(); 95 | } 96 | 97 | //进入设置页 98 | void MainDialog::on_go_set_clicked() 99 | { 100 | FrmConfig config; 101 | config.exec(); 102 | } 103 | -------------------------------------------------------------------------------- /maindialog.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINDIALOG_H 2 | #define MAINDIALOG_H 3 | 4 | #include 5 | #include"myhelper.h" 6 | #include"text.h" 7 | #include"activitydetail.h" 8 | #include"editprofile.h" 9 | #include"newactivity.h" 10 | #include"frmconfig.h" 11 | #include"myactivity.h" 12 | namespace Ui { 13 | class MainDialog; 14 | } 15 | 16 | class MainDialog : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit MainDialog(QWidget *parent = 0); 22 | ~MainDialog(); 23 | 24 | private slots: 25 | 26 | void on_go_new_clicked(); 27 | 28 | void on_join_activity_clicked(); 29 | 30 | void on_go_look_clicked(); 31 | 32 | void on_go_person_clicked(); 33 | 34 | void on_go_set_clicked(); 35 | 36 | private: 37 | Ui::MainDialog *ui; 38 | }; 39 | 40 | #endif // MAINDIALOG_H 41 | -------------------------------------------------------------------------------- /model/activity.cpp: -------------------------------------------------------------------------------- 1 | #include "activity.h" 2 | 3 | 4 | QString Activity::ID="id"; 5 | QString Activity::TITLE="title"; 6 | QString Activity::DATE="date"; 7 | QString Activity::ADDRESS="address"; 8 | QString Activity::MANAGERID="managerid"; 9 | QString Activity::USERRELATION="userrelation"; 10 | QString Activity::DETAIL="detail"; 11 | QString Activity::CODE="code"; 12 | QString Activity::BUDGET="budget"; 13 | QString Activity::PRIVACY="privacy"; 14 | QString Activity::STATE="state"; 15 | QString Activity::FORMAT="yyyy-MM-dd hh:mm"; 16 | 17 | /* 18 | * Activity model 活动模型 19 | */ 20 | 21 | Activity::Activity() 22 | { 23 | 24 | date=QDateTime::currentDateTime(); 25 | id=-1; 26 | title=""; 27 | privacy=0; 28 | state=0; 29 | 30 | } 31 | 32 | //得到新建sql语句 33 | QString Activity::get_sql() 34 | { 35 | return "( title,date,address,managerid,userrelation,detail,code,budget,privacy,state )" 36 | " values ( " 37 | + L::wd(title) +"'" +date.toString(FORMAT)+"',"+ L::wd(address)+ L::wd(managerid)+ 38 | L::wd(userrelations.get_sql())+ L::wd(detail)+L::wd(code)+ L::wd(budget)+L::wd(privacy)+L::w(state) 39 | + ")"; 40 | } 41 | 42 | //得到更新sql语句 43 | QString Activity::get_update_sql() 44 | { 45 | return 46 | "title = " + L::wd(title)+ 47 | "date = '" + date.toString(FORMAT)+"',"+ 48 | "address = " + L::wd(address) + 49 | "managerid = " +L::wd(managerid) + 50 | "detail = " + L::wd(detail) + 51 | "userrelation = " +L::wd(userrelations.get_sql()) + 52 | "code = " + L::wd(code) + 53 | "budget = "+L::wd(budget) + 54 | "privacy = " + L::wd(privacy) + 55 | "state = " +L::w(state) 56 | +" where id = " + L::wraper(id); 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /model/activity.h: -------------------------------------------------------------------------------- 1 | #ifndef ACTIVITY_H 2 | #define ACTIVITY_H 3 | 4 | #include"tool/text.h" 5 | #include"relation.h" 6 | #include 7 | class Activity 8 | { 9 | public: 10 | Activity(); 11 | long long int id; 12 | QString title; 13 | QDateTime date; 14 | QString address; 15 | long long int managerid; 16 | 17 | 18 | QString detail; 19 | QString code; 20 | int budget; 21 | int privacy; 22 | int state; 23 | 24 | 25 | Relation userrelations; 26 | 27 | QString get_sql(); 28 | QString get_update_sql(); 29 | 30 | static QString ID; 31 | static QString TITLE; 32 | static QString DATE; 33 | static QString ADDRESS; 34 | static QString MANAGERID; 35 | 36 | static QString USERRELATION; 37 | static QString DETAIL; 38 | static QString CODE; 39 | static QString BUDGET; 40 | static QString PRIVACY; 41 | static QString STATE; 42 | static QString FORMAT; 43 | 44 | }; 45 | 46 | #endif // ACTIVITY_H 47 | -------------------------------------------------------------------------------- /model/relation.cpp: -------------------------------------------------------------------------------- 1 | #include"relation.h" 2 | 3 | /* 4 | * Relation model 关系模型 管来User和Activity 5 | */ 6 | Relation::Relation() 7 | { 8 | sql=""; 9 | sql_to_list(); 10 | 11 | } 12 | 13 | Relation::Relation(QString sql) 14 | { 15 | this->sql=sql; 16 | sql_to_list(); 17 | } 18 | 19 | void Relation::set_sql(QString sql) 20 | { 21 | this->sql=sql; 22 | sql_to_list(); 23 | } 24 | 25 | void Relation::sql_to_list() 26 | { 27 | list.clear(); 28 | list=sql.split(" "); 29 | } 30 | 31 | QString Relation::list_to_sql() 32 | { 33 | sql=list.join(" "); 34 | return sql; 35 | } 36 | 37 | QString Relation::get_sql() 38 | { 39 | 40 | return list_to_sql(); 41 | } 42 | 43 | QList Relation::sql_to_ids(){ 44 | 45 | Relation::sql_to_list(); 46 | QListids; 47 | for(int i=0;i ids){ 57 | list.clear(); 58 | for(int i=0;i sql_to_ids(); 15 | 16 | QString objs_to_sql(QList ids); 17 | bool add_obj(int id); 18 | void set_sql(QString sql); 19 | 20 | protected : 21 | QString sql; 22 | QStringList list; 23 | 24 | }; 25 | #endif // RELATION 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /model/user.cpp: -------------------------------------------------------------------------------- 1 | #include "user.h" 2 | 3 | QString User::ID="id"; 4 | QString User::TYPE="type"; 5 | QString User::USERNAME="username"; 6 | QString User::PASSWARD="passward"; 7 | QString User::PHONE="phone"; 8 | 9 | QString User::QQ="qq"; 10 | QString User::SIGNATURE="signature"; 11 | QString User::ACTIVITYRELATION="activityrelation"; 12 | 13 | /* 14 | * User model 用模型 15 | */ 16 | User::User():type(0) 17 | { 18 | 19 | } 20 | 21 | //得到新建sql语句 22 | QString User::get_sql() 23 | { 24 | return "(username,passward,phone,qq,signature,type,activityrelation) " 25 | "values ( '" + username +"','"+ passward+"','"+ phone+"','"+ qq+"','"+signature+"',"+L::wd(type)+L::w(activityrelations.get_sql())+")"; 26 | } 27 | 28 | //得到更新sql语句 29 | QString User::get_update_sql() 30 | { 31 | 32 | return "username = "+L::wraper(username)+ 33 | ",passward = "+L::wraper(passward)+ 34 | ",phone = "+L::wraper(phone)+ 35 | ",qq = "+L::wraper(qq)+ 36 | ",signature = "+L::wraper(signature) + 37 | ",type = "+L::wraper(type)+ 38 | ",activityrelation = "+ L::w(activityrelations.get_sql())+"where id = "+ L::wraper(id) ; 39 | } 40 | 41 | //是否为管理员 42 | bool User::is_manager() 43 | { 44 | return type==MANAGER; 45 | } 46 | 47 | //设置管理员 48 | void User::set_manager(bool is_manager) 49 | { 50 | if(is_manager) 51 | { 52 | type=MANAGER; 53 | } 54 | else 55 | { 56 | type=DEFAULT; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /model/user.h: -------------------------------------------------------------------------------- 1 | #ifndef USER_H 2 | #define USER_H 3 | #include"text.h" 4 | #include"relation.h" 5 | 6 | class User 7 | { 8 | 9 | public: 10 | static const int DEFAULT=0; 11 | static const int MANAGER=1; 12 | User(); 13 | QString get_sql(); 14 | QString get_update_sql(); 15 | bool is_manager(); 16 | void set_manager(bool is_manager); 17 | 18 | 19 | QString username; 20 | QString passward; 21 | QString phone; 22 | QString qq; 23 | QString signature; 24 | 25 | long long int id; 26 | int type; 27 | 28 | Relation activityrelations; 29 | 30 | 31 | static QString ID; 32 | static QString TYPE; 33 | static QString USERNAME; 34 | static QString PASSWARD; 35 | static QString PHONE; 36 | 37 | static QString QQ; 38 | static QString SIGNATURE; 39 | static QString ACTIVITYRELATION; 40 | 41 | }; 42 | 43 | #endif // USER_H 44 | -------------------------------------------------------------------------------- /myactivity.cpp: -------------------------------------------------------------------------------- 1 | #include "myactivity.h" 2 | #include "ui_myactivity.h" 3 | 4 | /* 5 | *我的活动页 6 | */ 7 | 8 | MyActivity::MyActivity(QWidget *parent) : 9 | QDialog(parent), 10 | ui(new Ui::MyActivity) 11 | { 12 | //初始化UI 13 | ui->setupUi(this); 14 | this->setProperty("Form", true); 15 | this->setProperty("CanMove", false); 16 | this->setWindowIcon(QIcon(":/image/icon")); 17 | this->setWindowTitle("云Doc信息管理系统"); 18 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 19 | ui->lab_Title->installEventFilter(this); 20 | IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d)); 21 | IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068)); 22 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 23 | connect(ui->btnMenu_Min, SIGNAL(clicked()), this, SLOT(showMinimized())); 24 | 25 | QStringList headers; 26 | headers << "主题" << "时间"<<"地点"; 27 | ui->my_activity_tab->setHeaderLabels(headers); 28 | ui->manager_activity_tab->setHeaderLabels(headers); 29 | init_my_activity(); 30 | init_manager_activity(); 31 | 32 | } 33 | 34 | //初始化我参与的活动 35 | void MyActivity::init_my_activity() 36 | { 37 | 38 | User user=UserDao::get_currentUser(); 39 | QList rootList; 40 | activities=ActivityDao::get_instance()->query_by_relation(user.activityrelations); 41 | 42 | 43 | for(int i =0;imy_activity_tab, rootTextList); 48 | rootList << root; 49 | } 50 | ui->my_activity_tab->setColumnWidth(0,200); 51 | ui->my_activity_tab->setColumnWidth(1,200); 52 | ui->my_activity_tab->insertTopLevelItems(0, rootList); 53 | ui->my_activity_tab->show(); 54 | 55 | 56 | } 57 | //初始化我管理的活动 58 | void MyActivity::init_manager_activity() 59 | { 60 | User user=UserDao::get_currentUser(); 61 | 62 | QList rootmList; 63 | manageractivities=ActivityDao::get_instance()->query_by_managerid(user.id); 64 | 65 | for(int i =0;imanager_activity_tab, rootTextList); 70 | rootmList << root; 71 | } 72 | ui->manager_activity_tab->setColumnWidth(0,200); 73 | ui->manager_activity_tab->setColumnWidth(1,200); 74 | ui->manager_activity_tab->insertTopLevelItems(0, rootmList); 75 | ui->manager_activity_tab->show(); 76 | } 77 | 78 | MyActivity::~MyActivity() 79 | { 80 | delete ui; 81 | } 82 | 83 | //参与的活动点击查看详情 84 | void MyActivity::on_my_activity_tab_clicked(const QModelIndex &index) 85 | { 86 | ActivityDetail detail; 87 | detail.init(activities.at(index.row()).id); 88 | detail.exec(); 89 | } 90 | 91 | //管理的活动点击查看详情 92 | void MyActivity::on_manager_activity_tab_clicked(const QModelIndex &index) 93 | { 94 | 95 | ActivityDetail detail; 96 | detail.init(manageractivities.at(index.row()).id); 97 | detail.exec(); 98 | } 99 | -------------------------------------------------------------------------------- /myactivity.h: -------------------------------------------------------------------------------- 1 | #ifndef MYACTIVITY_H 2 | #define MYACTIVITY_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include"userdao.h" 9 | #include"activitydao.h" 10 | #include"iconhelper.h" 11 | #include"activitydetail.h" 12 | 13 | namespace Ui { 14 | class MyActivity; 15 | } 16 | 17 | class MyActivity : public QDialog 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit MyActivity(QWidget *parent = 0); 23 | ~MyActivity(); 24 | void init_my_activity(); 25 | void init_manager_activity(); 26 | private slots: 27 | 28 | void on_my_activity_tab_clicked(const QModelIndex &index); 29 | 30 | void on_manager_activity_tab_clicked(const QModelIndex &index); 31 | 32 | private: 33 | QList activities; 34 | QList manageractivities; 35 | Activity click_activity; 36 | Ui::MyActivity *ui; 37 | }; 38 | 39 | #endif // MYACTIVITY_H 40 | -------------------------------------------------------------------------------- /myactivity.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MyActivity 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 330 20 | 40 21 | 241 22 | 41 23 | 24 | 25 | 26 | 27 | color: rgb(0, 0, 0); 28 | font: 26pt "Adobe 仿宋 Std R"; 29 | 30 | 31 | 我的活动 32 | 33 | 34 | 35 | 36 | 37 | 10 38 | 90 39 | 800 40 | 600 41 | 42 | 43 | 44 | 45 | 微软雅黑 46 | 14 47 | 48 | 49 | 50 | font: 14pt "微软雅黑"; 51 | 52 | 53 | 1 54 | 55 | 56 | 57 | 16 58 | 15 59 | 60 | 61 | 62 | 63 | 参加的活动 64 | 65 | 66 | 67 | 68 | 69 | 70 | 1 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 管理的活动 80 | 81 | 82 | 83 | 84 | 85 | 86 | 1 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 0 98 | 0 99 | 800 100 | 28 101 | 102 | 103 | 104 | 105 | 0 106 | 0 107 | 108 | 109 | 110 | 111 | 100 112 | 28 113 | 114 | 115 | 116 | 117 | 0 118 | 119 | 120 | 0 121 | 122 | 123 | 0 124 | 125 | 126 | 0 127 | 128 | 129 | 0 130 | 131 | 132 | 133 | 134 | 135 | 0 136 | 0 137 | 138 | 139 | 140 | 141 | 0 142 | 143 | 144 | 0 145 | 146 | 147 | 0 148 | 149 | 150 | 0 151 | 152 | 153 | 0 154 | 155 | 156 | 157 | 158 | 159 | 0 160 | 0 161 | 162 | 163 | 164 | font: 75 14pt "Aharoni"; 165 | font: 75 9pt "微软雅黑"; 166 | 167 | 168 | 169 | 170 | 171 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 0 180 | 0 181 | 182 | 183 | 184 | 185 | 40 186 | 0 187 | 188 | 189 | 190 | ArrowCursor 191 | 192 | 193 | Qt::NoFocus 194 | 195 | 196 | 最小化 197 | 198 | 199 | 200 | 201 | 202 | true 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 0 211 | 0 212 | 213 | 214 | 215 | 216 | 40 217 | 0 218 | 219 | 220 | 221 | ArrowCursor 222 | 223 | 224 | Qt::NoFocus 225 | 226 | 227 | 关闭 228 | 229 | 230 | 231 | 232 | 233 | true 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | -------------------------------------------------------------------------------- /newactivity.cpp: -------------------------------------------------------------------------------- 1 | #include "newactivity.h" 2 | #include "ui_newactivity.h" 3 | 4 | const int SIZE_CHAR = 15; 5 | const char CCH[] = "_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_"; 6 | 7 | /* 8 | * 发起活动页 9 | */ 10 | 11 | NewActivity::NewActivity(QWidget *parent) : 12 | QDialog(parent), 13 | ui(new Ui::NewActivity) 14 | { 15 | 16 | //初始化UI 17 | ui->setupUi(this); 18 | this->setProperty("Form", true); 19 | this->setProperty("CanMove", false); 20 | this->setWindowIcon(QIcon(":/image/icon")); 21 | this->setWindowTitle("云Doc信息管理系统"); 22 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 23 | ui->lab_Title->installEventFilter(this); 24 | IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d)); 25 | IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068)); 26 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 27 | connect(ui->btnMenu_Min, SIGNAL(clicked()), this, SLOT(showMinimized())); 28 | 29 | is_update=false; 30 | 31 | } 32 | 33 | NewActivity::~NewActivity() 34 | { 35 | delete ui; 36 | } 37 | 38 | //是否修改 39 | void NewActivity::set_update(bool isUpdate,int id) 40 | { 41 | is_update=isUpdate; 42 | init(id); 43 | 44 | } 45 | 46 | //初始化活动详情 47 | void NewActivity::init(int id) 48 | { 49 | activity=ActivityDao::get_instance()->query_by_id(id); 50 | ui->title->setText(activity.title); 51 | ui->date->setDateTime(activity.date); 52 | ui->address->setText(activity.address); 53 | ui->budget->setText(L::w(activity.budget)); 54 | ui->detail->setText(activity.detail); 55 | } 56 | 57 | //确认发起活动 58 | void NewActivity::on_btnOk_clicked() 59 | { 60 | activity.title=ui->title->text(); 61 | activity.date=ui->date->dateTime(); 62 | activity.address=ui->address->text(); 63 | activity.budget=ui->budget->text().toInt(); 64 | activity.detail=ui->detail->toPlainText(); 65 | 66 | if(activity.title=="") 67 | { 68 | MyHelper::ShowMessageBoxInfo("主题不能为空"); 69 | return ; 70 | } 71 | 72 | if(activity.address=="") 73 | { 74 | MyHelper::ShowMessageBoxInfo("地点不能为空"); 75 | return ; 76 | } 77 | 78 | if(!is_update){ 79 | activity.managerid=UserDao::get_currentUser().id; 80 | activity.userrelations.add_obj(UserDao::get_currentUser().id); 81 | activity.code=code_generate(); 82 | 83 | if(ActivityDao::get_instance()->save(activity)) 84 | { 85 | int id=ActivityDao::get_instance()->query_by_code(activity.code).id; 86 | User user=UserDao::get_currentUser(); 87 | user.activityrelations.add_obj(id); 88 | UserDao::get_instance()->update(user); 89 | MyHelper::ShowMessageBoxInfo("发起活动成功"); 90 | accept(); 91 | } 92 | else 93 | { 94 | MyHelper::ShowMessageBoxInfo("发起活动失败"); 95 | 96 | } 97 | } 98 | else 99 | { 100 | if(ActivityDao::get_instance()->update(activity)) 101 | { 102 | MyHelper::ShowMessageBoxInfo("更新活动成功"); 103 | accept(); 104 | } 105 | else 106 | { 107 | MyHelper::ShowMessageBoxInfo("更新活动失败"); 108 | 109 | } 110 | } 111 | 112 | } 113 | 114 | //取消 115 | void NewActivity::on_btnCancel_clicked() 116 | { 117 | accept(); 118 | } 119 | 120 | //邀请码生成 121 | QString NewActivity::code_generate() 122 | { 123 | srand((unsigned)time(NULL)); 124 | char ch[SIZE_CHAR + 1] = {0}; 125 | for (int i = 0; i < SIZE_CHAR; ++i) 126 | { 127 | int x = rand() / (RAND_MAX / (sizeof(CCH) - 1)); 128 | ch[i] = CCH[x]; 129 | } 130 | return QString(ch); 131 | } 132 | -------------------------------------------------------------------------------- /newactivity.h: -------------------------------------------------------------------------------- 1 | #ifndef NEWACTIVITY_H 2 | #define NEWACTIVITY_H 3 | #include 4 | #include 5 | #include"activitydao.h" 6 | #include"userdao.h" 7 | #include"myhelper.h" 8 | #include"text.h" 9 | 10 | namespace Ui { 11 | class NewActivity; 12 | } 13 | 14 | class NewActivity : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit NewActivity(QWidget *parent = 0); 20 | ~NewActivity(); 21 | QString code_generate(); 22 | void set_update(bool isUpdate,int id); 23 | 24 | private slots: 25 | 26 | 27 | void on_btnOk_clicked(); 28 | void init(int id); 29 | 30 | void on_btnCancel_clicked(); 31 | 32 | private: 33 | bool is_update; 34 | 35 | Activity activity; 36 | Ui::NewActivity *ui; 37 | }; 38 | 39 | #endif // NEWACTIVITY_H 40 | -------------------------------------------------------------------------------- /other/image/Font Awesome Cheatsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/Font Awesome Cheatsheet.png -------------------------------------------------------------------------------- /other/image/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/add.png -------------------------------------------------------------------------------- /other/image/add_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/add_2.png -------------------------------------------------------------------------------- /other/image/add_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/add_bottom.png -------------------------------------------------------------------------------- /other/image/add_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/add_left.png -------------------------------------------------------------------------------- /other/image/add_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/add_right.png -------------------------------------------------------------------------------- /other/image/add_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/add_top.png -------------------------------------------------------------------------------- /other/image/bg_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/bg_main.png -------------------------------------------------------------------------------- /other/image/btn_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/btn_close.png -------------------------------------------------------------------------------- /other/image/btn_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/btn_ok.png -------------------------------------------------------------------------------- /other/image/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/checkbox_checked.png -------------------------------------------------------------------------------- /other/image/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/checkbox_unchecked.png -------------------------------------------------------------------------------- /other/image/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /other/image/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/icon.png -------------------------------------------------------------------------------- /other/image/join.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/join.png -------------------------------------------------------------------------------- /other/image/join_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/join_2.png -------------------------------------------------------------------------------- /other/image/look.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/look.png -------------------------------------------------------------------------------- /other/image/look_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/look_2.png -------------------------------------------------------------------------------- /other/image/msg_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/msg_error.png -------------------------------------------------------------------------------- /other/image/msg_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/msg_info.png -------------------------------------------------------------------------------- /other/image/msg_question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/msg_question.png -------------------------------------------------------------------------------- /other/image/profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/profile.png -------------------------------------------------------------------------------- /other/image/qt_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/qt_zh_CN.qm -------------------------------------------------------------------------------- /other/image/radio_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/radio_normal.png -------------------------------------------------------------------------------- /other/image/radio_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/radio_selected.png -------------------------------------------------------------------------------- /other/image/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/setting.png -------------------------------------------------------------------------------- /other/image/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/image/title.png -------------------------------------------------------------------------------- /other/main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/other/main.ico -------------------------------------------------------------------------------- /other/main.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON "main.ico" -------------------------------------------------------------------------------- /other/qss/black.css: -------------------------------------------------------------------------------- 1 | QPalette{background:#F0F0F0;}QGroupBox#gboxDevicePanel>QLabel{color:#CACAD0;} 2 | 3 | QWidget#frmMain,QWidget[Form="true"]{ 4 | border:1px solid #575757; 5 | border-radius:0px; 6 | } 7 | 8 | .QFrame{ 9 | border:1px solid #D8D8D8; 10 | border-radius:5px; 11 | } 12 | 13 | QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QGroupBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox,QTreeView,QListView,QTableView,QTabWidget::pane{ 14 | color:#232524; 15 | } 16 | 17 | QWidget#widget_title,QWidget#widget_left{ 18 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 19 | } 20 | 21 | QLabel#lab_Ico,QLabel#lab_Title{ 22 | border-radius:0px; 23 | color:#CACAD0; 24 | background-color:rgba(0,0,0,0); 25 | border-style:none; 26 | } 27 | 28 | QWidget#widget_top>QToolButton::menu-indicator{ 29 | image:None; 30 | } 31 | 32 | QWidget#widget_top>QToolButton{ 33 | border-style:none; 34 | padding:10px; 35 | color:#CACAD0; 36 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 37 | } 38 | 39 | QWidget#widget_top>QToolButton:hover,QWidget#widget_top>QToolButton:checked{ 40 | border-style:solid; 41 | border-bottom-width:2px; 42 | border-bottom-color:rgba(238,0,0,128); 43 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #636363,stop:1 #575757); 44 | } 45 | 46 | QLabel[labVideo="true"]{ 47 | color:#CACAD0; 48 | border:1px solid #575757; 49 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 50 | } 51 | 52 | QLabel[labVideo="true"]:focus{ 53 | border:1px solid #FF0000; 54 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #636363,stop:1 #575757); 55 | } 56 | 57 | QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox{ 58 | border:1px solid #D8D8D8; 59 | border-radius:5px; 60 | padding:2px; 61 | background:none; 62 | selection-background-color:#4D4D4D; 63 | selection-color:#CACAD0; 64 | } 65 | 66 | QLineEdit[echoMode="2"]{ 67 | lineedit-password-character:9679; 68 | } 69 | 70 | .QGroupBox{ 71 | border:1px solid #D8D8D8; 72 | border-radius:5px; 73 | } 74 | 75 | .QPushButton{ 76 | border-style:none; 77 | border:1px solid #D8D8D8; 78 | color:#CACAD0; 79 | padding:5px; 80 | min-height:20px; 81 | border-radius:5px; 82 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 83 | } 84 | 85 | .QPushButton:hover{ 86 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #636363,stop:1 #575757); 87 | } 88 | 89 | .QPushButton:pressed{ 90 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 91 | } 92 | 93 | .QPushButton:disabled{ 94 | color:#838383; 95 | background:#F4F4F4; 96 | } 97 | 98 | QPushButton#btnSplitterH{ 99 | padding:2px; 100 | min-height:8px; 101 | } 102 | 103 | QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close,QPushButton#btnSplitterV,QPushButton#btnSplitterH{ 104 | border-radius:0px; 105 | color:#CACAD0; 106 | background-color:rgba(0,0,0,0); 107 | border-style:none; 108 | } 109 | 110 | QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover,QPushButton#btnSplitterV:hover,QPushButton#btnSplitterH:hover{ 111 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,134,199,0),stop:1 #636363); 112 | } 113 | 114 | QPushButton#btnMenu_Close:hover{ 115 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(238,0,0,128),stop:1 rgba(238,44,44,255)); 116 | } 117 | 118 | QWidget#widget_left>QPushButton{ 119 | border-radius:0px; 120 | color:#CACAD0; 121 | background-color:rgba(0,0,0,0); 122 | border-style:none; 123 | } 124 | 125 | QWidget#widget_left>QPushButton:hover{ 126 | background-color:rgba(238,0,0,128); 127 | } 128 | 129 | QWidget#widget_left>QPushButton:pressed,QWidget#widget_left>QPushButton:checked{ 130 | color:#000000; 131 | background-color:rgba(250,255,255,255); 132 | } 133 | 134 | QCheckBox{ 135 | color:#232524; 136 | spacing:2px; 137 | } 138 | 139 | QCheckBox::indicator{ 140 | width:20px; 141 | height:20px; 142 | } 143 | 144 | QCheckBox::indicator:unchecked{ 145 | image:url(:/image/checkbox_unchecked.png); 146 | } 147 | 148 | QCheckBox::indicator:checked{ 149 | image:url(:/image/checkbox_checked.png); 150 | } 151 | 152 | QRadioButton{ 153 | color:#232524; 154 | spacing:2px; 155 | } 156 | 157 | QRadioButton::indicator{ 158 | width:15px; 159 | height:15px; 160 | } 161 | 162 | QRadioButton::indicator::unchecked{ 163 | image:url(:/image/radio_normal.png); 164 | } 165 | 166 | QRadioButton::indicator::checked{ 167 | image:url(:/image/radio_selected.png); 168 | } 169 | 170 | QSpinBox::up-button,QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button{ 171 | image:url(:/image/add_top.png); 172 | } 173 | 174 | QSpinBox::down-button,QDateEdit::down-button,QTimeEdit::down-button,QDateTimeEdit::down-button{ 175 | image:url(:/image/add_bottom.png); 176 | } 177 | 178 | QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox{ 179 | border-radius:3px; 180 | padding:3px 5px 3px 5px; 181 | border:1px solid #D8D8D8; 182 | background:none; 183 | selection-background-color:#4D4D4D; 184 | selection-color:#CACAD0; 185 | } 186 | 187 | QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ 188 | subcontrol-origin:padding; 189 | subcontrol-position:top right; 190 | width:15px; 191 | border-left-width:1px; 192 | border-left-style:solid; 193 | border-top-right-radius:3px; 194 | border-bottom-right-radius:3px; 195 | border-left-color:#D8D8D8; 196 | } 197 | 198 | QComboBox::down-arrow,QDateEdit::down-arrow,QTimeEdit::down-arrow,QDateTimeEdit::down-arrow{ 199 | image:url(:/image/add_bottom.png); 200 | } 201 | 202 | QMenu{ 203 | color:#CACAD0; 204 | background-color:#4D4D4D; 205 | margin:2px; 206 | } 207 | 208 | QMenu::item{ 209 | padding:3px 20px 3px 20px; 210 | } 211 | 212 | QMenu::indicator{ 213 | width:13px; 214 | height:13px; 215 | } 216 | 217 | QMenu::item:selected{ 218 | color:#CACAD0; 219 | border:0px solid #575757; 220 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 221 | } 222 | 223 | QMenu::separator{ 224 | height:1px; 225 | background:#575757; 226 | } 227 | 228 | QProgressBar{ 229 | background:#D8D8D8; 230 | border-radius:5px; 231 | text-align:center; 232 | border:1px solid #D8D8D8; 233 | } 234 | 235 | QProgressBar::chunk{ 236 | width:5px; 237 | margin:0.5px; 238 | background-color:#4D4D4D; 239 | } 240 | 241 | QSlider::groove:horizontal,QSlider::add-page:horizontal{ 242 | height:8px; 243 | border-radius:3px; 244 | background:#D8D8D8; 245 | } 246 | 247 | QSlider::sub-page:horizontal{ 248 | height:8px; 249 | border-radius:3px; 250 | background:#575757; 251 | } 252 | 253 | QSlider::handle:horizontal{ 254 | width:13px; 255 | margin-top:-3px; 256 | margin-bottom:-3px; 257 | border-radius:6px; 258 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FFFFFF,stop:0.8 #575757); 259 | } 260 | 261 | QSlider::groove:vertical,QSlider::sub-page:vertical{ 262 | width:8px; 263 | border-radius:3px; 264 | background:#D8D8D8; 265 | } 266 | 267 | QSlider::add-page:vertical{ 268 | width:8px; 269 | border-radius:3px; 270 | background:#575757; 271 | } 272 | 273 | QSlider::handle:vertical{ 274 | height:13px; 275 | margin-left:-2px; 276 | margin-right:-3px; 277 | border-radius:6px; 278 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FFFFFF,stop:0.8 #575757); 279 | } 280 | 281 | QScrollBar:vertical{ 282 | width:10px; 283 | background-color:rgba(0,0,0,0%); 284 | padding-top:10px; 285 | padding-bottom:10px; 286 | } 287 | 288 | QScrollBar:horizontal{ 289 | height:10px; 290 | background-color:rgba(0,0,0,0%); 291 | padding-left:10px; 292 | padding-right:10px; 293 | } 294 | 295 | QScrollBar::handle:vertical,QScrollBar::handle:horizontal{ 296 | width:10px; 297 | background:#575757; 298 | } 299 | 300 | QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover{ 301 | width:10px; 302 | background:#292929; 303 | } 304 | 305 | QScrollBar::add-line:vertical{ 306 | height:10px; 307 | width:10px; 308 | subcontrol-position:bottom; 309 | subcontrol-origin:margin; 310 | border-border-image:url(:/image/add_bottom.png); 311 | } 312 | 313 | QScrollBar::add-line:horizontal{ 314 | height:10px; 315 | width:10px; 316 | subcontrol-position:right; 317 | subcontrol-origin:margin; 318 | border-image:url(:/image/add_right.png); 319 | } 320 | 321 | QScrollBar::sub-line:vertical{ 322 | height:10px; 323 | width:10px; 324 | subcontrol-position:top; 325 | subcontrol-origin:margin; 326 | border-image:url(:/image/add_top.png); 327 | } 328 | 329 | QScrollBar::sub-line:horizontal{ 330 | height:10px; 331 | width:10px; 332 | subcontrol-position:left; 333 | subcontrol-origin:margin; 334 | border-image:url(:/image/add_left.png); 335 | } 336 | 337 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical,QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal{ 338 | width:10px; 339 | background:#D8D8D8; 340 | } 341 | 342 | QScrollArea{ 343 | border:0px; 344 | } 345 | 346 | QTreeView,QListView,QTableView,QTabWidget::pane{ 347 | border:1px solid #D8D8D8; 348 | selection-background-color:#636363; 349 | selection-color:#232524; 350 | alternate-background-color:#DDE0E7; 351 | } 352 | 353 | QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ 354 | color:#CACAD0; 355 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 356 | } 357 | 358 | QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ 359 | color:#CACAD0; 360 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #636363,stop:1 #575757); 361 | } 362 | 363 | QTableView::item,QListView::item,QTreeView::item{ 364 | padding:5px; 365 | margin:0px; 366 | } 367 | 368 | QHeaderView::section,QTableCornerButton:section{ 369 | padding:3px; 370 | margin:0px; 371 | color:#CACAD0; 372 | border:1px solid #575757; 373 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #636363,stop:1 #575757); 374 | } 375 | 376 | QTabBar::tab{ 377 | border-radius:5px; 378 | border:1px solid #D8D8D8; 379 | color:#CACAD0; 380 | min-width:55px; 381 | min-height:20px; 382 | padding:3px 8px 3px 8px; 383 | margin:1px; 384 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #636363,stop:1 #575757); 385 | } 386 | 387 | QTabBar::tab:selected,QTabBar::tab:hover{ 388 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 389 | } 390 | 391 | QStatusBar::item{ 392 | border:0px solid #4D4D4D; 393 | border-radius:3px; 394 | } 395 | 396 | QToolBox::tab,QToolTip,QGroupBox#gboxDevicePanel{ 397 | padding:3px; 398 | border-radius: 5px; 399 | color:#CACAD0; 400 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #4D4D4D,stop:1 #292929); 401 | } 402 | 403 | QToolBox::tab:selected{ 404 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #636363,stop:1 #575757); 405 | } 406 | -------------------------------------------------------------------------------- /other/qss/blue.css: -------------------------------------------------------------------------------- 1 | QPalette{background:#EAF7FF;}QGroupBox#gboxDevicePanel>QLabel{color:#386487;} 2 | 3 | QWidget#frmMain,QWidget[Form="true"]{ 4 | border:1px solid #C0DCF2; 5 | border-radius:0px; 6 | } 7 | 8 | .QFrame{ 9 | border:1px solid #C0DCF2; 10 | border-radius:5px; 11 | } 12 | 13 | QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QGroupBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox,QTreeView,QListView,QTableView,QTabWidget::pane{ 14 | color:#386487; 15 | } 16 | 17 | QWidget#widget_title,QWidget#widget_left{ 18 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 19 | } 20 | 21 | QLabel#lab_Ico,QLabel#lab_Title{ 22 | border-radius:0px; 23 | color:#386487; 24 | background-color:rgba(0,0,0,0); 25 | border-style:none; 26 | } 27 | 28 | QWidget#widget_top>QToolButton::menu-indicator{ 29 | image:None; 30 | } 31 | 32 | QWidget#widget_top>QToolButton{ 33 | border-style:none; 34 | padding:10px; 35 | color:#386487; 36 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 37 | } 38 | 39 | QWidget#widget_top>QToolButton:hover,QWidget#widget_top>QToolButton:checked{ 40 | border-style:solid; 41 | border-bottom-width:2px; 42 | border-bottom-color:rgba(238,0,0,128); 43 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); 44 | } 45 | 46 | QLabel[labVideo="true"]{ 47 | color:#386487; 48 | border:1px solid #C0DCF2; 49 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 50 | } 51 | 52 | QLabel[labVideo="true"]:focus{ 53 | border:1px solid #FF0000; 54 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); 55 | } 56 | 57 | QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox{ 58 | border:1px solid #C0DCF2; 59 | border-radius:5px; 60 | padding:2px; 61 | background:none; 62 | selection-background-color:#DEF0FE; 63 | selection-color:#386487; 64 | } 65 | 66 | QLineEdit[echoMode="2"]{ 67 | lineedit-password-character:9679; 68 | } 69 | 70 | .QGroupBox{ 71 | border:1px solid #C0DCF2; 72 | border-radius:5px; 73 | } 74 | 75 | .QPushButton{ 76 | border-style:none; 77 | border:1px solid #C0DCF2; 78 | color:#386487; 79 | padding:5px; 80 | min-height:20px; 81 | border-radius:5px; 82 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 83 | } 84 | 85 | .QPushButton:hover{ 86 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); 87 | } 88 | 89 | .QPushButton:pressed{ 90 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 91 | } 92 | 93 | .QPushButton:disabled{ 94 | color:#838383; 95 | background:#F4F4F4; 96 | } 97 | 98 | QPushButton#btnSplitterH{ 99 | padding:2px; 100 | min-height:8px; 101 | } 102 | 103 | QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close,QPushButton#btnSplitterV,QPushButton#btnSplitterH{ 104 | border-radius:0px; 105 | color:#386487; 106 | background-color:rgba(0,0,0,0); 107 | border-style:none; 108 | } 109 | 110 | QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover,QPushButton#btnSplitterV:hover,QPushButton#btnSplitterH:hover{ 111 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,134,199,0),stop:1 #F2F9FF); 112 | } 113 | 114 | QPushButton#btnMenu_Close:hover{ 115 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(238,0,0,128),stop:1 rgba(238,44,44,255)); 116 | } 117 | 118 | QWidget#widget_left>QPushButton{ 119 | border-radius:0px; 120 | color:#386487; 121 | background-color:rgba(0,0,0,0); 122 | border-style:none; 123 | } 124 | 125 | QWidget#widget_left>QPushButton:hover{ 126 | background-color:rgba(238,0,0,128); 127 | } 128 | 129 | QWidget#widget_left>QPushButton:pressed,QWidget#widget_left>QPushButton:checked{ 130 | color:#000000; 131 | background-color:rgba(250,255,255,255); 132 | } 133 | 134 | QCheckBox{ 135 | color:#386487; 136 | spacing:2px; 137 | } 138 | 139 | QCheckBox::indicator{ 140 | width:20px; 141 | height:20px; 142 | } 143 | 144 | QCheckBox::indicator:unchecked{ 145 | image:url(:/image/checkbox_unchecked.png); 146 | } 147 | 148 | QCheckBox::indicator:checked{ 149 | image:url(:/image/checkbox_checked.png); 150 | } 151 | 152 | QRadioButton{ 153 | color:#386487; 154 | spacing:2px; 155 | } 156 | 157 | QRadioButton::indicator{ 158 | width:15px; 159 | height:15px; 160 | } 161 | 162 | QRadioButton::indicator::unchecked{ 163 | image:url(:/image/radio_normal.png); 164 | } 165 | 166 | QRadioButton::indicator::checked{ 167 | image:url(:/image/radio_selected.png); 168 | } 169 | 170 | QSpinBox::up-button,QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button{ 171 | image:url(:/image/add_top.png); 172 | } 173 | 174 | QSpinBox::down-button,QDateEdit::down-button,QTimeEdit::down-button,QDateTimeEdit::down-button{ 175 | image:url(:/image/add_bottom.png); 176 | } 177 | 178 | QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox{ 179 | border-radius:3px; 180 | padding:3px 5px 3px 5px; 181 | border:1px solid #C0DCF2; 182 | background:none; 183 | selection-background-color:#DEF0FE; 184 | selection-color:#386487; 185 | } 186 | 187 | QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ 188 | subcontrol-origin:padding; 189 | subcontrol-position:top right; 190 | width:15px; 191 | border-left-width:1px; 192 | border-left-style:solid; 193 | border-top-right-radius:3px; 194 | border-bottom-right-radius:3px; 195 | border-left-color:#C0DCF2; 196 | } 197 | 198 | QComboBox::down-arrow,QDateEdit::down-arrow,QTimeEdit::down-arrow,QDateTimeEdit::down-arrow{ 199 | image:url(:/image/add_bottom.png); 200 | } 201 | 202 | QMenu{ 203 | color:#386487; 204 | background-color:#DEF0FE; 205 | margin:2px; 206 | } 207 | 208 | QMenu::item{ 209 | padding:3px 20px 3px 20px; 210 | } 211 | 212 | QMenu::indicator{ 213 | width:13px; 214 | height:13px; 215 | } 216 | 217 | QMenu::item:selected{ 218 | color:#386487; 219 | border:0px solid #C0DCF2; 220 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 221 | } 222 | 223 | QMenu::separator{ 224 | height:1px; 225 | background:#C0DCF2; 226 | } 227 | 228 | QProgressBar{ 229 | background:#DEF0FE; 230 | border-radius:5px; 231 | text-align:center; 232 | border:1px solid #C0DCF2; 233 | } 234 | 235 | QProgressBar::chunk{ 236 | width:5px; 237 | margin:0.5px; 238 | background-color:#C0DCF2; 239 | } 240 | 241 | QSlider::groove:horizontal,QSlider::add-page:horizontal{ 242 | height:8px; 243 | border-radius:3px; 244 | background:#DAEFFF; 245 | } 246 | 247 | QSlider::sub-page:horizontal{ 248 | height:8px; 249 | border-radius:3px; 250 | background:#C0DEF6; 251 | } 252 | 253 | QSlider::handle:horizontal{ 254 | width:13px; 255 | margin-top:-3px; 256 | margin-bottom:-3px; 257 | border-radius:6px; 258 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #DAEFFF,stop:0.8 #C0DEF6); 259 | } 260 | 261 | QSlider::groove:vertical,QSlider::sub-page:vertical{ 262 | width:8px; 263 | border-radius:3px; 264 | background:#DAEFFF; 265 | } 266 | 267 | QSlider::add-page:vertical{ 268 | width:8px; 269 | border-radius:3px; 270 | background:#C0DEF6; 271 | } 272 | 273 | QSlider::handle:vertical{ 274 | height:13px; 275 | margin-left:-2px; 276 | margin-right:-3px; 277 | border-radius:6px; 278 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #DAEFFF,stop:0.8 #C0DEF6); 279 | } 280 | 281 | QScrollBar:vertical{ 282 | width:10px; 283 | background-color:rgba(0,0,0,0%); 284 | padding-top:10px; 285 | padding-bottom:10px; 286 | } 287 | 288 | QScrollBar:horizontal{ 289 | height:10px; 290 | background-color:rgba(0,0,0,0%); 291 | padding-left:10px; 292 | padding-right:10px; 293 | } 294 | 295 | QScrollBar::handle:vertical,QScrollBar::handle:horizontal{ 296 | width:10px; 297 | background:#C0DEF6; 298 | } 299 | 300 | QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover{ 301 | width:10px; 302 | background:#C0DEF6; 303 | } 304 | 305 | QScrollBar::add-line:vertical{ 306 | height:10px; 307 | width:10px; 308 | subcontrol-position:bottom; 309 | subcontrol-origin:margin; 310 | border-image:url(:/image/add_bottom.png); 311 | } 312 | 313 | QScrollBar::add-line:horizontal{ 314 | height:10px; 315 | width:10px; 316 | subcontrol-position:right; 317 | subcontrol-origin:margin; 318 | border-image:url(:/image/add_right.png); 319 | } 320 | 321 | QScrollBar::sub-line:vertical{ 322 | height:10px; 323 | width:10px; 324 | subcontrol-position:top; 325 | subcontrol-origin:margin; 326 | border-image:url(:/image/add_top.png); 327 | } 328 | 329 | QScrollBar::sub-line:horizontal{ 330 | height:10px; 331 | width:10px; 332 | subcontrol-position:left; 333 | subcontrol-origin:margin; 334 | border-image:url(:/image/add_left.png); 335 | } 336 | 337 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical,QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal{ 338 | width:10px; 339 | background:#DAEFFF; 340 | } 341 | 342 | QScrollArea{ 343 | border:0px; 344 | } 345 | 346 | QTreeView,QListView,QTableView,QTabWidget::pane{ 347 | border:1px solid #C0DCF2; 348 | selection-background-color:#F2F9FF; 349 | selection-color:#386487; 350 | alternate-background-color:#DAEFFF; 351 | } 352 | 353 | QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ 354 | color:#386487; 355 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 356 | } 357 | 358 | QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ 359 | color:#386487; 360 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); 361 | } 362 | 363 | QTableView::item,QListView::item,QTreeView::item{ 364 | padding:5px; 365 | margin:0px; 366 | } 367 | 368 | QHeaderView::section,QTableCornerButton:section{ 369 | padding:3px; 370 | margin:0px; 371 | color:#386487; 372 | border:1px solid #C0DCF2; 373 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); 374 | } 375 | 376 | QTabBar::tab{ 377 | border-radius:5px; 378 | border:1px solid #C0DCF2; 379 | color:#386487; 380 | min-width:55px; 381 | min-height:20px; 382 | padding:3px 8px 3px 8px; 383 | margin:1px; 384 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); 385 | } 386 | 387 | QTabBar::tab:selected,QTabBar::tab:hover{ 388 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 389 | } 390 | 391 | QStatusBar::item{ 392 | border:0px solid #DEF0FE; 393 | border-radius:3px; 394 | } 395 | 396 | QToolBox::tab,QToolTip,QGroupBox#gboxDevicePanel{ 397 | padding:3px; 398 | border-radius: 5px; 399 | color:#386487; 400 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DEF0FE,stop:1 #C0DEF6); 401 | } 402 | 403 | QToolBox::tab:selected{ 404 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F9FF,stop:1 #DAEFFF); 405 | } 406 | -------------------------------------------------------------------------------- /other/qss/brown.css: -------------------------------------------------------------------------------- 1 | QPalette{background:#D7DBE4;}QGroupBox#gboxDevicePanel>QLabel{color:#E7ECF0;} 2 | 3 | QWidget#frmMain,QWidget[Form="true"]{ 4 | border:1px solid #738393; 5 | border-radius:0px; 6 | } 7 | 8 | .QFrame{ 9 | border:1px solid #C2CCD8; 10 | border-radius:5px; 11 | } 12 | 13 | QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QGroupBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox,QTreeView,QListView,QTableView,QTabWidget::pane{ 14 | color:#3D3E42; 15 | } 16 | 17 | QWidget#widget_title,QWidget#widget_left{ 18 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 19 | } 20 | 21 | QLabel#lab_Ico,QLabel#lab_Title{ 22 | border-radius:0px; 23 | color:#E7ECF0; 24 | background-color:rgba(0,0,0,0); 25 | border-style:none; 26 | } 27 | 28 | QWidget#widget_top>QToolButton::menu-indicator{ 29 | image:None; 30 | } 31 | 32 | QWidget#widget_top>QToolButton{ 33 | border-style:none; 34 | padding:10px; 35 | color:#E7ECF0; 36 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 37 | } 38 | 39 | QWidget#widget_top>QToolButton:hover,QWidget#widget_top>QToolButton:checked{ 40 | border-style:solid; 41 | border-bottom-width:2px; 42 | border-bottom-color:rgba(238,0,0,128); 43 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #778899,stop:1 #708090); 44 | } 45 | 46 | QLabel[labVideo="true"]{ 47 | color:#E7ECF0; 48 | border:1px solid #738393; 49 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 50 | } 51 | 52 | QLabel[labVideo="true"]:focus{ 53 | border:1px solid #FF0000; 54 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #778899,stop:1 #708090); 55 | } 56 | 57 | QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox{ 58 | border:1px solid #C2CCD8; 59 | border-radius:5px; 60 | padding:2px; 61 | background:none; 62 | selection-background-color:#667481; 63 | selection-color:#E7ECF0; 64 | } 65 | 66 | QLineEdit[echoMode="2"]{ 67 | lineedit-password-character:9679; 68 | } 69 | 70 | .QGroupBox{ 71 | border:1px solid #C2CCD8; 72 | border-radius:5px; 73 | } 74 | 75 | .QPushButton{ 76 | border-style:none; 77 | border:1px solid #C2CCD8; 78 | color:#E7ECF0; 79 | padding:5px; 80 | min-height:20px; 81 | border-radius:5px; 82 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 83 | } 84 | 85 | .QPushButton:hover{ 86 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #778899,stop:1 #708090); 87 | } 88 | 89 | .QPushButton:pressed{ 90 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 91 | } 92 | 93 | .QPushButton:disabled{ 94 | color:#838383; 95 | background:#F4F4F4; 96 | } 97 | 98 | QPushButton#btnSplitterH{ 99 | padding:2px; 100 | min-height:8px; 101 | } 102 | 103 | QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close,QPushButton#btnSplitterV,QPushButton#btnSplitterH{ 104 | border-radius:0px; 105 | color:#E7ECF0; 106 | background-color:rgba(0,0,0,0); 107 | border-style:none; 108 | } 109 | 110 | QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover,QPushButton#btnSplitterV:hover,QPushButton#btnSplitterH:hover{ 111 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,134,199,0),stop:1 #778899); 112 | } 113 | 114 | QPushButton#btnMenu_Close:hover{ 115 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(238,0,0,128),stop:1 rgba(238,44,44,255)); 116 | } 117 | 118 | QWidget#widget_left>QPushButton{ 119 | border-radius:0px; 120 | color:#E7ECF0; 121 | background-color:rgba(0,0,0,0); 122 | border-style:none; 123 | } 124 | 125 | QWidget#widget_left>QPushButton:hover{ 126 | background-color:rgba(238,0,0,128); 127 | } 128 | 129 | QWidget#widget_left>QPushButton:pressed,QWidget#widget_left>QPushButton:checked{ 130 | color:#000000; 131 | background-color:rgba(250,255,255,255); 132 | } 133 | 134 | QCheckBox{ 135 | color:#3D3E42; 136 | spacing:2px; 137 | } 138 | 139 | QCheckBox::indicator{ 140 | width:20px; 141 | height:20px; 142 | } 143 | 144 | QCheckBox::indicator:unchecked{ 145 | image:url(:/image/checkbox_unchecked.png); 146 | } 147 | 148 | QCheckBox::indicator:checked{ 149 | image:url(:/image/checkbox_checked.png); 150 | } 151 | 152 | QRadioButton{ 153 | color:#3D3E42; 154 | spacing:2px; 155 | } 156 | 157 | QRadioButton::indicator{ 158 | width:15px; 159 | height:15px; 160 | } 161 | 162 | QRadioButton::indicator::unchecked{ 163 | image:url(:/image/radio_normal.png); 164 | } 165 | 166 | QRadioButton::indicator::checked{ 167 | image:url(:/image/radio_selected.png); 168 | } 169 | 170 | QSpinBox::up-button,QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button{ 171 | image:url(:/image/add_top.png); 172 | } 173 | 174 | QSpinBox::down-button,QDateEdit::down-button,QTimeEdit::down-button,QDateTimeEdit::down-button{ 175 | image:url(:/image/add_bottom.png); 176 | } 177 | 178 | QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox{ 179 | border-radius:3px; 180 | padding:3px 5px 3px 5px; 181 | border:1px solid #C2CCD8; 182 | background:none; 183 | selection-background-color:#667481; 184 | selection-color:#E7ECF0; 185 | } 186 | 187 | QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ 188 | subcontrol-origin:padding; 189 | subcontrol-position:top right; 190 | width:15px; 191 | border-left-width:1px; 192 | border-left-style:solid; 193 | border-top-right-radius:3px; 194 | border-bottom-right-radius:3px; 195 | border-left-color:#C2CCD8; 196 | } 197 | 198 | QComboBox::down-arrow,QDateEdit::down-arrow,QTimeEdit::down-arrow,QDateTimeEdit::down-arrow{ 199 | image:url(:/image/add_bottom.png); 200 | } 201 | 202 | QMenu{ 203 | color:#E7ECF0; 204 | background-color:#667481; 205 | margin:2px; 206 | } 207 | 208 | QMenu::item{ 209 | padding:3px 20px 3px 20px; 210 | } 211 | 212 | QMenu::indicator{ 213 | width:13px; 214 | height:13px; 215 | } 216 | 217 | QMenu::item:selected{ 218 | color:#E7ECF0; 219 | border:0px solid #738393; 220 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 221 | } 222 | 223 | QMenu::separator{ 224 | height:1px; 225 | background:#738393; 226 | } 227 | 228 | QProgressBar{ 229 | background:#C2CCD8; 230 | border-radius:5px; 231 | text-align:center; 232 | border:1px solid #C2CCD8; 233 | } 234 | 235 | QProgressBar::chunk{ 236 | width:5px; 237 | margin:0.5px; 238 | background-color:#667481; 239 | } 240 | 241 | QSlider::groove:horizontal,QSlider::add-page:horizontal{ 242 | height:8px; 243 | border-radius:3px; 244 | background:#C2CCD8; 245 | } 246 | 247 | QSlider::sub-page:horizontal{ 248 | height:8px; 249 | border-radius:3px; 250 | background:#708090; 251 | } 252 | 253 | QSlider::handle:horizontal{ 254 | width:13px; 255 | margin-top:-3px; 256 | margin-bottom:-3px; 257 | border-radius:6px; 258 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #667481,stop:0.8 #778899); 259 | } 260 | 261 | QSlider::groove:vertical,QSlider::sub-page:vertical{ 262 | width:8px; 263 | border-radius:3px; 264 | background:#C2CCD8; 265 | } 266 | 267 | QSlider::add-page:vertical{ 268 | width:8px; 269 | border-radius:3px; 270 | background:#708090; 271 | } 272 | 273 | QSlider::handle:vertical{ 274 | height:13px; 275 | margin-left:-2px; 276 | margin-right:-3px; 277 | border-radius:6px; 278 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #667481,stop:0.8 #778899); 279 | } 280 | 281 | QScrollBar:vertical{ 282 | width:10px; 283 | background-color:rgba(0,0,0,0%); 284 | padding-top:10px; 285 | padding-bottom:10px; 286 | } 287 | 288 | QScrollBar:horizontal{ 289 | height:10px; 290 | background-color:rgba(0,0,0,0%); 291 | padding-left:10px; 292 | padding-right:10px; 293 | } 294 | 295 | QScrollBar::handle:vertical,QScrollBar::handle:horizontal{ 296 | width:10px; 297 | background:#708090; 298 | } 299 | 300 | QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover{ 301 | width:10px; 302 | background:#566373; 303 | } 304 | 305 | QScrollBar::add-line:vertical{ 306 | height:10px; 307 | width:10px; 308 | subcontrol-position:bottom; 309 | subcontrol-origin:margin; 310 | border-image:url(:/image/add_bottom.png); 311 | } 312 | 313 | QScrollBar::add-line:horizontal{ 314 | height:10px; 315 | width:10px; 316 | subcontrol-position:right; 317 | subcontrol-origin:margin; 318 | border-image:url(:/image/add_right.png); 319 | } 320 | 321 | QScrollBar::sub-line:vertical{ 322 | height:10px; 323 | width:10px; 324 | subcontrol-position:top; 325 | subcontrol-origin:margin; 326 | border-image:url(:/image/add_top.png); 327 | } 328 | 329 | QScrollBar::sub-line:horizontal{ 330 | height:10px; 331 | width:10px; 332 | subcontrol-position:left; 333 | subcontrol-origin:margin; 334 | border-image:url(:/image/add_left.png); 335 | } 336 | 337 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical,QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal{ 338 | width:10px; 339 | background:#C2CCD8; 340 | } 341 | 342 | QScrollArea{ 343 | border:0px; 344 | } 345 | 346 | QTreeView,QListView,QTableView,QTabWidget::pane{ 347 | border:1px solid #C2CCD8; 348 | selection-background-color:#778899; 349 | selection-color:#E7ECF0; 350 | alternate-background-color:#DDE0E7; 351 | } 352 | 353 | QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ 354 | color:#E7ECF0; 355 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 356 | } 357 | 358 | QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ 359 | color:#E7ECF0; 360 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #778899,stop:1 #708090); 361 | } 362 | 363 | QTableView::item,QListView::item,QTreeView::item{ 364 | padding:5px; 365 | margin:0px; 366 | } 367 | 368 | QHeaderView::section,QTableCornerButton:section{ 369 | padding:3px; 370 | margin:0px; 371 | color:#E7ECF0; 372 | border:1px solid #C2CCD8; 373 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #778899,stop:1 #708090); 374 | } 375 | 376 | QTabBar::tab{ 377 | border-radius:5px; 378 | border:1px solid #C2CCD8; 379 | color:#E7ECF0; 380 | min-width:55px; 381 | min-height:20px; 382 | padding:3px 8px 3px 8px; 383 | margin:1px; 384 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #778899,stop:1 #708090); 385 | } 386 | 387 | QTabBar::tab:selected,QTabBar::tab:hover{ 388 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 389 | } 390 | 391 | QStatusBar::item{ 392 | border:0px solid #667481; 393 | border-radius:3px; 394 | } 395 | 396 | QToolBox::tab,QToolTip,QGroupBox#gboxDevicePanel{ 397 | padding:3px; 398 | border-radius: 5px; 399 | color:#E7ECF0; 400 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #667481,stop:1 #566373); 401 | } 402 | 403 | QToolBox::tab:selected{ 404 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #778899,stop:1 #708090); 405 | } 406 | -------------------------------------------------------------------------------- /other/qss/darkgray.css: -------------------------------------------------------------------------------- 1 | QPalette{background:#EBECF0;}QGroupBox#gboxDevicePanel>QLabel{color:#5D5C6C;} 2 | 3 | QWidget#frmMain,QWidget[Form="true"]{ 4 | border:1px solid #A9ACB5; 5 | border-radius:0px; 6 | } 7 | 8 | .QFrame{ 9 | border:1px solid #A9ACB5; 10 | border-radius:5px; 11 | } 12 | 13 | QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QGroupBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox,QTreeView,QListView,QTableView,QTabWidget::pane{ 14 | color:#5D5C6C; 15 | } 16 | 17 | QWidget#widget_title,QWidget#widget_left{ 18 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 19 | } 20 | 21 | QLabel#lab_Ico,QLabel#lab_Title{ 22 | border-radius:0px; 23 | color:#5D5C6C; 24 | background-color:rgba(0,0,0,0); 25 | border-style:none; 26 | } 27 | 28 | QWidget#widget_top>QToolButton::menu-indicator{ 29 | image:None; 30 | } 31 | 32 | QWidget#widget_top>QToolButton{ 33 | border-style:none; 34 | padding:10px; 35 | color:#5D5C6C; 36 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 37 | } 38 | 39 | QWidget#widget_top>QToolButton:hover,QWidget#widget_top>QToolButton:checked{ 40 | border-style:solid; 41 | border-bottom-width:2px; 42 | border-bottom-color:rgba(238,0,0,128); 43 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EFF0F4,stop:1 #DDE0E7); 44 | } 45 | 46 | QLabel[labVideo="true"]{ 47 | color:#5D5C6C; 48 | border:1px solid #A9ACB5; 49 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 50 | } 51 | 52 | QLabel[labVideo="true"]:focus{ 53 | border:1px solid #FF0000; 54 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EFF0F4,stop:1 #DDE0E7); 55 | } 56 | 57 | QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox{ 58 | border:1px solid #A9ACB5; 59 | border-radius:5px; 60 | padding:2px; 61 | background:none; 62 | selection-background-color:#D8D9DE; 63 | selection-color:#5D5C6C; 64 | } 65 | 66 | QLineEdit[echoMode="2"]{ 67 | lineedit-password-character:9679; 68 | } 69 | 70 | .QGroupBox{ 71 | border:1px solid #A9ACB5; 72 | border-radius:5px; 73 | } 74 | 75 | .QPushButton{ 76 | border-style:none; 77 | border:1px solid #A9ACB5; 78 | color:#5D5C6C; 79 | padding:5px; 80 | min-height:20px; 81 | border-radius:5px; 82 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 83 | } 84 | 85 | .QPushButton:hover{ 86 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EFF0F4,stop:1 #DDE0E7); 87 | } 88 | 89 | .QPushButton:pressed{ 90 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 91 | } 92 | 93 | .QPushButton:disabled{ 94 | color:#838383; 95 | background:#F4F4F4; 96 | } 97 | 98 | QPushButton#btnSplitterH{ 99 | padding:2px; 100 | min-height:8px; 101 | } 102 | 103 | QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close,QPushButton#btnSplitterV,QPushButton#btnSplitterH{ 104 | border-radius:0px; 105 | color:#5D5C6C; 106 | background-color:rgba(0,0,0,0); 107 | border-style:none; 108 | } 109 | 110 | QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover,QPushButton#btnSplitterV:hover,QPushButton#btnSplitterH:hover{ 111 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,134,199,0),stop:1 #EFF0F4); 112 | } 113 | 114 | QPushButton#btnMenu_Close:hover{ 115 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(238,0,0,128),stop:1 rgba(238,44,44,255)); 116 | } 117 | 118 | QWidget#widget_left>QPushButton{ 119 | border-radius:0px; 120 | color:#5D5C6C; 121 | background-color:rgba(0,0,0,0); 122 | border-style:none; 123 | } 124 | 125 | QWidget#widget_left>QPushButton:hover{ 126 | background-color:rgba(238,0,0,128); 127 | } 128 | 129 | QWidget#widget_left>QPushButton:pressed,QWidget#widget_left>QPushButton:checked{ 130 | color:#000000; 131 | background-color:rgba(250,255,255,255); 132 | } 133 | 134 | QCheckBox{ 135 | color:#5D5C6C; 136 | spacing:2px; 137 | } 138 | 139 | QCheckBox::indicator{ 140 | width:20px; 141 | height:20px; 142 | } 143 | 144 | QCheckBox::indicator:unchecked{ 145 | image:url(:/image/checkbox_unchecked.png); 146 | } 147 | 148 | QCheckBox::indicator:checked{ 149 | image:url(:/image/checkbox_checked.png); 150 | } 151 | 152 | QRadioButton{ 153 | color:#5D5C6C; 154 | spacing:2px; 155 | } 156 | 157 | QRadioButton::indicator{ 158 | width:15px; 159 | height:15px; 160 | } 161 | 162 | QRadioButton::indicator::unchecked{ 163 | image:url(:/image/radio_normal.png); 164 | } 165 | 166 | QRadioButton::indicator::checked{ 167 | image:url(:/image/radio_selected.png); 168 | } 169 | 170 | QSpinBox::up-button,QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button{ 171 | image:url(:/image/add_top.png); 172 | } 173 | 174 | QSpinBox::down-button,QDateEdit::down-button,QTimeEdit::down-button,QDateTimeEdit::down-button{ 175 | image:url(:/image/add_bottom.png); 176 | } 177 | 178 | QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox{ 179 | border-radius:3px; 180 | padding:3px 5px 3px 5px; 181 | border:1px solid #A9ACB5; 182 | background:none; 183 | selection-background-color:#D8D9DE; 184 | selection-color:#5D5C6C; 185 | } 186 | 187 | QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ 188 | subcontrol-origin:padding; 189 | subcontrol-position:top right; 190 | width:15px; 191 | border-left-width:1px; 192 | border-left-style:solid; 193 | border-top-right-radius:3px; 194 | border-bottom-right-radius:3px; 195 | border-left-color:#A9ACB5; 196 | } 197 | 198 | QComboBox::down-arrow,QDateEdit::down-arrow,QTimeEdit::down-arrow,QDateTimeEdit::down-arrow{ 199 | image:url(:/image/add_bottom.png); 200 | } 201 | 202 | QMenu{ 203 | color:#5D5C6C; 204 | background-color:#D8D9DE; 205 | margin:2px; 206 | } 207 | 208 | QMenu::item{ 209 | padding:3px 20px 3px 20px; 210 | } 211 | 212 | QMenu::indicator{ 213 | width:13px; 214 | height:13px; 215 | } 216 | 217 | QMenu::item:selected{ 218 | color:#5D5C6C; 219 | border:0px solid #A9ACB5; 220 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 221 | } 222 | 223 | QMenu::separator{ 224 | height:1px; 225 | background:#A9ACB5; 226 | } 227 | 228 | QProgressBar{ 229 | background:#D8D9DE; 230 | border-radius:5px; 231 | text-align:center; 232 | border:1px solid #A9ACB5; 233 | } 234 | 235 | QProgressBar::chunk{ 236 | width:5px; 237 | margin:0.5px; 238 | background-color:#A9ACB5; 239 | } 240 | 241 | QSlider::groove:horizontal,QSlider::add-page:horizontal{ 242 | height:8px; 243 | border-radius:3px; 244 | background:#A9ACB5; 245 | } 246 | 247 | QSlider::sub-page:horizontal{ 248 | height:8px; 249 | border-radius:3px; 250 | background:#8C8C8C; 251 | } 252 | 253 | QSlider::handle:horizontal{ 254 | width:13px; 255 | margin-top:-3px; 256 | margin-bottom:-3px; 257 | border-radius:6px; 258 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #EFF0F4,stop:0.8 #A9ACB5); 259 | } 260 | 261 | QSlider::groove:vertical,QSlider::sub-page:vertical{ 262 | width:8px; 263 | border-radius:3px; 264 | background:#A9ACB5; 265 | } 266 | 267 | QSlider::add-page:vertical{ 268 | width:8px; 269 | border-radius:3px; 270 | background:#8C8C8C; 271 | } 272 | 273 | QSlider::handle:vertical{ 274 | height:13px; 275 | margin-left:-2px; 276 | margin-right:-3px; 277 | border-radius:6px; 278 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #EFF0F4,stop:0.8 #A9ACB5); 279 | } 280 | 281 | QScrollBar:vertical{ 282 | width:10px; 283 | background-color:rgba(0,0,0,0%); 284 | padding-top:10px; 285 | padding-bottom:10px; 286 | } 287 | 288 | QScrollBar:horizontal{ 289 | height:10px; 290 | background-color:rgba(0,0,0,0%); 291 | padding-left:10px; 292 | padding-right:10px; 293 | } 294 | 295 | QScrollBar::handle:vertical,QScrollBar::handle:horizontal{ 296 | width:10px; 297 | background:#8C8C8C; 298 | } 299 | 300 | QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover{ 301 | width:10px; 302 | background:#8C8C8C; 303 | } 304 | 305 | QScrollBar::add-line:vertical{ 306 | height:10px; 307 | width:10px; 308 | subcontrol-position:bottom; 309 | subcontrol-origin:margin; 310 | border-image:url(:/image/add_bottom.png); 311 | } 312 | 313 | QScrollBar::add-line:horizontal{ 314 | height:10px; 315 | width:10px; 316 | subcontrol-position:right; 317 | subcontrol-origin:margin; 318 | border-image:url(:/image/add_right.png); 319 | } 320 | 321 | QScrollBar::sub-line:vertical{ 322 | height:10px; 323 | width:10px; 324 | subcontrol-position:top; 325 | subcontrol-origin:margin; 326 | border-image:url(:/image/add_top.png); 327 | } 328 | 329 | QScrollBar::sub-line:horizontal{ 330 | height:10px; 331 | width:10px; 332 | subcontrol-position:left; 333 | subcontrol-origin:margin; 334 | border-image:url(:/image/add_left.png); 335 | } 336 | 337 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical,QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal{ 338 | width:10px; 339 | background:#A9ACB5; 340 | } 341 | 342 | QScrollArea{ 343 | border:0px; 344 | } 345 | 346 | QTreeView,QListView,QTableView,QTabWidget::pane{ 347 | border:1px solid #A9ACB5; 348 | selection-background-color:#EFF0F4; 349 | selection-color:#5D5C6C; 350 | alternate-background-color:#DDE0E7; 351 | } 352 | 353 | QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ 354 | color:#5D5C6C; 355 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 356 | } 357 | 358 | QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ 359 | color:#5D5C6C; 360 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EFF0F4,stop:1 #DDE0E7); 361 | } 362 | 363 | QTableView::item,QListView::item,QTreeView::item{ 364 | padding:5px; 365 | margin:0px; 366 | } 367 | 368 | QHeaderView::section,QTableCornerButton:section{ 369 | padding:3px; 370 | margin:0px; 371 | color:#5D5C6C; 372 | border:1px solid #A9ACB5; 373 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EFF0F4,stop:1 #DDE0E7); 374 | } 375 | 376 | QTabBar::tab{ 377 | border-radius:5px; 378 | border:1px solid #A9ACB5; 379 | color:#5D5C6C; 380 | min-width:55px; 381 | min-height:20px; 382 | padding:3px 8px 3px 8px; 383 | margin:1px; 384 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EFF0F4,stop:1 #DDE0E7); 385 | } 386 | 387 | QTabBar::tab:selected,QTabBar::tab:hover{ 388 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 389 | } 390 | 391 | QStatusBar::item{ 392 | border:0px solid #D8D9DE; 393 | border-radius:3px; 394 | } 395 | 396 | QToolBox::tab,QToolTip,QGroupBox#gboxDevicePanel{ 397 | padding:3px; 398 | border-radius: 5px; 399 | color:#5D5C6C; 400 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D8D9DE,stop:1 #C8C8D0); 401 | } 402 | 403 | QToolBox::tab:selected{ 404 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EFF0F4,stop:1 #DDE0E7); 405 | } 406 | -------------------------------------------------------------------------------- /other/qss/dev.css: -------------------------------------------------------------------------------- 1 | QPalette{background:#CFDDEE;}QGroupBox#gboxDevicePanel>QLabel{color:#324C6C;} 2 | 3 | QWidget#frmMain,QWidget[Form="true"]{ 4 | border:1px solid #B4C2D7; 5 | border-radius:0px; 6 | } 7 | 8 | .QFrame{ 9 | border:1px solid #B4C2D7; 10 | border-radius:5px; 11 | } 12 | 13 | QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QGroupBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox,QTreeView,QListView,QTableView,QTabWidget::pane{ 14 | color:#324C6C; 15 | } 16 | 17 | QWidget#widget_title,QWidget#widget_left{ 18 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 19 | } 20 | 21 | QLabel#lab_Ico,QLabel#lab_Title{ 22 | border-radius:0px; 23 | color:#324C6C; 24 | background-color:rgba(0,0,0,0); 25 | border-style:none; 26 | } 27 | 28 | QWidget#widget_top>QToolButton::menu-indicator{ 29 | image:None; 30 | } 31 | 32 | QWidget#widget_top>QToolButton{ 33 | border-style:none; 34 | padding:10px; 35 | color:#324C6C; 36 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 37 | } 38 | 39 | QWidget#widget_top>QToolButton:hover,QWidget#widget_top>QToolButton:checked{ 40 | border-style:solid; 41 | border-bottom-width:2px; 42 | border-bottom-color:rgba(238,0,0,128); 43 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D2E3F5,stop:1 #CADDF3); 44 | } 45 | 46 | QLabel[labVideo="true"]{ 47 | color:#324C6C; 48 | border:1px solid #B4C2D7; 49 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 50 | } 51 | 52 | QLabel[labVideo="true"]:focus{ 53 | border:1px solid #FF0000; 54 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D2E3F5,stop:1 #CADDF3); 55 | } 56 | 57 | QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox{ 58 | border:1px solid #B4C2D7; 59 | border-radius:5px; 60 | padding:2px; 61 | background:none; 62 | selection-background-color:#C0D3EB; 63 | selection-color:#324C6C; 64 | } 65 | 66 | QLineEdit[echoMode="2"]{ 67 | lineedit-password-character:9679; 68 | } 69 | 70 | .QGroupBox{ 71 | border:1px solid #B4C2D7; 72 | border-radius:5px; 73 | } 74 | 75 | .QPushButton{ 76 | border-style:none; 77 | border:1px solid #B4C2D7; 78 | color:#324C6C; 79 | padding:5px; 80 | min-height:20px; 81 | border-radius:5px; 82 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 83 | } 84 | 85 | .QPushButton:hover{ 86 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D2E3F5,stop:1 #CADDF3); 87 | } 88 | 89 | .QPushButton:pressed{ 90 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 91 | } 92 | 93 | .QPushButton:disabled{ 94 | color:#838383; 95 | background:#F4F4F4; 96 | } 97 | 98 | QPushButton#btnSplitterH{ 99 | padding:2px; 100 | min-height:8px; 101 | } 102 | 103 | QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close,QPushButton#btnSplitterV,QPushButton#btnSplitterH{ 104 | border-radius:0px; 105 | color:#324C6C; 106 | background-color:rgba(0,0,0,0); 107 | border-style:none; 108 | } 109 | 110 | QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover,QPushButton#btnSplitterV:hover,QPushButton#btnSplitterH:hover{ 111 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,134,199,0),stop:1 #D2E3F5); 112 | } 113 | 114 | QPushButton#btnMenu_Close:hover{ 115 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(238,0,0,128),stop:1 rgba(238,44,44,255)); 116 | } 117 | 118 | QWidget#widget_left>QPushButton{ 119 | border-radius:0px; 120 | color:#324C6C; 121 | background-color:rgba(0,0,0,0); 122 | border-style:none; 123 | } 124 | 125 | QWidget#widget_left>QPushButton:hover{ 126 | background-color:rgba(238,0,0,128); 127 | } 128 | 129 | QWidget#widget_left>QPushButton:pressed,QWidget#widget_left>QPushButton:checked{ 130 | color:#000000; 131 | background-color:rgba(250,255,255,255); 132 | } 133 | 134 | QCheckBox{ 135 | color:#324C6C; 136 | spacing:2px; 137 | } 138 | 139 | QCheckBox::indicator{ 140 | width:20px; 141 | height:20px; 142 | } 143 | 144 | QCheckBox::indicator:unchecked{ 145 | image:url(:/image/checkbox_unchecked.png); 146 | } 147 | 148 | QCheckBox::indicator:checked{ 149 | image:url(:/image/checkbox_checked.png); 150 | } 151 | 152 | QRadioButton{ 153 | color:#324C6C; 154 | spacing:2px; 155 | } 156 | 157 | QRadioButton::indicator{ 158 | width:15px; 159 | height:15px; 160 | } 161 | 162 | QRadioButton::indicator::unchecked{ 163 | image:url(:/image/radio_normal.png); 164 | } 165 | 166 | QRadioButton::indicator::checked{ 167 | image:url(:/image/radio_selected.png); 168 | } 169 | 170 | QSpinBox::up-button,QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button{ 171 | image:url(:/image/add_top.png); 172 | } 173 | 174 | QSpinBox::down-button,QDateEdit::down-button,QTimeEdit::down-button,QDateTimeEdit::down-button{ 175 | image:url(:/image/add_bottom.png); 176 | } 177 | 178 | QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox{ 179 | border-radius:3px; 180 | padding:3px 5px 3px 5px; 181 | border:1px solid #B4C2D7; 182 | background:none; 183 | selection-background-color:#C0D3EB; 184 | selection-color:#324C6C; 185 | } 186 | 187 | QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ 188 | subcontrol-origin:padding; 189 | subcontrol-position:top right; 190 | width:15px; 191 | border-left-width:1px; 192 | border-left-style:solid; 193 | border-top-right-radius:3px; 194 | border-bottom-right-radius:3px; 195 | border-left-color:#B4C2D7; 196 | } 197 | 198 | QComboBox::down-arrow,QDateEdit::down-arrow,QTimeEdit::down-arrow,QDateTimeEdit::down-arrow{ 199 | image:url(:/image/add_bottom.png); 200 | } 201 | 202 | QMenu{ 203 | color:#324C6C; 204 | background-color:#C0D3EB; 205 | margin:2px; 206 | } 207 | 208 | QMenu::item{ 209 | padding:3px 20px 3px 20px; 210 | } 211 | 212 | QMenu::indicator{ 213 | width:13px; 214 | height:13px; 215 | } 216 | 217 | QMenu::item:selected{ 218 | color:#324C6C; 219 | border:0px solid #B4C2D7; 220 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 221 | } 222 | 223 | QMenu::separator{ 224 | height:1px; 225 | background:#B4C2D7; 226 | } 227 | 228 | QProgressBar{ 229 | background:#BCCFE7; 230 | border-radius:5px; 231 | text-align:center; 232 | border:1px solid #C0D3EB; 233 | } 234 | 235 | QProgressBar::chunk{ 236 | width:5px; 237 | margin:0.5px; 238 | background-color:#D2E3F5; 239 | } 240 | 241 | QSlider::groove:horizontal,QSlider::add-page:horizontal{ 242 | height:8px; 243 | border-radius:3px; 244 | background:#BCCFE7; 245 | } 246 | 247 | QSlider::sub-page:horizontal{ 248 | height:8px; 249 | border-radius:3px; 250 | background:#CADDF3; 251 | } 252 | 253 | QSlider::handle:horizontal{ 254 | width:13px; 255 | margin-top:-3px; 256 | margin-bottom:-3px; 257 | border-radius:6px; 258 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FFFFFF,stop:0.8 #BCCFE7); 259 | } 260 | 261 | QSlider::groove:vertical,QSlider::sub-page:vertical{ 262 | width:8px; 263 | border-radius:3px; 264 | background:#BCCFE7; 265 | } 266 | 267 | QSlider::add-page:vertical{ 268 | width:8px; 269 | border-radius:3px; 270 | background:#CADDF3; 271 | } 272 | 273 | QSlider::handle:vertical{ 274 | height:13px; 275 | margin-left:-2px; 276 | margin-right:-3px; 277 | border-radius:6px; 278 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FFFFFF,stop:0.8 #BCCFE7); 279 | } 280 | 281 | QScrollBar:vertical{ 282 | width:10px; 283 | background-color:rgba(0,0,0,0%); 284 | padding-top:10px; 285 | padding-bottom:10px; 286 | } 287 | 288 | QScrollBar:horizontal{ 289 | height:10px; 290 | background-color:rgba(0,0,0,0%); 291 | padding-left:10px; 292 | padding-right:10px; 293 | } 294 | 295 | QScrollBar::handle:vertical,QScrollBar::handle:horizontal{ 296 | width:10px; 297 | background:#CADDF3; 298 | } 299 | 300 | QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover{ 301 | width:10px; 302 | background:#CADDF3; 303 | } 304 | 305 | QScrollBar::add-line:vertical{ 306 | height:10px; 307 | width:10px; 308 | subcontrol-position:bottom; 309 | subcontrol-origin:margin; 310 | border-image:url(:/image/add_bottom.png); 311 | } 312 | 313 | QScrollBar::add-line:horizontal{ 314 | height:10px; 315 | width:10px; 316 | subcontrol-position:right; 317 | subcontrol-origin:margin; 318 | border-image:url(:/image/add_right.png); 319 | } 320 | 321 | QScrollBar::sub-line:vertical{ 322 | height:10px; 323 | width:10px; 324 | subcontrol-position:top; 325 | subcontrol-origin:margin; 326 | border-image:url(:/image/add_top.png); 327 | } 328 | 329 | QScrollBar::sub-line:horizontal{ 330 | height:10px; 331 | width:10px; 332 | subcontrol-position:left; 333 | subcontrol-origin:margin; 334 | border-image:url(:/image/add_left.png); 335 | } 336 | 337 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical,QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal{ 338 | width:10px; 339 | background:#BCCFE7; 340 | } 341 | 342 | QScrollArea{ 343 | border:0px; 344 | } 345 | 346 | QTreeView,QListView,QTableView,QTabWidget::pane{ 347 | border:1px solid #B4C2D7; 348 | selection-background-color:#D2E3F5; 349 | selection-color:#324C6C; 350 | alternate-background-color:#CADDF3; 351 | } 352 | 353 | QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ 354 | color:#324C6C; 355 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 356 | } 357 | 358 | QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ 359 | color:#324C6C; 360 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D2E3F5,stop:1 #CADDF3); 361 | } 362 | 363 | QTableView::item,QListView::item,QTreeView::item{ 364 | padding:5px; 365 | margin:0px; 366 | } 367 | 368 | QHeaderView::section,QTableCornerButton:section{ 369 | padding:3px; 370 | margin:0px; 371 | color:#324C6C; 372 | border:1px solid #B4C2D7; 373 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D2E3F5,stop:1 #CADDF3); 374 | } 375 | 376 | QTabBar::tab{ 377 | border-radius:5px; 378 | border:1px solid #B4C2D7; 379 | color:#324C6C; 380 | min-width:55px; 381 | min-height:20px; 382 | padding:3px 8px 3px 8px; 383 | margin:1px; 384 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D2E3F5,stop:1 #CADDF3); 385 | } 386 | 387 | QTabBar::tab:selected,QTabBar::tab:hover{ 388 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 389 | } 390 | 391 | QStatusBar::item{ 392 | border:0px solid #C0D3EB; 393 | border-radius:3px; 394 | } 395 | 396 | QToolBox::tab,QToolTip,QGroupBox#gboxDevicePanel{ 397 | padding:3px; 398 | border-radius: 5px; 399 | color:#324C6C; 400 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #C0D3EB,stop:1 #BCCFE7); 401 | } 402 | 403 | QToolBox::tab:selected{ 404 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #D2E3F5,stop:1 #CADDF3); 405 | } 406 | -------------------------------------------------------------------------------- /other/qss/gray.css: -------------------------------------------------------------------------------- 1 | QPalette{background:#F0F0F0;}QGroupBox#gboxDevicePanel>QLabel{color:#000000;} 2 | 3 | QWidget#frmMain,QWidget[Form="true"]{ 4 | border:1px solid #A2A2A2; 5 | border-radius:0px; 6 | } 7 | 8 | .QFrame{ 9 | border:1px solid #A9A9A9; 10 | border-radius:5px; 11 | } 12 | 13 | QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QGroupBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox,QTreeView,QListView,QTableView,QTabWidget::pane{ 14 | color:#000000; 15 | } 16 | 17 | QWidget#widget_title,QWidget#widget_left{ 18 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 19 | } 20 | 21 | QLabel#lab_Ico,QLabel#lab_Title{ 22 | border-radius:0px; 23 | color:#000000; 24 | background-color:rgba(0,0,0,0); 25 | border-style:none; 26 | } 27 | 28 | QWidget#widget_top>QToolButton::menu-indicator{ 29 | image:None; 30 | } 31 | 32 | QWidget#widget_top>QToolButton{ 33 | border-style:none; 34 | padding:10px; 35 | color:#000000; 36 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 37 | } 38 | 39 | QWidget#widget_top>QToolButton:hover,QWidget#widget_top>QToolButton:checked{ 40 | border-style:solid; 41 | border-bottom-width:2px; 42 | border-bottom-color:rgba(238,0,0,128); 43 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DBDBDB,stop:1 #C1C1C1); 44 | } 45 | 46 | QLabel[labVideo="true"]{ 47 | color:#000000; 48 | border:1px solid #A9A9A9; 49 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 50 | } 51 | 52 | QLabel[labVideo="true"]:focus{ 53 | border:1px solid #FF0000; 54 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DBDBDB,stop:1 #C1C1C1); 55 | } 56 | 57 | QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox{ 58 | border:1px solid #A9A9A9; 59 | border-radius:5px; 60 | padding:2px; 61 | background:none; 62 | selection-background-color:#E4E4E4; 63 | selection-color:#000000; 64 | } 65 | 66 | QLineEdit[echoMode="2"]{ 67 | lineedit-password-character:9679; 68 | } 69 | 70 | .QGroupBox{ 71 | border:1px solid #A9A9A9; 72 | border-radius:5px; 73 | } 74 | 75 | .QPushButton{ 76 | border-style:none; 77 | border:1px solid #A9A9A9; 78 | color:#000000; 79 | padding:5px; 80 | min-height:20px; 81 | border-radius:5px; 82 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 83 | } 84 | 85 | .QPushButton:hover{ 86 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DBDBDB,stop:1 #C1C1C1); 87 | } 88 | 89 | .QPushButton:pressed{ 90 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 91 | } 92 | 93 | .QPushButton:disabled{ 94 | color:#838383; 95 | background:#F4F4F4; 96 | } 97 | 98 | QPushButton#btnSplitterH{ 99 | padding:2px; 100 | min-height:8px; 101 | } 102 | 103 | QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close,QPushButton#btnSplitterV,QPushButton#btnSplitterH{ 104 | border-radius:0px; 105 | color:#000000; 106 | background-color:rgba(0,0,0,0); 107 | border-style:none; 108 | } 109 | 110 | QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover,QPushButton#btnSplitterV:hover,QPushButton#btnSplitterH:hover{ 111 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,134,199,0),stop:1 #DBDBDB); 112 | } 113 | 114 | QPushButton#btnMenu_Close:hover{ 115 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(238,0,0,128),stop:1 rgba(238,44,44,255)); 116 | } 117 | 118 | QWidget#widget_left>QPushButton{ 119 | border-radius:0px; 120 | color:#000000; 121 | background-color:rgba(0,0,0,0); 122 | border-style:none; 123 | } 124 | 125 | QWidget#widget_left>QPushButton:hover{ 126 | background-color:rgba(238,0,0,128); 127 | } 128 | 129 | QWidget#widget_left>QPushButton:pressed,QWidget#widget_left>QPushButton:checked{ 130 | color:#000000; 131 | background-color:rgba(250,255,255,255); 132 | } 133 | 134 | QCheckBox{ 135 | color:#000000; 136 | spacing:2px; 137 | } 138 | 139 | QCheckBox::indicator{ 140 | width:20px; 141 | height:20px; 142 | } 143 | 144 | QCheckBox::indicator:unchecked{ 145 | image:url(:/image/checkbox_unchecked.png); 146 | } 147 | 148 | QCheckBox::indicator:checked{ 149 | image:url(:/image/checkbox_checked.png); 150 | } 151 | 152 | QRadioButton{ 153 | color:#000000; 154 | spacing:2px; 155 | } 156 | 157 | QRadioButton::indicator{ 158 | width:15px; 159 | height:15px; 160 | } 161 | 162 | QRadioButton::indicator::unchecked{ 163 | image:url(:/image/radio_normal.png); 164 | } 165 | 166 | QRadioButton::indicator::checked{ 167 | image:url(:/image/radio_selected.png); 168 | } 169 | 170 | QSpinBox::up-button,QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button{ 171 | image:url(:/image/add_top.png); 172 | } 173 | 174 | QSpinBox::down-button,QDateEdit::down-button,QTimeEdit::down-button,QDateTimeEdit::down-button{ 175 | image:url(:/image/add_bottom.png); 176 | } 177 | 178 | QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox{ 179 | border-radius:3px; 180 | padding:3px 5px 3px 5px; 181 | border:1px solid #A9A9A9; 182 | background:none; 183 | selection-background-color:#E4E4E4; 184 | selection-color:#000000; 185 | } 186 | 187 | QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ 188 | subcontrol-origin:padding; 189 | subcontrol-position:top right; 190 | width:15px; 191 | border-left-width:1px; 192 | border-left-style:solid; 193 | border-top-right-radius:3px; 194 | border-bottom-right-radius:3px; 195 | border-left-color:#A9A9A9; 196 | } 197 | 198 | QComboBox::down-arrow,QDateEdit::down-arrow,QTimeEdit::down-arrow,QDateTimeEdit::down-arrow{ 199 | image:url(:/image/add_bottom.png); 200 | } 201 | 202 | QMenu{ 203 | color:#000000; 204 | background-color:#E4E4E4; 205 | margin:2px; 206 | } 207 | 208 | QMenu::item{ 209 | padding:3px 20px 3px 20px; 210 | } 211 | 212 | QMenu::indicator{ 213 | width:13px; 214 | height:13px; 215 | } 216 | 217 | QMenu::item:selected{ 218 | color:#000000; 219 | border:0px solid #A9A9A9; 220 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 221 | } 222 | 223 | QMenu::separator{ 224 | height:1px; 225 | background:#A9A9A9; 226 | } 227 | 228 | QProgressBar{ 229 | background:#E4E4E4; 230 | border-radius:5px; 231 | text-align:center; 232 | border:1px solid #A9A9A9; 233 | } 234 | 235 | QProgressBar::chunk{ 236 | width:5px; 237 | margin:0.5px; 238 | background-color:#A9A9A9; 239 | } 240 | 241 | QSlider::groove:horizontal,QSlider::add-page:horizontal{ 242 | height:8px; 243 | border-radius:3px; 244 | background:#A9A9A9; 245 | } 246 | 247 | QSlider::sub-page:horizontal{ 248 | height:8px; 249 | border-radius:3px; 250 | background:#C1C1C1; 251 | } 252 | 253 | QSlider::handle:horizontal{ 254 | width:13px; 255 | margin-top:-3px; 256 | margin-bottom:-3px; 257 | border-radius:6px; 258 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FFFFFF,stop:0.8 #C1C1C1); 259 | } 260 | 261 | QSlider::groove:vertical,QSlider::sub-page:vertical{ 262 | width:8px; 263 | border-radius:3px; 264 | background:#A9A9A9; 265 | } 266 | 267 | QSlider::add-page:vertical{ 268 | width:8px; 269 | border-radius:3px; 270 | background:#C1C1C1; 271 | } 272 | 273 | QSlider::handle:vertical{ 274 | height:13px; 275 | margin-left:-2px; 276 | margin-right:-3px; 277 | border-radius:6px; 278 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FFFFFF,stop:0.8 #C1C1C1); 279 | } 280 | 281 | QScrollBar:vertical{ 282 | width:10px; 283 | background-color:rgba(0,0,0,0%); 284 | padding-top:10px; 285 | padding-bottom:10px; 286 | } 287 | 288 | QScrollBar:horizontal{ 289 | height:10px; 290 | background-color:rgba(0,0,0,0%); 291 | padding-left:10px; 292 | padding-right:10px; 293 | } 294 | 295 | QScrollBar::handle:vertical,QScrollBar::handle:horizontal{ 296 | width:10px; 297 | background:#C1C1C1; 298 | } 299 | 300 | QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover{ 301 | width:10px; 302 | background:#A2A2A2; 303 | } 304 | 305 | QScrollBar::add-line:vertical{ 306 | height:10px; 307 | width:10px; 308 | subcontrol-position:bottom; 309 | subcontrol-origin:margin; 310 | border-image:url(:/image/add_bottom.png); 311 | } 312 | 313 | QScrollBar::add-line:horizontal{ 314 | height:10px; 315 | width:10px; 316 | subcontrol-position:right; 317 | subcontrol-origin:margin; 318 | border-image:url(:/image/add_right.png); 319 | } 320 | 321 | QScrollBar::sub-line:vertical{ 322 | height:10px; 323 | width:10px; 324 | subcontrol-position:top; 325 | subcontrol-origin:margin; 326 | border-image:url(:/image/add_top.png); 327 | } 328 | 329 | QScrollBar::sub-line:horizontal{ 330 | height:10px; 331 | width:10px; 332 | subcontrol-position:left; 333 | subcontrol-origin:margin; 334 | border-image:url(:/image/add_left.png); 335 | } 336 | 337 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical,QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal{ 338 | width:10px; 339 | background:#A9A9A9; 340 | } 341 | 342 | QScrollArea{ 343 | border:0px; 344 | } 345 | 346 | QTreeView,QListView,QTableView,QTabWidget::pane{ 347 | border:1px solid #A9A9A9; 348 | selection-background-color:#DBDBDB; 349 | selection-color:#000000; 350 | alternate-background-color:#C1C1C1; 351 | } 352 | 353 | QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ 354 | color:#000000; 355 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 356 | } 357 | 358 | QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ 359 | color:#000000; 360 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DBDBDB,stop:1 #C1C1C1); 361 | } 362 | 363 | QTableView::item,QListView::item,QTreeView::item{ 364 | padding:5px; 365 | margin:0px; 366 | } 367 | 368 | QHeaderView::section,QTableCornerButton:section{ 369 | padding:3px; 370 | margin:0px; 371 | color:#000000; 372 | border:1px solid #A9A9A9; 373 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DBDBDB,stop:1 #C1C1C1); 374 | } 375 | 376 | QTabBar::tab{ 377 | border-radius:5px; 378 | border:1px solid #A9A9A9; 379 | color:#000000; 380 | min-width:55px; 381 | min-height:20px; 382 | padding:3px 8px 3px 8px; 383 | margin:1px; 384 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DBDBDB,stop:1 #C1C1C1); 385 | } 386 | 387 | QTabBar::tab:selected,QTabBar::tab:hover{ 388 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 389 | } 390 | 391 | QStatusBar::item{ 392 | border:0px solid #E4E4E4; 393 | border-radius:3px; 394 | } 395 | 396 | QToolBox::tab,QToolTip,QGroupBox#gboxDevicePanel{ 397 | padding:3px; 398 | border-radius: 5px; 399 | color:#000000; 400 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E4E4E4,stop:1 #A2A2A2); 401 | } 402 | 403 | QToolBox::tab:selected{ 404 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #DBDBDB,stop:1 #C1C1C1); 405 | } 406 | -------------------------------------------------------------------------------- /other/qss/lightgray.css: -------------------------------------------------------------------------------- 1 | QPalette{background:#F0F0F0;}QGroupBox#gboxDevicePanel>QLabel{color:#6F6F6F;} 2 | 3 | QWidget#frmMain,QWidget[Form="true"]{ 4 | border:1px solid #D4D0C8; 5 | border-radius:0px; 6 | } 7 | 8 | .QFrame{ 9 | border:1px solid #DCDCDC; 10 | border-radius:5px; 11 | } 12 | 13 | QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QGroupBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox,QTreeView,QListView,QTableView,QTabWidget::pane{ 14 | color:#6F6F6F; 15 | } 16 | 17 | QWidget#widget_title,QWidget#widget_left{ 18 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 19 | } 20 | 21 | QLabel#lab_Ico,QLabel#lab_Title{ 22 | border-radius:0px; 23 | color:#6F6F6F; 24 | background-color:rgba(0,0,0,0); 25 | border-style:none; 26 | } 27 | 28 | QWidget#widget_top>QToolButton::menu-indicator{ 29 | image:None; 30 | } 31 | 32 | QWidget#widget_top>QToolButton{ 33 | border-style:none; 34 | padding:10px; 35 | color:#6F6F6F; 36 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 37 | } 38 | 39 | QWidget#widget_top>QToolButton:hover,QWidget#widget_top>QToolButton:checked{ 40 | border-style:solid; 41 | border-bottom-width:2px; 42 | border-bottom-color:rgba(238,0,0,128); 43 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #FCFCFC,stop:1 #F7F7F7); 44 | } 45 | 46 | QLabel[labVideo="true"]{ 47 | color:#6F6F6F; 48 | border:1px solid #DCDCDC; 49 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 50 | } 51 | 52 | QLabel[labVideo="true"]:focus{ 53 | border:1px solid #FF0000; 54 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #FCFCFC,stop:1 #F7F7F7); 55 | } 56 | 57 | QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox{ 58 | border:1px solid #DCDCDC; 59 | padding:2px; 60 | background:none; 61 | selection-background-color:#EEEEEE; 62 | selection-color:#6F6F6F; 63 | } 64 | 65 | QLineEdit[echoMode="2"]{ 66 | lineedit-password-character:9679; 67 | } 68 | 69 | .QGroupBox{ 70 | border:1px solid #DCDCDC; 71 | border-radius:5px; 72 | } 73 | 74 | .QPushButton{ 75 | border-style:none; 76 | border:1px solid #DCDCDC; 77 | color:#6F6F6F; 78 | padding:5px; 79 | min-height:20px; 80 | border-radius:5px; 81 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 82 | } 83 | 84 | .QPushButton:hover{ 85 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #FCFCFC,stop:1 #F7F7F7); 86 | } 87 | 88 | .QPushButton:pressed{ 89 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 90 | } 91 | 92 | .QPushButton:disabled{ 93 | color:#838383; 94 | background:#F4F4F4; 95 | } 96 | 97 | QPushButton#btnSplitterH{ 98 | padding:2px; 99 | min-height:8px; 100 | } 101 | 102 | QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close,QPushButton#btnSplitterV,QPushButton#btnSplitterH{ 103 | border-radius:0px; 104 | color:#6F6F6F; 105 | background-color:rgba(0,0,0,0); 106 | border-style:none; 107 | } 108 | 109 | QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover,QPushButton#btnSplitterV:hover,QPushButton#btnSplitterH:hover{ 110 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,134,199,0),stop:1 #FCFCFC); 111 | } 112 | 113 | QPushButton#btnMenu_Close:hover{ 114 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(238,0,0,128),stop:1 rgba(238,44,44,255)); 115 | } 116 | 117 | QWidget#widget_left>QPushButton{ 118 | border-radius:0px; 119 | color:#6F6F6F; 120 | background-color:rgba(0,0,0,0); 121 | border-style:none; 122 | } 123 | 124 | QWidget#widget_left>QPushButton:hover{ 125 | background-color:rgba(238,0,0,128); 126 | } 127 | 128 | QWidget#widget_left>QPushButton:pressed,QWidget#widget_left>QPushButton:checked{ 129 | color:#000000; 130 | background-color:rgba(250,255,255,255); 131 | } 132 | 133 | QCheckBox{ 134 | color:#6F6F6F; 135 | spacing:2px; 136 | } 137 | 138 | QCheckBox::indicator{ 139 | width:20px; 140 | height:20px; 141 | } 142 | 143 | QCheckBox::indicator:unchecked{ 144 | image:url(:/image/checkbox_unchecked.png); 145 | } 146 | 147 | QCheckBox::indicator:checked{ 148 | image:url(:/image/checkbox_checked.png); 149 | } 150 | 151 | QRadioButton{ 152 | color:#6F6F6F; 153 | spacing:2px; 154 | } 155 | 156 | QRadioButton::indicator{ 157 | width:15px; 158 | height:15px; 159 | } 160 | 161 | QRadioButton::indicator::unchecked{ 162 | image:url(:/image/radio_normal.png); 163 | } 164 | 165 | QRadioButton::indicator::checked{ 166 | image:url(:/image/radio_selected.png); 167 | } 168 | 169 | QSpinBox::up-button,QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button{ 170 | image:url(:/image/add_top.png); 171 | } 172 | 173 | QSpinBox::down-button,QDateEdit::down-button,QTimeEdit::down-button,QDateTimeEdit::down-button{ 174 | image:url(:/image/add_bottom.png); 175 | } 176 | 177 | QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox{ 178 | border-radius:3px; 179 | padding:3px 5px 3px 5px; 180 | border:1px solid #DCDCDC; 181 | background:none; 182 | selection-background-color:#EEEEEE; 183 | selection-color:#6F6F6F; 184 | } 185 | 186 | QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ 187 | subcontrol-origin:padding; 188 | subcontrol-position:top right; 189 | width:15px; 190 | border-left-width:1px; 191 | border-left-style:solid; 192 | border-top-right-radius:3px; 193 | border-bottom-right-radius:3px; 194 | border-left-color:#DCDCDC; 195 | } 196 | 197 | QComboBox::down-arrow,QDateEdit::down-arrow,QTimeEdit::down-arrow,QDateTimeEdit::down-arrow{ 198 | image:url(:/image/add_bottom.png); 199 | } 200 | 201 | QMenu{ 202 | color:#6F6F6F; 203 | background-color:#EEEEEE; 204 | margin:2px; 205 | } 206 | 207 | QMenu::item{ 208 | padding:3px 20px 3px 20px; 209 | } 210 | 211 | QMenu::indicator{ 212 | width:13px; 213 | height:13px; 214 | } 215 | 216 | QMenu::item:selected{ 217 | color:#6F6F6F; 218 | border:0px solid #DCDCDC; 219 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 220 | } 221 | 222 | QMenu::separator{ 223 | height:1px; 224 | background:#DCDCDC; 225 | } 226 | 227 | QProgressBar{ 228 | background:#EEEEEE; 229 | border-radius:5px; 230 | text-align:center; 231 | border:1px solid #DCDCDC; 232 | } 233 | 234 | QProgressBar::chunk{ 235 | width:5px; 236 | margin:0.5px; 237 | background-color:#DCDCDC; 238 | } 239 | 240 | QSlider::groove:horizontal,QSlider::add-page:horizontal{ 241 | height:8px; 242 | border-radius:3px; 243 | background:#DCDCDC; 244 | } 245 | 246 | QSlider::sub-page:horizontal{ 247 | height:8px; 248 | border-radius:3px; 249 | background:#8C8C8C; 250 | } 251 | 252 | QSlider::handle:horizontal{ 253 | width:13px; 254 | margin-top:-3px; 255 | margin-bottom:-3px; 256 | border-radius:6px; 257 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FCFCFC,stop:0.8 #DCDCDC); 258 | } 259 | 260 | QSlider::groove:vertical,QSlider::sub-page:vertical{ 261 | width:8px; 262 | border-radius:3px; 263 | background:#DCDCDC; 264 | } 265 | 266 | QSlider::add-page:vertical{ 267 | width:8px; 268 | border-radius:3px; 269 | background:#8C8C8C; 270 | } 271 | 272 | QSlider::handle:vertical{ 273 | height:13px; 274 | margin-left:-2px; 275 | margin-right:-3px; 276 | border-radius:6px; 277 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FCFCFC,stop:0.8 #DCDCDC); 278 | } 279 | 280 | QScrollBar:vertical{ 281 | width:10px; 282 | background-color:rgba(0,0,0,0%); 283 | padding-top:10px; 284 | padding-bottom:10px; 285 | } 286 | 287 | QScrollBar:horizontal{ 288 | height:10px; 289 | background-color:rgba(0,0,0,0%); 290 | padding-left:10px; 291 | padding-right:10px; 292 | } 293 | 294 | QScrollBar::handle:vertical,QScrollBar::handle:horizontal{ 295 | width:10px; 296 | background:#8C8C8C; 297 | } 298 | 299 | QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover{ 300 | width:10px; 301 | background:#8C8C8C; 302 | } 303 | 304 | QScrollBar::add-line:vertical{ 305 | height:10px; 306 | width:10px; 307 | subcontrol-position:bottom; 308 | subcontrol-origin:margin; 309 | border-image:url(:/image/add_bottom.png); 310 | } 311 | 312 | QScrollBar::add-line:horizontal{ 313 | height:10px; 314 | width:10px; 315 | subcontrol-position:right; 316 | subcontrol-origin:margin; 317 | border-image:url(:/image/add_right.png); 318 | } 319 | 320 | QScrollBar::sub-line:vertical{ 321 | height:10px; 322 | width:10px; 323 | subcontrol-position:top; 324 | subcontrol-origin:margin; 325 | border-image:url(:/image/add_top.png); 326 | } 327 | 328 | QScrollBar::sub-line:horizontal{ 329 | height:10px; 330 | width:10px; 331 | subcontrol-position:left; 332 | subcontrol-origin:margin; 333 | border-image:url(:/image/add_left.png); 334 | } 335 | 336 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical,QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal{ 337 | width:10px; 338 | background:#DCDCDC; 339 | } 340 | 341 | QScrollArea{ 342 | border:0px; 343 | } 344 | 345 | QTreeView,QListView,QTableView,QTabWidget::pane{ 346 | border:1px solid #DCDCDC; 347 | selection-background-color:#FCFCFC; 348 | selection-color:#6F6F6F; 349 | alternate-background-color:#F7F7F7; 350 | } 351 | 352 | QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ 353 | color:#6F6F6F; 354 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 355 | } 356 | 357 | QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ 358 | color:#6F6F6F; 359 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #FCFCFC,stop:1 #F7F7F7); 360 | } 361 | 362 | QTableView::item,QListView::item,QTreeView::item{ 363 | padding:5px; 364 | margin:0px; 365 | } 366 | 367 | QHeaderView::section,QTableCornerButton:section{ 368 | padding:3px; 369 | margin:0px; 370 | color:#6F6F6F; 371 | border:1px solid #DCDCDC; 372 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #FCFCFC,stop:1 #F7F7F7); 373 | } 374 | 375 | QTabBar::tab{ 376 | border-radius:5px; 377 | border:1px solid #DCDCDC; 378 | color:#6F6F6F; 379 | min-width:55px; 380 | min-height:20px; 381 | padding:3px 8px 3px 8px; 382 | margin:1px; 383 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #FCFCFC,stop:1 #F7F7F7); 384 | } 385 | 386 | QTabBar::tab:selected,QTabBar::tab:hover{ 387 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 388 | } 389 | 390 | QStatusBar::item{ 391 | border:0px solid #EEEEEE; 392 | border-radius:3px; 393 | } 394 | 395 | QToolBox::tab,QToolTip,QGroupBox#gboxDevicePanel{ 396 | padding:3px; 397 | border-radius: 5px; 398 | color:#6F6F6F; 399 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #EEEEEE,stop:1 #E5E5E5); 400 | } 401 | 402 | QToolBox::tab:selected{ 403 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #FCFCFC,stop:1 #F7F7F7); 404 | } 405 | -------------------------------------------------------------------------------- /other/qss/silvery.css: -------------------------------------------------------------------------------- 1 | QPalette{background:#F5F5F5;}QGroupBox#gboxDevicePanel>QLabel{color:#000000;} 2 | 3 | QWidget#frmMain,QWidget[Form="true"]{ 4 | border:1px solid #B2B6B9; 5 | border-radius:0px; 6 | } 7 | 8 | .QFrame{ 9 | border:1px solid #B2B6B9; 10 | border-radius:5px; 11 | } 12 | 13 | QLabel,QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox,QGroupBox,QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox,QTreeView,QListView,QTableView,QTabWidget::pane{ 14 | color:#000000; 15 | } 16 | 17 | QWidget#widget_title,QWidget#widget_left{ 18 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 19 | } 20 | 21 | QLabel#lab_Ico,QLabel#lab_Title{ 22 | border-radius:0px; 23 | color:#000000; 24 | background-color:rgba(0,0,0,0); 25 | border-style:none; 26 | } 27 | 28 | QWidget#widget_top>QToolButton::menu-indicator{ 29 | image:None; 30 | } 31 | 32 | QWidget#widget_top>QToolButton{ 33 | border-style:none; 34 | padding:10px; 35 | color:#000000; 36 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 37 | } 38 | 39 | QWidget#widget_top>QToolButton:hover,QWidget#widget_top>QToolButton:checked{ 40 | border-style:solid; 41 | border-bottom-width:2px; 42 | border-bottom-color:rgba(238,0,0,128); 43 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F3F4,stop:1 #E7E9EB); 44 | } 45 | 46 | QLabel[labVideo="true"]{ 47 | color:#000000; 48 | border:1px solid #B2B6B9; 49 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 50 | } 51 | 52 | QLabel[labVideo="true"]:focus{ 53 | border:1px solid #FF0000; 54 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F3F4,stop:1 #E7E9EB); 55 | } 56 | 57 | QLineEdit,QTextEdit,QPlainTextEdit,QSpinBox{ 58 | border:1px solid #B2B6B9; 59 | border-radius:5px; 60 | padding:2px; 61 | background:none; 62 | selection-background-color:#E1E4E6; 63 | selection-color:#000000; 64 | } 65 | 66 | QLineEdit[echoMode="2"]{ 67 | lineedit-password-character:9679; 68 | } 69 | 70 | .QGroupBox{ 71 | border:1px solid #B2B6B9; 72 | border-radius:5px; 73 | } 74 | 75 | .QPushButton{ 76 | border-style:none; 77 | border:1px solid #B2B6B9; 78 | color:#000000; 79 | padding:5px; 80 | min-height:20px; 81 | border-radius:5px; 82 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 83 | } 84 | 85 | .QPushButton:hover{ 86 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F3F4,stop:1 #E7E9EB); 87 | } 88 | 89 | .QPushButton:pressed{ 90 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 91 | } 92 | 93 | .QPushButton:disabled{ 94 | color:#838383; 95 | background:#F4F4F4; 96 | } 97 | 98 | QPushButton#btnSplitterH{ 99 | padding:2px; 100 | min-height:8px; 101 | } 102 | 103 | QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close,QPushButton#btnSplitterV,QPushButton#btnSplitterH{ 104 | border-radius:0px; 105 | color:#000000; 106 | background-color:rgba(0,0,0,0); 107 | border-style:none; 108 | } 109 | 110 | QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover,QPushButton#btnSplitterV:hover,QPushButton#btnSplitterH:hover{ 111 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(25,134,199,0),stop:1 #F2F3F4); 112 | } 113 | 114 | QPushButton#btnMenu_Close:hover{ 115 | background-color:qlineargradient(spread:pad,x1:0,y1:1,x2:0,y2:0,stop:0 rgba(238,0,0,128),stop:1 rgba(238,44,44,255)); 116 | } 117 | 118 | QWidget#widget_left>QPushButton{ 119 | border-radius:0px; 120 | color:#000000; 121 | background-color:rgba(0,0,0,0); 122 | border-style:none; 123 | } 124 | 125 | QWidget#widget_left>QPushButton:hover{ 126 | background-color:rgba(238,0,0,128); 127 | } 128 | 129 | QWidget#widget_left>QPushButton:pressed,QWidget#widget_left>QPushButton:checked{ 130 | color:#000000; 131 | background-color:rgba(250,255,255,255); 132 | } 133 | 134 | QCheckBox{ 135 | color:#000000; 136 | spacing:2px; 137 | } 138 | 139 | QCheckBox::indicator{ 140 | width:20px; 141 | height:20px; 142 | } 143 | 144 | QCheckBox::indicator:unchecked{ 145 | image:url(:/image/checkbox_unchecked.png); 146 | } 147 | 148 | QCheckBox::indicator:checked{ 149 | image:url(:/image/checkbox_checked.png); 150 | } 151 | 152 | QRadioButton{ 153 | color:#000000; 154 | spacing:2px; 155 | } 156 | 157 | QRadioButton::indicator{ 158 | width:15px; 159 | height:15px; 160 | } 161 | 162 | QRadioButton::indicator::unchecked{ 163 | image:url(:/image/radio_normal.png); 164 | } 165 | 166 | QRadioButton::indicator::checked{ 167 | image:url(:/image/radio_selected.png); 168 | } 169 | 170 | QSpinBox::up-button,QDateEdit::up-button,QTimeEdit::up-button,QDateTimeEdit::up-button{ 171 | image:url(:/image/add_top.png); 172 | } 173 | 174 | QSpinBox::down-button,QDateEdit::down-button,QTimeEdit::down-button,QDateTimeEdit::down-button{ 175 | image:url(:/image/add_bottom.png); 176 | } 177 | 178 | QComboBox,QDateEdit,QTimeEdit,QDateTimeEdit,QSpinBox{ 179 | border-radius:3px; 180 | padding:3px 5px 3px 5px; 181 | border:1px solid #B2B6B9; 182 | background:none; 183 | selection-background-color:#E1E4E6; 184 | selection-color:#000000; 185 | } 186 | 187 | QComboBox::drop-down,QDateEdit::drop-down,QTimeEdit::drop-down,QDateTimeEdit::drop-down{ 188 | subcontrol-origin:padding; 189 | subcontrol-position:top right; 190 | width:15px; 191 | border-left-width:1px; 192 | border-left-style:solid; 193 | border-top-right-radius:3px; 194 | border-bottom-right-radius:3px; 195 | border-left-color:#B2B6B9; 196 | } 197 | 198 | QComboBox::down-arrow,QDateEdit::down-arrow,QTimeEdit::down-arrow,QDateTimeEdit::down-arrow{ 199 | image:url(:/image/add_bottom.png); 200 | } 201 | 202 | QMenu{ 203 | color:#000000; 204 | background-color:#E1E4E6; 205 | margin:2px; 206 | } 207 | 208 | QMenu::item{ 209 | padding:3px 20px 3px 20px; 210 | } 211 | 212 | QMenu::indicator{ 213 | width:13px; 214 | height:13px; 215 | } 216 | 217 | QMenu::item:selected{ 218 | color:#000000; 219 | border:0px solid #B2B6B9; 220 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 221 | } 222 | 223 | QMenu::separator{ 224 | height:1px; 225 | background:#B2B6B9; 226 | } 227 | 228 | QProgressBar{ 229 | background:#E1E4E6; 230 | border-radius:5px; 231 | text-align:center; 232 | border:1px solid #B2B6B9; 233 | } 234 | 235 | QProgressBar::chunk{ 236 | width:5px; 237 | margin:0.5px; 238 | background-color:#B2B6B9; 239 | } 240 | 241 | QSlider::groove:horizontal,QSlider::add-page:horizontal{ 242 | height:8px; 243 | border-radius:3px; 244 | background:#B2B6B9; 245 | } 246 | 247 | QSlider::sub-page:horizontal{ 248 | height:8px; 249 | border-radius:3px; 250 | background:#787878; 251 | } 252 | 253 | QSlider::handle:horizontal{ 254 | width:13px; 255 | margin-top:-3px; 256 | margin-bottom:-3px; 257 | border-radius:6px; 258 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FFFFFF,stop:0.8 #B2B6B9); 259 | } 260 | 261 | QSlider::groove:vertical,QSlider::sub-page:vertical{ 262 | width:8px; 263 | border-radius:3px; 264 | background:#B2B6B9; 265 | } 266 | 267 | QSlider::add-page:vertical{ 268 | width:8px; 269 | border-radius:3px; 270 | background:#787878; 271 | } 272 | 273 | QSlider::handle:vertical{ 274 | height:13px; 275 | margin-left:-2px; 276 | margin-right:-3px; 277 | border-radius:6px; 278 | background:qradialgradient(spread:pad,cx:0.5,cy:0.5,radius:0.5,fx:0.5,fy:0.5,stop:0.6 #FFFFFF,stop:0.8 #B2B6B9); 279 | } 280 | 281 | QScrollBar:vertical{ 282 | width:10px; 283 | background-color:rgba(0,0,0,0%); 284 | padding-top:10px; 285 | padding-bottom:10px; 286 | } 287 | 288 | QScrollBar:horizontal{ 289 | height:10px; 290 | background-color:rgba(0,0,0,0%); 291 | padding-left:10px; 292 | padding-right:10px; 293 | } 294 | 295 | QScrollBar::handle:vertical,QScrollBar::handle:horizontal{ 296 | width:10px; 297 | background:#CCD3D9; 298 | } 299 | 300 | QScrollBar::handle:vertical:hover,QScrollBar::handle:horizontal:hover{ 301 | width:10px; 302 | background:#E7E9EB; 303 | } 304 | 305 | QScrollBar::add-line:vertical{ 306 | height:10px; 307 | width:10px; 308 | subcontrol-position:bottom; 309 | subcontrol-origin:margin; 310 | border-border-image:url(:/image/add_bottom.png); 311 | } 312 | 313 | QScrollBar::add-line:horizontal{ 314 | height:10px; 315 | width:10px; 316 | subcontrol-position:right; 317 | subcontrol-origin:margin; 318 | border-image:url(:/image/add_right.png); 319 | } 320 | 321 | QScrollBar::sub-line:vertical{ 322 | height:10px; 323 | width:10px; 324 | subcontrol-position:top; 325 | subcontrol-origin:margin; 326 | border-image:url(:/image/add_top.png); 327 | } 328 | 329 | QScrollBar::sub-line:horizontal{ 330 | height:10px; 331 | width:10px; 332 | subcontrol-position:left; 333 | subcontrol-origin:margin; 334 | image:url(:/image/add_left.png); 335 | } 336 | 337 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical,QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal{ 338 | width:10px; 339 | background:#B2B6B9; 340 | } 341 | 342 | QScrollArea{ 343 | border:0px; 344 | } 345 | 346 | QTreeView,QListView,QTableView,QTabWidget::pane{ 347 | border:1px solid #B2B6B9; 348 | selection-background-color:#F2F3F4; 349 | selection-color:#000000; 350 | alternate-background-color:#E7E9EB; 351 | } 352 | 353 | QTableView::item:selected,QListView::item:selected,QTreeView::item:selected{ 354 | color:#000000; 355 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 356 | } 357 | 358 | QTableView::item:hover,QListView::item:hover,QTreeView::item:hover{ 359 | color:#000000; 360 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F3F4,stop:1 #E7E9EB); 361 | } 362 | 363 | QTableView::item,QListView::item,QTreeView::item{ 364 | padding:5px; 365 | margin:0px; 366 | } 367 | 368 | QHeaderView::section,QTableCornerButton:section{ 369 | padding:3px; 370 | margin:0px; 371 | color:#000000; 372 | border:1px solid #B2B6B9; 373 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F3F4,stop:1 #E7E9EB); 374 | } 375 | 376 | QTabBar::tab{ 377 | border-radius:5px; 378 | border:1px solid #B2B6B9; 379 | color:#000000; 380 | min-width:55px; 381 | min-height:20px; 382 | padding:3px 8px 3px 8px; 383 | margin:1px; 384 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F3F4,stop:1 #E7E9EB); 385 | } 386 | 387 | QTabBar::tab:selected,QTabBar::tab:hover{ 388 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 389 | } 390 | 391 | QStatusBar::item{ 392 | border:0px solid #E1E4E6; 393 | border-radius:3px; 394 | } 395 | 396 | QToolBox::tab,QToolTip,QGroupBox#gboxDevicePanel{ 397 | padding:3px; 398 | border-radius: 5px; 399 | color:#000000; 400 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #E1E4E6,stop:1 #CCD3D9); 401 | } 402 | 403 | QToolBox::tab:selected{ 404 | background:qlineargradient(spread:pad,x1:0,y1:0,x2:0,y2:1,stop:0 #F2F3F4,stop:1 #E7E9EB); 405 | } 406 | -------------------------------------------------------------------------------- /other/rc.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | image/add_bottom.png 4 | image/add_left.png 5 | image/add_right.png 6 | image/add_top.png 7 | image/btn_close.png 8 | image/btn_ok.png 9 | image/checkbox_checked.png 10 | image/checkbox_unchecked.png 11 | image/Font Awesome Cheatsheet.png 12 | image/fontawesome-webfont.ttf 13 | image/msg_error.png 14 | image/msg_info.png 15 | image/msg_question.png 16 | image/qt_zh_CN.qm 17 | image/radio_normal.png 18 | image/radio_selected.png 19 | qss/black.css 20 | qss/blue.css 21 | qss/brown.css 22 | qss/darkgray.css 23 | qss/dev.css 24 | qss/gray.css 25 | qss/lightgray.css 26 | qss/silvery.css 27 | image/join.png 28 | image/add.png 29 | image/look.png 30 | image/bg_main.png 31 | image/setting.png 32 | image/profile.png 33 | image/join_2.png 34 | image/look_2.png 35 | image/add_2.png 36 | image/title.png 37 | image/icon.png 38 | 39 | 40 | -------------------------------------------------------------------------------- /screenshots/0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/screenshots/0.jpg -------------------------------------------------------------------------------- /screenshots/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/screenshots/1.jpg -------------------------------------------------------------------------------- /screenshots/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/screenshots/2.jpg -------------------------------------------------------------------------------- /screenshots/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/screenshots/3.jpg -------------------------------------------------------------------------------- /screenshots/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/screenshots/4.jpg -------------------------------------------------------------------------------- /screenshots/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/screenshots/5.jpg -------------------------------------------------------------------------------- /screenshots/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/screenshots/6.jpg -------------------------------------------------------------------------------- /screenshots/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/klob/CDoc/52f0edaecd69f2aeec9856c473a867bab306f4b8/screenshots/icon.png -------------------------------------------------------------------------------- /tool/exportexcelobject.cpp: -------------------------------------------------------------------------------- 1 | #include "exportexcelobject.h" 2 | #include 3 | #include 4 | #include 5 | 6 | /* 7 | * 用QODBC 链接Excel 8 | * 然后对QTableView执行SQL语句来处理数据 9 | */ 10 | 11 | 12 | int ExportExcelObject::export2Excel() 13 | { 14 | if(fieldList.size() <= 0) 15 | { 16 | qDebug() << "ExportExcelObject::export2Excel failed: No fields defined."; 17 | return -1; 18 | } 19 | 20 | QSqlDatabase db = QSqlDatabase::addDatabase("QODBC", "excelexport"); 21 | if(!db.isValid()) 22 | { 23 | qDebug() << "ExportExcelObject::export2Excel failed: QODBC not supported."; 24 | return -2; 25 | } 26 | // set the dsn string 27 | QString dsn = QString("DRIVER={Microsoft Excel Driver (*.xls)};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%1\";DBQ=%2"). 28 | arg(excelFilePath).arg(excelFilePath); 29 | db.setDatabaseName(dsn); 30 | if(!db.open()) 31 | { 32 | qDebug() << "ExportExcelObject::export2Excel failed: Create Excel file failed by DRIVER={Microsoft Excel Driver (*.xls)}."; 33 | //QSqlDatabase::removeDatabase("excelexport"); 34 | return -3; 35 | } 36 | 37 | QSqlQuery query(db); 38 | 39 | //drop the table if it's already exists 40 | QString s, sSql = QString("DROP TABLE [%1] (").arg(sheetName); 41 | query.exec(sSql); 42 | 43 | //create the table (sheet in Excel file) 44 | sSql = QString("CREATE TABLE [%1] (").arg(sheetName); 45 | for (int i = 0; i < fieldList.size(); i++) 46 | { 47 | s = QString("[%1] %2").arg(fieldList.at(i)->sFieldName).arg(fieldList.at(i)->sFieldType); 48 | sSql += s; 49 | if(i < fieldList.size() - 1) 50 | sSql += " , "; 51 | } 52 | 53 | sSql += ")"; 54 | query.prepare(sSql); 55 | 56 | if(!query.exec()) 57 | { 58 | qDebug() << "ExportExcelObject::export2Excel failed: Create Excel sheet failed."; 59 | //db.close(); 60 | //QSqlDatabase::removeDatabase("excelexport"); 61 | return -4; 62 | } 63 | 64 | //add all rows 65 | sSql = QString("INSERT INTO [%1] (").arg(sheetName); 66 | for (int i = 0; i < fieldList.size(); i++) 67 | { 68 | sSql += fieldList.at(i)->sFieldName; 69 | if(i < fieldList.size() - 1) 70 | sSql += " , "; 71 | } 72 | sSql += ") VALUES ("; 73 | for (int i = 0; i < fieldList.size(); i++) 74 | { 75 | sSql += QString(":data%1").arg(i); 76 | if(i < fieldList.size() - 1) 77 | sSql += " , "; 78 | } 79 | sSql += ")"; 80 | 81 | qDebug() << sSql; 82 | 83 | int r, iRet = 0; 84 | for(r = 0 ; r < tableView->model()->rowCount() ; r++) 85 | { 86 | query.prepare(sSql); 87 | for (int c = 0; c < fieldList.size(); c++) 88 | { 89 | query.bindValue(QString(":data%1").arg(c), tableView->model()->data(tableView->model()->index(r, fieldList.at(c)->iCol))); 90 | } 91 | 92 | if(query.exec()) 93 | iRet++; 94 | 95 | if(r % 10 == 0) 96 | emit exportedRowCount(r); 97 | } 98 | 99 | emit exportedRowCount(r); 100 | 101 | return iRet; 102 | } 103 | -------------------------------------------------------------------------------- /tool/exportexcelobject.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | 3 | #ifndef EXPORTEXCELOBJECT_H 4 | #define EXPORTEXCELOBJECT_H 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class EEO_Field 12 | { 13 | public: 14 | EEO_Field(const int ic, const QString &sf, const QString &st): 15 | iCol(ic),sFieldName(sf),sFieldType(st){} 16 | 17 | int iCol; 18 | QString sFieldName; 19 | QString sFieldType; 20 | }; 21 | 22 | class ExportExcelObject : public QObject 23 | { 24 | Q_OBJECT 25 | public: 26 | ExportExcelObject(const QString &filepath, const QString &sheettitle, 27 | QTableView *tableview):excelFilePath(filepath), 28 | sheetName(sheettitle), tableView(tableview){} 29 | 30 | ~ExportExcelObject() {QSqlDatabase::removeDatabase("excelexport");} 31 | 32 | public: 33 | void setOutputFilePath(const QString &spath) 34 | {excelFilePath = spath;} 35 | void setOutputSheetTitle(const QString &ssheet) 36 | {sheetName = ssheet;} 37 | void setTableView(QTableView *tableview) 38 | {tableView = tableview;} 39 | 40 | void addField(const int iCol, const QString &fieldname, const QString &fieldtype) 41 | {fieldList << new EEO_Field(iCol, fieldname, fieldtype);} 42 | 43 | void removeAllFields() 44 | {while (!fieldList.isEmpty()) delete fieldList.takeFirst();} 45 | 46 | int export2Excel(); 47 | 48 | signals: 49 | void exportedRowCount(int row); 50 | 51 | private: 52 | QString excelFilePath; 53 | QString sheetName; 54 | QTableView *tableView; 55 | QList fieldList; 56 | }; 57 | 58 | #endif // EXPORTEXCELOBJECT_H 59 | -------------------------------------------------------------------------------- /tool/l.cpp: -------------------------------------------------------------------------------- 1 | #include"l.h" 2 | 3 | /* 4 | * log 5 | */ 6 | L::L(){} 7 | 8 | L::~L(){} 9 | QString L::DOT=","; 10 | 11 | void L::i(QString str){ 12 | qDebug()<<"info "< 4 | #include 5 | 6 | using namespace std; 7 | 8 | class L 9 | { 10 | private: 11 | L(); 12 | public: 13 | 14 | ~L(); 15 | static void e(QString str); 16 | static void d(QString str); 17 | static void i(QString str); 18 | 19 | static void e(QString tag,QString str); 20 | static void d(QString tag,QString str); 21 | static void i(QString tag,QString str); 22 | 23 | 24 | 25 | static QString wraper(QString str); 26 | static QString wraper(int id); 27 | static QString w(QString str); 28 | static QString w(int id); 29 | static QString wd(QString str); 30 | static QString wd(int id); 31 | 32 | static QString DOT ; 33 | /* 34 | 35 | static void e(string str); 36 | static void d(string str); 37 | static void i(string str); 38 | static void e(string tag,string str); 39 | static void d(string tag,string str); 40 | static void i(string tag,string str); 41 | */ 42 | }; 43 | #endif // L_H 44 | 45 | 46 | /* 47 | l.cpp 48 | */ 49 | 50 | 51 | -------------------------------------------------------------------------------- /tool/sql.h: -------------------------------------------------------------------------------- 1 | #ifndef SQL 2 | #define SQL 3 | 4 | #include"QVariant" 5 | #include"QVariantList" 6 | #include"QLinkedList" 7 | #include"QList" 8 | #include"QSqlRecord" 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include"l.h" 16 | #endif // SQL 17 | 18 | -------------------------------------------------------------------------------- /tool/text.h: -------------------------------------------------------------------------------- 1 | #ifndef TEXT_H 2 | #define TEXT_H 3 | 4 | #include 5 | #include"string" 6 | #include 7 | #include"iostream" 8 | #include 9 | #include"l.h" 10 | using namespace std; 11 | #endif // TEXT_H 12 | 13 | -------------------------------------------------------------------------------- /widget/frminputbox.cpp: -------------------------------------------------------------------------------- 1 | #include "frminputbox.h" 2 | #include "ui_frminputbox.h" 3 | #include "app/myhelper.h" 4 | 5 | /* 6 | * 自定义输入消息框 7 | */ 8 | FrmInputBox::FrmInputBox(QWidget *parent) : 9 | QDialog(parent), 10 | ui(new Ui::FrmInputBox) 11 | { 12 | ui->setupUi(this); 13 | this->InitStyle(); 14 | MyHelper::FormInCenter(this); 15 | } 16 | 17 | FrmInputBox::~FrmInputBox() 18 | { 19 | delete ui; 20 | } 21 | 22 | /* 23 | * 初始化窗体 24 | */ 25 | void FrmInputBox::InitStyle() 26 | { 27 | this->setProperty("Form", true); 28 | this->setProperty("CanMove", true); 29 | this->setWindowTitle(ui->lab_Title->text()); 30 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 31 | IconHelper::Instance()->SetIcoMain(ui->lab_Ico); 32 | IconHelper::Instance()->SetIcoClose(ui->btnMenu_Close); 33 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 34 | connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(close())); 35 | } 36 | 37 | void FrmInputBox::SetMessage(QString title) 38 | { 39 | ui->labInfo->setText(title); 40 | } 41 | 42 | void FrmInputBox::on_btnOk_clicked() 43 | { 44 | value = ui->txtValue->text(); 45 | done(1); 46 | this->close(); 47 | } 48 | -------------------------------------------------------------------------------- /widget/frminputbox.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMINPUTBOX_H 2 | #define FRMINPUTBOX_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class FrmInputBox; 9 | } 10 | 11 | class FrmInputBox : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit FrmInputBox(QWidget *parent = 0); 17 | ~FrmInputBox(); 18 | 19 | void SetMessage(QString title); 20 | QString GetValue()const { 21 | return value; 22 | } 23 | 24 | private slots: 25 | void on_btnOk_clicked(); 26 | 27 | private: 28 | Ui::FrmInputBox *ui; 29 | 30 | void InitStyle(); //初始化无边框窗体 31 | 32 | QString value; 33 | }; 34 | 35 | #endif // FRMINPUTBOX_H 36 | -------------------------------------------------------------------------------- /widget/frminputbox.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | FrmInputBox 4 | 5 | 6 | 7 | 0 8 | 0 9 | 260 10 | 140 11 | 12 | 13 | 14 | 15 | 0 16 | 17 | 18 | 1 19 | 20 | 21 | 1 22 | 23 | 24 | 1 25 | 26 | 27 | 1 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 36 | 37 | 38 | 39 | 100 40 | 28 41 | 42 | 43 | 44 | 45 | 0 46 | 47 | 48 | 0 49 | 50 | 51 | 0 52 | 53 | 54 | 0 55 | 56 | 57 | 0 58 | 59 | 60 | 61 | 62 | 63 | 0 64 | 0 65 | 66 | 67 | 68 | 69 | 31 70 | 0 71 | 72 | 73 | 74 | 75 | 76 | 77 | Qt::AlignCenter 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 0 86 | 0 87 | 88 | 89 | 90 | 91 | 92 | 93 | 输入框 94 | 95 | 96 | Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 0 105 | 0 106 | 107 | 108 | 109 | 110 | 0 111 | 112 | 113 | 0 114 | 115 | 116 | 0 117 | 118 | 119 | 0 120 | 121 | 122 | 0 123 | 124 | 125 | 126 | 127 | 128 | 0 129 | 0 130 | 131 | 132 | 133 | 134 | 40 135 | 0 136 | 137 | 138 | 139 | ArrowCursor 140 | 141 | 142 | Qt::NoFocus 143 | 144 | 145 | 关闭 146 | 147 | 148 | 149 | 150 | 151 | true 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 5 169 | 170 | 171 | 5 172 | 173 | 174 | 5 175 | 176 | 177 | 5 178 | 179 | 180 | 5 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 请输入: 192 | 193 | 194 | false 195 | 196 | 197 | true 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | Qt::Horizontal 210 | 211 | 212 | 213 | 40 214 | 20 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | PointingHandCursor 223 | 224 | 225 | Qt::StrongFocus 226 | 227 | 228 | 229 | 230 | 231 | 确定(&O) 232 | 233 | 234 | 235 | :/image/btn_ok.png:/image/btn_ok.png 236 | 237 | 238 | 239 | 20 240 | 20 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | PointingHandCursor 249 | 250 | 251 | Qt::StrongFocus 252 | 253 | 254 | 255 | 256 | 257 | 取消(&C) 258 | 259 | 260 | 261 | :/image/btn_close.png:/image/btn_close.png 262 | 263 | 264 | 265 | 20 266 | 20 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | txtValue 283 | btnOk 284 | btnCancel 285 | 286 | 287 | 288 | 289 | 290 | 291 | -------------------------------------------------------------------------------- /widget/frmmessagebox.cpp: -------------------------------------------------------------------------------- 1 | #include "frmmessagebox.h" 2 | #include "ui_frmmessagebox.h" 3 | #include "app/myhelper.h" 4 | /* 5 | * 自定义消息框 6 | */ 7 | FrmMessageBox::FrmMessageBox(QWidget *parent) : 8 | QDialog(parent), 9 | ui(new Ui::FrmMessageBox) 10 | { 11 | ui->setupUi(this); 12 | this->InitStyle(); 13 | MyHelper::FormInCenter(this); 14 | } 15 | 16 | FrmMessageBox::~FrmMessageBox() 17 | { 18 | delete ui; 19 | } 20 | 21 | void FrmMessageBox::InitStyle() 22 | { 23 | this->setProperty("Form", true); 24 | this->setProperty("CanMove", true); 25 | this->setWindowTitle(ui->lab_Title->text()); 26 | this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint); 27 | IconHelper::Instance()->SetIcoMain(ui->lab_Ico); 28 | IconHelper::Instance()->SetIcoClose(ui->btnMenu_Close); 29 | connect(ui->btnMenu_Close, SIGNAL(clicked()), this, SLOT(close())); 30 | connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(close())); 31 | } 32 | 33 | void FrmMessageBox::SetMessage(QString msg, int type) 34 | { 35 | if (type == 0) { 36 | ui->labIcoMain->setStyleSheet("border-image: url(:/image/msg_info.png);"); 37 | ui->btnCancel->setVisible(false); 38 | ui->lab_Title->setText("提示"); 39 | } else if (type == 1) { 40 | ui->labIcoMain->setStyleSheet("border-image: url(:/image/msg_question.png);"); 41 | ui->lab_Title->setText("询问"); 42 | } else if (type == 2) { 43 | ui->labIcoMain->setStyleSheet("border-image: url(:/image/msg_error.png);"); 44 | ui->btnCancel->setVisible(false); 45 | ui->lab_Title->setText("错误"); 46 | } 47 | 48 | ui->labInfo->setText(msg); 49 | this->setWindowTitle(ui->lab_Title->text()); 50 | } 51 | 52 | void FrmMessageBox::on_btnOk_clicked() 53 | { 54 | done(1); 55 | this->close(); 56 | } 57 | -------------------------------------------------------------------------------- /widget/frmmessagebox.h: -------------------------------------------------------------------------------- 1 | #ifndef FRMMESSAGEBOX_H 2 | #define FRMMESSAGEBOX_H 3 | 4 | #include 5 | 6 | namespace Ui 7 | { 8 | class FrmMessageBox; 9 | } 10 | 11 | class FrmMessageBox : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit FrmMessageBox(QWidget *parent = 0); 17 | ~FrmMessageBox(); 18 | 19 | void SetMessage(QString msg, int type); 20 | 21 | private slots: 22 | void on_btnOk_clicked(); 23 | 24 | private: 25 | Ui::FrmMessageBox *ui; 26 | 27 | void InitStyle(); //初始化无边框窗体 28 | }; 29 | 30 | #endif // FRMMESSAGEBOX_H 31 | --------------------------------------------------------------------------------