├── .gitignore ├── LICENSE ├── README.md ├── Students ├── Resources.qrc ├── Students.pro ├── datadictionary.cpp ├── datadictionary.h ├── datadictionary.ui ├── debt.cpp ├── debt.h ├── debt.ui ├── grade.cpp ├── grade.h ├── grade.ui ├── honor.cpp ├── honor.h ├── honor.ui ├── images │ ├── add.png │ ├── cancel.png │ ├── exit.png │ ├── login_bg.png │ ├── open.png │ ├── save.png │ └── windowIcon.png ├── login.cpp ├── login.h ├── login.ui ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── options.cpp ├── options.h ├── options.ui ├── punish.cpp ├── punish.h ├── punish.ui ├── scholarship.cpp ├── scholarship.h ├── scholarship.ui ├── studentinfo.cpp ├── studentinfo.h ├── studentinfo.ui ├── styles │ └── qss │ │ ├── AMOLED.qss │ │ ├── Aqua.qss │ │ ├── ConsoleStyle.qss │ │ ├── ElegantDark.qss │ │ ├── LICENSE │ │ ├── MacOS.qss │ │ ├── ManjaroMix.qss │ │ ├── MaterialDark.qss │ │ ├── NeonButtons.qss │ │ └── Ubuntu.qss ├── user.cpp ├── user.h ├── user.ui ├── usercontrol.cpp ├── usercontrol.h └── usercontrol.ui ├── students.sql └── 导入导出格式参考.xls /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # C-Qt-StudentManagementSystem-Multi-Users 2 | C++Qt高级项目 学生管理系统 多用户 3 | 4 | 界面和功能仿照YouTube上一位老外的,不过他用的是pascal。 5 | 链接:https://www.youtube.com/watch?v=IosfT8ZzOTI 6 | 7 | ps1:运行前请确保当前Qt版本能正常连接MySQL数据库,导入数据库文件,main.cpp里可以更改数据库连接相关信息。 8 | 9 | ps2:支持Qt版本:5.14,低于该版本可能会因为某些函数无法编译成功,需要替换。 10 | 11 | ps3:目前已知未完成功能:操作记录,头像(其实是懒)。 12 | 13 | ![image](https://user-images.githubusercontent.com/74124438/116393387-249e3780-a854-11eb-948e-ac45454feadb.png) 14 | 15 | ![image](https://user-images.githubusercontent.com/74124438/116389534-a0e24c00-a84f-11eb-9ec0-134b74871449.png) 16 | 17 | ![image](https://user-images.githubusercontent.com/74124438/116389652-c4a59200-a84f-11eb-8d06-4bae7be1fdee.png) 18 | 19 | ![image](https://user-images.githubusercontent.com/74124438/116389717-dab35280-a84f-11eb-8de4-f3783e7d8a4c.png) 20 | 21 | ![image](https://user-images.githubusercontent.com/74124438/116389827-fc143e80-a84f-11eb-8931-f74e0fda855e.png) 22 | 23 | ![image](https://user-images.githubusercontent.com/74124438/116390070-42699d80-a850-11eb-97b4-f9a47b726d04.png) 24 | 25 | -------------------------------------------------------------------------------- /Students/Resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | images/login_bg.png 5 | images/add.png 6 | images/open.png 7 | images/cancel.png 8 | images/exit.png 9 | images/save.png 10 | images/windowIcon.png 11 | styles/qss/AMOLED.qss 12 | styles/qss/Aqua.qss 13 | styles/qss/ConsoleStyle.qss 14 | styles/qss/ElegantDark.qss 15 | styles/qss/LICENSE 16 | styles/qss/MacOS.qss 17 | styles/qss/ManjaroMix.qss 18 | styles/qss/MaterialDark.qss 19 | styles/qss/NeonButtons.qss 20 | styles/qss/Ubuntu.qss 21 | 22 | 23 | -------------------------------------------------------------------------------- /Students/Students.pro: -------------------------------------------------------------------------------- 1 | QT += core gui sql axcontainer charts 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++11 6 | 7 | # The following define makes your compiler emit warnings if you use 8 | # any Qt feature that has been marked deprecated (the exact warnings 9 | # depend on your compiler). Please consult the documentation of the 10 | # deprecated API in order to know how to port your code away from it. 11 | DEFINES += QT_DEPRECATED_WARNINGS 12 | 13 | # You can also make your code fail to compile if it uses deprecated APIs. 14 | # In order to do so, uncomment the following line. 15 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 16 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 17 | 18 | SOURCES += \ 19 | datadictionary.cpp \ 20 | debt.cpp \ 21 | grade.cpp \ 22 | honor.cpp \ 23 | login.cpp \ 24 | main.cpp \ 25 | mainwindow.cpp \ 26 | options.cpp \ 27 | punish.cpp \ 28 | scholarship.cpp \ 29 | studentinfo.cpp \ 30 | user.cpp \ 31 | usercontrol.cpp 32 | 33 | HEADERS += \ 34 | datadictionary.h \ 35 | debt.h \ 36 | grade.h \ 37 | honor.h \ 38 | login.h \ 39 | mainwindow.h \ 40 | options.h \ 41 | punish.h \ 42 | scholarship.h \ 43 | studentinfo.h \ 44 | user.h \ 45 | usercontrol.h 46 | 47 | FORMS += \ 48 | datadictionary.ui \ 49 | debt.ui \ 50 | grade.ui \ 51 | honor.ui \ 52 | login.ui \ 53 | mainwindow.ui \ 54 | options.ui \ 55 | punish.ui \ 56 | scholarship.ui \ 57 | studentinfo.ui \ 58 | user.ui \ 59 | usercontrol.ui 60 | 61 | # Default rules for deployment. 62 | qnx: target.path = /tmp/$${TARGET}/bin 63 | else: unix:!android: target.path = /opt/$${TARGET}/bin 64 | !isEmpty(target.path): INSTALLS += target 65 | 66 | RESOURCES += \ 67 | Resources.qrc 68 | -------------------------------------------------------------------------------- /Students/datadictionary.h: -------------------------------------------------------------------------------- 1 | #ifndef DATADICTIONARY_H 2 | #define DATADICTIONARY_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Ui { 11 | class DataDictionary; 12 | } 13 | 14 | class DataDictionary : public QMainWindow 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit DataDictionary(QString username,QWidget *parent = nullptr); 20 | ~DataDictionary(); 21 | 22 | void updataData_nation(); 23 | void updataData_political(); 24 | void updataData_province(); 25 | void updataData_city(); 26 | void updataData_university(); 27 | void updataData_college(); 28 | void updataData_profession(); 29 | void updataData_status(); 30 | void updataData_socialStatus(); 31 | void updataData_blood(); 32 | void updataData_eye(); 33 | void updataData_skin(); 34 | void updataData_subject(); 35 | void updataData_year(); 36 | void updataData_semester(); 37 | void updataData_typeOfExam(); 38 | 39 | private: 40 | Ui::DataDictionary *ui; 41 | QSqlDatabase db; 42 | QSqlQuery *query; 43 | QString username; 44 | QString read; 45 | QString write; 46 | QString remove; 47 | QString search; 48 | QString print; 49 | QString import; 50 | QString admin; 51 | 52 | signals: 53 | void needUpdataData(); //接收者StudentInfo类 54 | 55 | private slots: 56 | void clickPushButton_addNation(); 57 | void clickPushButton_editNation(); 58 | void clickPushButton_deleteNation(); 59 | 60 | void clickPushButton_addPolitical(); 61 | void clickPushButton_editPolitical(); 62 | void clickPushButton_deletePolitical(); 63 | 64 | void clickPushButton_addProvince(); 65 | void clickPushButton_editProvince(); 66 | void clickPushButton_deleteProvince(); 67 | 68 | void clickPushButton_addCity(); 69 | void clickPushButton_editCity(); 70 | void clickPushButton_deleteCity(); 71 | 72 | void clickPushButton_addUniversity(); 73 | void clickPushButton_editUniversity(); 74 | void clickPushButton_deleteUniversity(); 75 | 76 | void clickPushButton_addCollege(); 77 | void clickPushButton_editCollege(); 78 | void clickPushButton_deleteCollege(); 79 | 80 | void clickPushButton_addProfession(); 81 | void clickPushButton_editProfession(); 82 | void clickPushButton_deleteProfession(); 83 | 84 | void clickPushButton_addStatus(); 85 | void clickPushButton_editStatus(); 86 | void clickPushButton_deleteStatus(); 87 | 88 | void clickPushButton_addSocialStatus(); 89 | void clickPushButton_editSocialStatus(); 90 | void clickPushButton_deleteSocialStatus(); 91 | 92 | void clickPushButton_addBlood(); 93 | void clickPushButton_editBlood(); 94 | void clickPushButton_deleteBlood(); 95 | 96 | void clickPushButton_addEye(); 97 | void clickPushButton_editEye(); 98 | void clickPushButton_deleteEye(); 99 | 100 | void clickPushButton_addSkin(); 101 | void clickPushButton_editSkin(); 102 | void clickPushButton_deleteSkin(); 103 | 104 | void clickPushButton_addSubject(); 105 | void clickPushButton_editSubject(); 106 | void clickPushButton_deleteSubject(); 107 | 108 | void clickPushButton_addYear(); 109 | void clickPushButton_editYear(); 110 | void clickPushButton_deleteYear(); 111 | 112 | void clickPushButton_addSemester(); 113 | void clickPushButton_editSemester(); 114 | void clickPushButton_deleteSemester(); 115 | 116 | void clickPushButton_addTypeOfExam(); 117 | void clickPushButton_editTypeOfExam(); 118 | void clickPushButton_deleteTypeOfExam(); 119 | }; 120 | 121 | #endif // DATADICTIONARY_H 122 | -------------------------------------------------------------------------------- /Students/debt.cpp: -------------------------------------------------------------------------------- 1 | #include "debt.h" 2 | #include "ui_debt.h" 3 | 4 | Debt::Debt(QString number,QString time,int flag,QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::Debt),number(number),time(time),flag(flag) 7 | { 8 | ui->setupUi(this); 9 | 10 | db = QSqlDatabase::database("conn"); 11 | query=new QSqlQuery(db); 12 | 13 | ui->checkBox->setChecked(true); 14 | ui->dateEdit->setEnabled(false); 15 | ui->dateEdit->setDate(QDate::currentDate()); 16 | 17 | ui->comboBox_subject->setCurrentIndex(-1); 18 | ui->comboBox_type->setCurrentIndex(-1); 19 | ui->comboBox_semester->setCurrentIndex(-1); 20 | ui->comboBox_year->setCurrentIndex(-1); 21 | 22 | connect(ui->pushButton_add1,&QPushButton::clicked,this,&Debt::clickPushButton_add1); 23 | connect(ui->pushButton_add2,&QPushButton::clicked,this,&Debt::clickPushButton_add2); 24 | connect(ui->pushButton_add3,&QPushButton::clicked,this,&Debt::clickPushButton_add3); 25 | connect(ui->pushButton_add4,&QPushButton::clicked,this,&Debt::clickPushButton_add3); 26 | connect(ui->pushButton,&QPushButton::clicked,this,&Debt::clickPushButton); 27 | connect(ui->checkBox,&QCheckBox::stateChanged,this,[this](){ 28 | if(ui->checkBox->isChecked()) 29 | ui->dateEdit->setEnabled(false); 30 | else 31 | ui->dateEdit->setEnabled(true); 32 | }); 33 | 34 | updataDataDictionary(); 35 | 36 | if(flag==1) 37 | { 38 | if(query->exec(QString("SELECT * FROM debt WHERE time = '%1'").arg(time))) 39 | { 40 | query->first(); 41 | ui->comboBox_subject->setCurrentText(query->value(1).toString()); 42 | ui->lineEdit_grade->setText(query->value(2).toString()); 43 | ui->comboBox_type->setCurrentText(query->value(3).toString()); 44 | if(query->value(4).toString()!="") 45 | { 46 | ui->checkBox->setChecked(false); 47 | ui->dateEdit->setDate(QDate::fromString(query->value(4).toString(),"d/M/yyyy")); 48 | } 49 | ui->comboBox_semester->setCurrentText(query->value(5).toString()); 50 | ui->comboBox_year->setCurrentText(query->value(6).toString());; 51 | } 52 | } 53 | } 54 | 55 | Debt::~Debt() 56 | { 57 | delete ui; 58 | } 59 | 60 | void Debt::clickPushButton() 61 | { 62 | QString data; 63 | if(ui->checkBox->isChecked()) 64 | data=""; 65 | else 66 | data=ui->dateEdit->text(); 67 | QString str; 68 | if(flag==0) 69 | { 70 | str=QString("INSERT INTO `debt`(`number`, `subject`, `grade`,`type`, `date`, `semester`, `year`, `time`) VALUES " 71 | "('%1','%2','%3','%4','%5','%6','%7','%8')").arg(number,ui->comboBox_subject->currentText(),ui->lineEdit_grade->text(),ui->comboBox_type->currentText(), 72 | data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(), 73 | QDateTime::currentDateTime().toString()); 74 | } 75 | else 76 | { 77 | str=QString("UPDATE debt set subject='%1',grade='%2',type='%3',date='%4',semester='%5',year='%6' WHERE " 78 | "time='%7'").arg(ui->comboBox_subject->currentText(),ui->lineEdit_grade->text(),ui->comboBox_type->currentText(), 79 | data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(),time); 80 | } 81 | 82 | if(query->exec(str)) 83 | { 84 | emit needUpdataData(); 85 | delete this; 86 | } 87 | else 88 | { 89 | qDebug()<exec("select name from subject")) 97 | { 98 | int index=ui->comboBox_subject->currentIndex(); 99 | ui->comboBox_subject->clear(); 100 | while (query->next()) 101 | { 102 | QString name = query->value("name").toString(); 103 | if(!name.isEmpty()) 104 | { 105 | ui->comboBox_subject->addItem(name); 106 | } 107 | } 108 | ui->comboBox_subject->setCurrentIndex(index); 109 | } 110 | if(query->exec("select name from typeofexam")) 111 | { 112 | int index=ui->comboBox_type->currentIndex(); 113 | ui->comboBox_type->clear(); 114 | while (query->next()) 115 | { 116 | QString name = query->value("name").toString(); 117 | if(!name.isEmpty()) 118 | { 119 | ui->comboBox_type->addItem(name); 120 | } 121 | } 122 | ui->comboBox_type->setCurrentIndex(index); 123 | } 124 | if(query->exec("select name from semester")) 125 | { 126 | int index=ui->comboBox_semester->currentIndex(); 127 | ui->comboBox_semester->clear(); 128 | while (query->next()) 129 | { 130 | QString name = query->value("name").toString(); 131 | if(!name.isEmpty()) 132 | { 133 | ui->comboBox_semester->addItem(name); 134 | } 135 | } 136 | ui->comboBox_semester->setCurrentIndex(index); 137 | } 138 | if(query->exec("select name from year")) 139 | { 140 | int index=ui->comboBox_year->currentIndex(); 141 | ui->comboBox_year->clear(); 142 | while (query->next()) 143 | { 144 | QString name = query->value("name").toString(); 145 | if(!name.isEmpty()) 146 | { 147 | ui->comboBox_year->addItem(name); 148 | } 149 | } 150 | ui->comboBox_year->setCurrentIndex(index); 151 | } 152 | } 153 | 154 | void Debt::clickPushButton_add1() 155 | { 156 | bool ok; 157 | QString text = QInputDialog::getText(this, tr("添加科目"),tr("名称:"), QLineEdit::Normal,"", &ok); 158 | if (ok && !text.isEmpty()) 159 | { 160 | if(query->exec(QString("INSERT INTO `subject` (`name`) VALUES ('%1')").arg(text))) 161 | { 162 | qDebug()<exec(QString("INSERT INTO `typeofexam` (`name`) VALUES ('%1')").arg(text))) 175 | { 176 | qDebug()<exec(QString("INSERT INTO `semester` (`name`) VALUES ('%1')").arg(text))) 189 | { 190 | qDebug()<exec(QString("INSERT INTO `year` (`name`) VALUES ('%1')").arg(text))) 203 | { 204 | qDebug()< 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Ui { 10 | class Debt; 11 | } 12 | 13 | class Debt : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit Debt(QString number,QString time="",int flag=0,QWidget *parent = nullptr); 19 | ~Debt(); 20 | 21 | private slots: 22 | void clickPushButton(); 23 | void updataDataDictionary(); 24 | void clickPushButton_add1(); 25 | void clickPushButton_add2(); 26 | void clickPushButton_add3(); 27 | void clickPushButton_add4(); 28 | 29 | signals: 30 | void needUpdataData(); 31 | 32 | private: 33 | Ui::Debt *ui; 34 | QSqlDatabase db; 35 | QSqlQuery *query; 36 | QString number; 37 | QString time; 38 | int flag; 39 | }; 40 | 41 | #endif // DEBT_H 42 | -------------------------------------------------------------------------------- /Students/debt.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Debt 4 | 5 | 6 | 7 | 0 8 | 0 9 | 333 10 | 237 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 25 | 分数 26 | 27 | 28 | 29 | 30 | 31 | 32 | 日期 33 | 34 | 35 | 36 | 37 | 38 | 39 | 年份 40 | 41 | 42 | 43 | 44 | 45 | 46 | 科目 47 | 48 | 49 | 50 | 51 | 52 | 53 | 学期 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 25 71 | 25 72 | 73 | 74 | 75 | 76 | 25 77 | 25 78 | 79 | 80 | 81 | #pushButton_add4{ 82 | Border-image:url(:/images/add.png); 83 | } 84 | #pushButton_add4:pressed{ 85 | border: 1px solid rgb(24, 103, 155); 86 | border-radius: 5px; 87 | background-color: rgb(124, 203, 255); 88 | color: white; 89 | } 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 25 101 | 25 102 | 103 | 104 | 105 | 106 | 25 107 | 25 108 | 109 | 110 | 111 | #pushButton_add3{ 112 | Border-image:url(:/images/add.png); 113 | } 114 | #pushButton_add3:pressed{ 115 | border: 1px solid rgb(24, 103, 155); 116 | border-radius: 5px; 117 | background-color: rgb(124, 203, 255); 118 | color: white; 119 | } 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 25 131 | 25 132 | 133 | 134 | 135 | 136 | 25 137 | 25 138 | 139 | 140 | 141 | #pushButton_add1{ 142 | Border-image:url(:/images/add.png); 143 | } 144 | #pushButton_add1:pressed{ 145 | border: 1px solid rgb(24, 103, 155); 146 | border-radius: 5px; 147 | background-color: rgb(124, 203, 255); 148 | color: white; 149 | } 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | Qt::LeftToRight 160 | 161 | 162 | 163 | 3 164 | 165 | 166 | 0 167 | 168 | 169 | 0 170 | 171 | 172 | 0 173 | 174 | 175 | 0 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 类型 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 25 208 | 25 209 | 210 | 211 | 212 | 213 | 25 214 | 25 215 | 216 | 217 | 218 | #pushButton_add2{ 219 | Border-image:url(:/images/add.png); 220 | } 221 | #pushButton_add2:pressed{ 222 | border: 1px solid rgb(24, 103, 155); 223 | border-radius: 5px; 224 | background-color: rgb(124, 203, 255); 225 | color: white; 226 | } 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | Qt::Horizontal 241 | 242 | 243 | 244 | 40 245 | 20 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 确认 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | -------------------------------------------------------------------------------- /Students/grade.cpp: -------------------------------------------------------------------------------- 1 | #include "grade.h" 2 | #include "ui_grade.h" 3 | 4 | Grade::Grade(QString number,QString time,int flag,QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::Grade),number(number),time(time),flag(flag) 7 | { 8 | ui->setupUi(this); 9 | 10 | db = QSqlDatabase::database("conn"); 11 | query=new QSqlQuery(db); 12 | 13 | ui->checkBox->setChecked(true); 14 | ui->dateEdit->setEnabled(false); 15 | ui->dateEdit->setDate(QDate::currentDate()); 16 | 17 | ui->comboBox_subject->setCurrentIndex(-1); 18 | ui->comboBox_semester->setCurrentIndex(-1); 19 | ui->comboBox_year->setCurrentIndex(-1); 20 | 21 | connect(ui->pushButton_add1,&QPushButton::clicked,this,&Grade::clickPushButton_add1); 22 | connect(ui->pushButton_add2,&QPushButton::clicked,this,&Grade::clickPushButton_add2); 23 | connect(ui->pushButton_add3,&QPushButton::clicked,this,&Grade::clickPushButton_add3); 24 | connect(ui->pushButton,&QPushButton::clicked,this,&Grade::clickPushButton); 25 | connect(ui->checkBox,&QCheckBox::stateChanged,this,[this](){ 26 | if(ui->checkBox->isChecked()) 27 | ui->dateEdit->setEnabled(false); 28 | else 29 | ui->dateEdit->setEnabled(true); 30 | }); 31 | 32 | updataDataDictionary(); 33 | 34 | if(flag==1) 35 | { 36 | if(query->exec(QString("SELECT * FROM grade WHERE time = '%1'").arg(time))) 37 | { 38 | query->first(); 39 | ui->comboBox_subject->setCurrentText(query->value(1).toString()); 40 | ui->lineEdit_grade->setText(query->value(2).toString()); 41 | if(query->value(3).toString()!="") 42 | { 43 | ui->checkBox->setChecked(false); 44 | ui->dateEdit->setDate(QDate::fromString(query->value(3).toString(),"d/M/yyyy")); 45 | } 46 | ui->comboBox_semester->setCurrentText(query->value(4).toString()); 47 | ui->comboBox_year->setCurrentText(query->value(5).toString());; 48 | 49 | } 50 | } 51 | } 52 | 53 | Grade::~Grade() 54 | { 55 | delete ui; 56 | } 57 | 58 | void Grade::clickPushButton() 59 | { 60 | QString data; 61 | if(ui->checkBox->isChecked()) 62 | data=""; 63 | else 64 | data=ui->dateEdit->text(); 65 | QString str; 66 | if(flag==0) 67 | { 68 | str=QString("INSERT INTO `grade`(`number`, `subject`, `grade`, `date`, `semester`, `year`, `time`) VALUES " 69 | "('%1','%2','%3','%4','%5','%6','%7')").arg(number,ui->comboBox_subject->currentText(),ui->lineEdit_grade->text(), 70 | data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(), 71 | QDateTime::currentDateTime().toString()); 72 | } 73 | else 74 | { 75 | str=QString("UPDATE grade set subject='%1',grade='%2',date='%3',semester='%4',year='%5' WHERE " 76 | "time='%6'").arg(ui->comboBox_subject->currentText(),ui->lineEdit_grade->text(), 77 | data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(),time); 78 | } 79 | 80 | if(query->exec(str)) 81 | { 82 | emit needUpdataData(); 83 | delete this; 84 | } 85 | else 86 | { 87 | qDebug()<exec("select name from subject")) 95 | { 96 | int index=ui->comboBox_subject->currentIndex(); 97 | ui->comboBox_subject->clear(); 98 | while (query->next()) 99 | { 100 | QString name = query->value("name").toString(); 101 | if(!name.isEmpty()) 102 | { 103 | ui->comboBox_subject->addItem(name); 104 | } 105 | } 106 | ui->comboBox_subject->setCurrentIndex(index); 107 | } 108 | if(query->exec("select name from semester")) 109 | { 110 | int index=ui->comboBox_semester->currentIndex(); 111 | ui->comboBox_semester->clear(); 112 | while (query->next()) 113 | { 114 | QString name = query->value("name").toString(); 115 | if(!name.isEmpty()) 116 | { 117 | ui->comboBox_semester->addItem(name); 118 | } 119 | } 120 | ui->comboBox_semester->setCurrentIndex(index); 121 | } 122 | if(query->exec("select name from year")) 123 | { 124 | int index=ui->comboBox_year->currentIndex(); 125 | ui->comboBox_year->clear(); 126 | while (query->next()) 127 | { 128 | QString name = query->value("name").toString(); 129 | if(!name.isEmpty()) 130 | { 131 | ui->comboBox_year->addItem(name); 132 | } 133 | } 134 | ui->comboBox_year->setCurrentIndex(index); 135 | } 136 | } 137 | 138 | void Grade::clickPushButton_add1() 139 | { 140 | bool ok; 141 | QString text = QInputDialog::getText(this, tr("添加科目"),tr("名称:"), QLineEdit::Normal,"", &ok); 142 | if (ok && !text.isEmpty()) 143 | { 144 | if(query->exec(QString("INSERT INTO `subject` (`name`) VALUES ('%1')").arg(text))) 145 | { 146 | qDebug()<exec(QString("INSERT INTO `semester` (`name`) VALUES ('%1')").arg(text))) 159 | { 160 | qDebug()<exec(QString("INSERT INTO `year` (`name`) VALUES ('%1')").arg(text))) 173 | { 174 | qDebug()< 5 | #include 6 | #include 7 | #include 8 | namespace Ui { 9 | class Grade; 10 | } 11 | 12 | class Grade : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit Grade(QString number,QString time="",int flag=0,QWidget *parent = nullptr); 18 | ~Grade(); 19 | 20 | private slots: 21 | void clickPushButton(); 22 | void updataDataDictionary(); 23 | void clickPushButton_add1(); 24 | void clickPushButton_add2(); 25 | void clickPushButton_add3(); 26 | 27 | signals: 28 | void needUpdataData(); 29 | 30 | private: 31 | Ui::Grade *ui; 32 | QSqlDatabase db; 33 | QSqlQuery *query; 34 | QString number; 35 | QString time; 36 | int flag; 37 | 38 | }; 39 | 40 | #endif // GRADE_H 41 | -------------------------------------------------------------------------------- /Students/grade.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Grade 4 | 5 | 6 | 7 | 0 8 | 0 9 | 297 10 | 221 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 25 | 年份 26 | 27 | 28 | 29 | 30 | 31 | 32 | 科目 33 | 34 | 35 | 36 | 37 | 38 | 39 | 学期 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 日期 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 分数 63 | 64 | 65 | 66 | 67 | 68 | 69 | Qt::LeftToRight 70 | 71 | 72 | 73 | 3 74 | 75 | 76 | 0 77 | 78 | 79 | 0 80 | 81 | 82 | 0 83 | 84 | 85 | 0 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 25 108 | 25 109 | 110 | 111 | 112 | 113 | 25 114 | 25 115 | 116 | 117 | 118 | #pushButton_add1{ 119 | Border-image:url(:/images/add.png); 120 | } 121 | #pushButton_add1:pressed{ 122 | border: 1px solid rgb(24, 103, 155); 123 | border-radius: 5px; 124 | background-color: rgb(124, 203, 255); 125 | color: white; 126 | } 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 25 138 | 25 139 | 140 | 141 | 142 | 143 | 25 144 | 25 145 | 146 | 147 | 148 | #pushButton_add2{ 149 | Border-image:url(:/images/add.png); 150 | } 151 | #pushButton_add2:pressed{ 152 | border: 1px solid rgb(24, 103, 155); 153 | border-radius: 5px; 154 | background-color: rgb(124, 203, 255); 155 | color: white; 156 | } 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 25 168 | 25 169 | 170 | 171 | 172 | 173 | 25 174 | 25 175 | 176 | 177 | 178 | #pushButton_add3{ 179 | Border-image:url(:/images/add.png); 180 | } 181 | #pushButton_add3:pressed{ 182 | border: 1px solid rgb(24, 103, 155); 183 | border-radius: 5px; 184 | background-color: rgb(124, 203, 255); 185 | color: white; 186 | } 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | Qt::Horizontal 201 | 202 | 203 | 204 | 40 205 | 20 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 确认 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | -------------------------------------------------------------------------------- /Students/honor.cpp: -------------------------------------------------------------------------------- 1 | #include "honor.h" 2 | #include "ui_honor.h" 3 | 4 | Honor::Honor(QString number,QString time,int flag,QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::Honor),number(number),time(time),flag(flag) 7 | { 8 | ui->setupUi(this); 9 | 10 | db = QSqlDatabase::database("conn"); 11 | query=new QSqlQuery(db); 12 | 13 | ui->checkBox->setChecked(true); 14 | ui->dateEdit->setEnabled(false); 15 | ui->dateEdit->setDate(QDate::currentDate()); 16 | 17 | ui->comboBox_semester->setCurrentIndex(-1); 18 | ui->comboBox_year->setCurrentIndex(-1); 19 | 20 | connect(ui->pushButton_add1,&QPushButton::clicked,this,&Honor::clickPushButton_add1); 21 | connect(ui->pushButton_add2,&QPushButton::clicked,this,&Honor::clickPushButton_add2); 22 | connect(ui->pushButton,&QPushButton::clicked,this,&Honor::clickPushButton); 23 | connect(ui->checkBox,&QCheckBox::stateChanged,this,[this](){ 24 | if(ui->checkBox->isChecked()) 25 | ui->dateEdit->setEnabled(false); 26 | else 27 | ui->dateEdit->setEnabled(true); 28 | }); 29 | 30 | updataDataDictionary(); 31 | 32 | if(flag==1) 33 | { 34 | if(query->exec(QString("SELECT * FROM honor WHERE time = '%1'").arg(time))) 35 | { 36 | query->first(); 37 | ui->lineEdit_name->setText(query->value(1).toString()); 38 | ui->lineEdit_level->setText(query->value(2).toString()); 39 | if(query->value(3).toString()!="") 40 | { 41 | ui->checkBox->setChecked(false); 42 | ui->dateEdit->setDate(QDate::fromString(query->value(3).toString(),"d/M/yyyy")); 43 | } 44 | ui->comboBox_semester->setCurrentText(query->value(4).toString()); 45 | ui->comboBox_year->setCurrentText(query->value(5).toString());; 46 | } 47 | } 48 | } 49 | 50 | Honor::~Honor() 51 | { 52 | delete ui; 53 | } 54 | 55 | void Honor::clickPushButton() 56 | { 57 | QString data; 58 | if(ui->checkBox->isChecked()) 59 | data=""; 60 | else 61 | data=ui->dateEdit->text(); 62 | QString str; 63 | if(flag==0) 64 | { 65 | str=QString("INSERT INTO `honor`(`number`, `name`, `level`, `date`, `semester`, `year`, `time`) VALUES " 66 | "('%1','%2','%3','%4','%5','%6','%7')").arg(number,ui->lineEdit_name->text(),ui->lineEdit_level->text(), 67 | data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(), 68 | QDateTime::currentDateTime().toString()); 69 | } 70 | else 71 | { 72 | str=QString("UPDATE honor set name='%1',level='%2',date='%3',semester='%4',year='%5' WHERE " 73 | "time='%6'").arg(ui->lineEdit_name->text(),ui->lineEdit_level->text(), 74 | data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(),time); 75 | } 76 | 77 | if(query->exec(str)) 78 | { 79 | emit needUpdataData(); 80 | delete this; 81 | } 82 | else 83 | { 84 | qDebug()<exec("select name from semester")) 92 | { 93 | int index=ui->comboBox_semester->currentIndex(); 94 | ui->comboBox_semester->clear(); 95 | while (query->next()) 96 | { 97 | QString name = query->value("name").toString(); 98 | if(!name.isEmpty()) 99 | { 100 | ui->comboBox_semester->addItem(name); 101 | } 102 | } 103 | ui->comboBox_semester->setCurrentIndex(index); 104 | } 105 | if(query->exec("select name from year")) 106 | { 107 | int index=ui->comboBox_year->currentIndex(); 108 | ui->comboBox_year->clear(); 109 | while (query->next()) 110 | { 111 | QString name = query->value("name").toString(); 112 | if(!name.isEmpty()) 113 | { 114 | ui->comboBox_year->addItem(name); 115 | } 116 | } 117 | ui->comboBox_year->setCurrentIndex(index); 118 | } 119 | } 120 | 121 | void Honor::clickPushButton_add1() 122 | { 123 | bool ok; 124 | QString text = QInputDialog::getText(this, tr("添加学期"),tr("学期:"), QLineEdit::Normal,"", &ok); 125 | if (ok && !text.isEmpty()) 126 | { 127 | if(query->exec(QString("INSERT INTO `semester` (`name`) VALUES ('%1')").arg(text))) 128 | { 129 | qDebug()<exec(QString("INSERT INTO `year` (`name`) VALUES ('%1')").arg(text))) 142 | { 143 | qDebug()< 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Ui { 10 | class Honor; 11 | } 12 | 13 | class Honor : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit Honor(QString number,QString time="",int flag=0,QWidget *parent = nullptr); 19 | ~Honor(); 20 | 21 | private slots: 22 | void clickPushButton(); 23 | void updataDataDictionary(); 24 | void clickPushButton_add1(); 25 | void clickPushButton_add2(); 26 | 27 | signals: 28 | void needUpdataData(); 29 | 30 | private: 31 | Ui::Honor *ui; 32 | QSqlDatabase db; 33 | QSqlQuery *query; 34 | QString number; 35 | QString time; 36 | int flag; 37 | }; 38 | 39 | #endif // HONOR_H 40 | -------------------------------------------------------------------------------- /Students/honor.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Honor 4 | 5 | 6 | 7 | 0 8 | 0 9 | 303 10 | 234 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 25 | 年份 26 | 27 | 28 | 29 | 30 | 31 | 32 | 名称 33 | 34 | 35 | 36 | 37 | 38 | 39 | 学期 40 | 41 | 42 | 43 | 44 | 45 | 46 | 日期 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 级别 60 | 61 | 62 | 63 | 64 | 65 | 66 | Qt::LeftToRight 67 | 68 | 69 | 70 | 3 71 | 72 | 73 | 0 74 | 75 | 76 | 0 77 | 78 | 79 | 0 80 | 81 | 82 | 0 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 25 105 | 25 106 | 107 | 108 | 109 | 110 | 25 111 | 25 112 | 113 | 114 | 115 | #pushButton_add1{ 116 | Border-image:url(:/images/add.png); 117 | } 118 | #pushButton_add1:pressed{ 119 | border: 1px solid rgb(24, 103, 155); 120 | border-radius: 5px; 121 | background-color: rgb(124, 203, 255); 122 | color: white; 123 | } 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 25 135 | 25 136 | 137 | 138 | 139 | 140 | 25 141 | 25 142 | 143 | 144 | 145 | #pushButton_add2{ 146 | Border-image:url(:/images/add.png); 147 | } 148 | #pushButton_add2:pressed{ 149 | border: 1px solid rgb(24, 103, 155); 150 | border-radius: 5px; 151 | background-color: rgb(124, 203, 255); 152 | color: white; 153 | } 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | Qt::Horizontal 171 | 172 | 173 | 174 | 40 175 | 20 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 确认 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | -------------------------------------------------------------------------------- /Students/images/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TmSakura/C-Qt-StudentManagementSystem-Multi-Users/c0265e1ea2c675d461b03447e9af4ebfe4874723/Students/images/add.png -------------------------------------------------------------------------------- /Students/images/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TmSakura/C-Qt-StudentManagementSystem-Multi-Users/c0265e1ea2c675d461b03447e9af4ebfe4874723/Students/images/cancel.png -------------------------------------------------------------------------------- /Students/images/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TmSakura/C-Qt-StudentManagementSystem-Multi-Users/c0265e1ea2c675d461b03447e9af4ebfe4874723/Students/images/exit.png -------------------------------------------------------------------------------- /Students/images/login_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TmSakura/C-Qt-StudentManagementSystem-Multi-Users/c0265e1ea2c675d461b03447e9af4ebfe4874723/Students/images/login_bg.png -------------------------------------------------------------------------------- /Students/images/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TmSakura/C-Qt-StudentManagementSystem-Multi-Users/c0265e1ea2c675d461b03447e9af4ebfe4874723/Students/images/open.png -------------------------------------------------------------------------------- /Students/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TmSakura/C-Qt-StudentManagementSystem-Multi-Users/c0265e1ea2c675d461b03447e9af4ebfe4874723/Students/images/save.png -------------------------------------------------------------------------------- /Students/images/windowIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TmSakura/C-Qt-StudentManagementSystem-Multi-Users/c0265e1ea2c675d461b03447e9af4ebfe4874723/Students/images/windowIcon.png -------------------------------------------------------------------------------- /Students/login.cpp: -------------------------------------------------------------------------------- 1 | #include "login.h" 2 | #include "ui_login.h" 3 | 4 | Login::Login(QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::Login) 7 | { 8 | ui->setupUi(this); 9 | 10 | db = QSqlDatabase::database("conn"); 11 | query=new QSqlQuery(db); 12 | 13 | 14 | setWindowTitle(tr("Students")); 15 | 16 | updataData_user(); 17 | connect(ui->pushButton_enter,&QPushButton::clicked,this,&Login::clickPushButton_enter); 18 | } 19 | 20 | Login::~Login() 21 | { 22 | db.close(); 23 | delete ui; 24 | } 25 | 26 | void Login::updataData_user() 27 | { 28 | ui->comboBox_username->clear(); 29 | if(query->exec("select username from user")) 30 | { 31 | while (query->next()) 32 | { 33 | QString username = query->value("username").toString(); 34 | if(!username.isEmpty()) 35 | { 36 | ui->comboBox_username->addItem(username); 37 | } 38 | } 39 | } 40 | } 41 | 42 | void Login::clickPushButton_enter() 43 | { 44 | query->clear(); 45 | query->exec(QString("select password from user where username = '%1'").arg(ui->comboBox_username->currentText())); 46 | query->next(); 47 | if(query->value("password").toString()==ui->lineEdit_password->text()) 48 | { 49 | MainWindow *mainwindow=new MainWindow(ui->comboBox_username->currentText(),this); 50 | mainwindow->show(); 51 | connect(mainwindow,&MainWindow::exitReturnLogin,this,&Login::updataData_user); 52 | hide(); 53 | } 54 | else 55 | { 56 | QMessageBox::information(this,"提示","用户名或密码错误"); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Students/login.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGIN_H 2 | #define LOGIN_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "mainwindow.h" 8 | 9 | namespace Ui { 10 | class Login; 11 | } 12 | 13 | class Login : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit Login(QWidget *parent = nullptr); 19 | ~Login(); 20 | 21 | private slots: 22 | void updataData_user(); 23 | 24 | private: 25 | QSqlDatabase db; 26 | QSqlQuery *query; 27 | Ui::Login *ui; 28 | 29 | private slots: 30 | void clickPushButton_enter(); 31 | }; 32 | 33 | #endif // LOGIN_H 34 | -------------------------------------------------------------------------------- /Students/login.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Login 4 | 5 | 6 | 7 | 0 8 | 0 9 | 506 10 | 379 11 | 12 | 13 | 14 | 15 | 506 16 | 379 17 | 18 | 19 | 20 | 21 | 506 22 | 379 23 | 24 | 25 | 26 | Dialog 27 | 28 | 29 | #Login{ 30 | Border-image:url(:/images/login_bg.png);} 31 | 32 | 33 | 34 | 35 | 36 | 37 | Qt::Vertical 38 | 39 | 40 | 41 | 20 42 | 40 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 20 51 | 52 | 53 | 0 54 | 55 | 56 | 57 | 58 | Qt::Horizontal 59 | 60 | 61 | 62 | 40 63 | 20 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | #formFrame{ 72 | border:1px solid rgb(24,103,155) ; 73 | border-radius:5px; 74 | background-color:white;} 75 | 76 | 77 | 78 | 79 | 25 80 | 81 | 82 | 25 83 | 84 | 85 | 25 86 | 87 | 88 | 25 89 | 90 | 91 | 92 | 93 | 密码 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 150 102 | 25 103 | 104 | 105 | 106 | QLineEdit::Password 107 | 108 | 109 | 110 | 111 | 112 | 113 | 用户名 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | Qt::Horizontal 127 | 128 | 129 | 130 | 40 131 | 20 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | Qt::Horizontal 144 | 145 | 146 | 147 | 40 148 | 20 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 260 158 | 35 159 | 160 | 161 | 162 | QPushButton:pressed{ 163 | border: 1px solid rgb(24, 103, 155); 164 | border-radius: 5px; 165 | background-color: rgb(124, 203, 255); 166 | color: white; 167 | } 168 | 169 | 170 | 171 | 确认 172 | 173 | 174 | 175 | 176 | 177 | 178 | Qt::Horizontal 179 | 180 | 181 | 182 | 40 183 | 20 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | Qt::Vertical 194 | 195 | 196 | 197 | 20 198 | 40 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | Made By ChenJieJun 207 | 208 | 209 | 210 | 211 | 212 | 213 | V 1.0 214 | 215 | 216 | 0 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | -------------------------------------------------------------------------------- /Students/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "login.h" 3 | #include 4 | #include 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | 10 | QSqlDatabase db; 11 | db = QSqlDatabase::addDatabase("QMYSQL","conn"); 12 | db.setDatabaseName("students"); 13 | db.setUserName("chen"); 14 | db.setPassword("123456"); 15 | bool ok = db.open(); 16 | if(!ok) 17 | { 18 | QMessageBox::critical(0, QObject::tr("连接数据库失败!"), db.lastError().text()); 19 | return 1; 20 | } 21 | else 22 | { 23 | qDebug()<setWindowIcon(QIcon(":/images/windowIcon.png")); 27 | 28 | 29 | Login login; 30 | login.show(); 31 | 32 | 33 | 34 | return a.exec(); 35 | } 36 | -------------------------------------------------------------------------------- /Students/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "datadictionary.h" 10 | #include "studentinfo.h" 11 | #include "usercontrol.h" 12 | #include "options.h" 13 | 14 | QT_BEGIN_NAMESPACE 15 | namespace Ui { class MainWindow; } 16 | QT_CHARTS_USE_NAMESPACE 17 | QT_END_NAMESPACE 18 | 19 | class MainWindow : public QMainWindow 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | MainWindow(QString username, QWidget *parent = nullptr); 25 | ~MainWindow(); 26 | 27 | private slots: 28 | //tab1 29 | void updataData_table(); 30 | void updataDataDictonary(); 31 | void clickPushButton_add(); 32 | void clickPushBUtton_editView(); 33 | void clickPushBUtton_delete(); 34 | void clickPushButton_dataDictionary(); 35 | void clickPushButton_user(); 36 | void clickPushButton_search(); 37 | void clickPushButton_importExcel(); 38 | void clickPushButton_exportExcel(); 39 | 40 | //tab2 41 | void updataData_table_2(); 42 | void updataDataDictonary_2(); 43 | void clickPushButton_search_2(); 44 | 45 | //tab3 46 | void updataDataChart(); 47 | 48 | signals: 49 | void exitReturnLogin(); 50 | 51 | private: 52 | Ui::MainWindow *ui; 53 | QString username; 54 | QSqlDatabase db; 55 | QSqlQuery *query; 56 | 57 | QString read; 58 | QString write; 59 | QString remove; 60 | QString search; 61 | QString print; 62 | QString import; 63 | QString admin; 64 | 65 | }; 66 | #endif // MAINWINDOW_H 67 | -------------------------------------------------------------------------------- /Students/options.cpp: -------------------------------------------------------------------------------- 1 | #include "options.h" 2 | #include "ui_options.h" 3 | #include 4 | 5 | Options::Options(QWidget *parent) : 6 | QMainWindow(parent), 7 | ui(new Ui::Options) 8 | { 9 | ui->setupUi(this); 10 | 11 | ui->listWidget->setCurrentRow(0); 12 | ui->stackedWidget->show(); 13 | 14 | QDir *dirPath = new QDir(":/styles/qss"); 15 | QListfile(dirPath->entryInfoList()); 16 | for (auto it = file.begin(); it != file.end(); it++) 17 | { 18 | ui->comboBox_theme->addItem(it->fileName().remove(it->fileName().size()-4,4)); 19 | } 20 | 21 | connect(ui->listWidget,&QListWidget::itemPressed,this,&Options::stackedWidget_change); 22 | connect(ui->pushButton_return,&QPushButton::clicked,this,&Options::clickPushButton_return); 23 | connect(ui->pushButton_confirm,&QPushButton::clicked,this,&Options::clickPushButton_confirm); 24 | } 25 | 26 | Options::~Options() 27 | { 28 | delete ui; 29 | } 30 | 31 | void Options::clickPushButton_return() 32 | { 33 | parentWidget()->show(); 34 | delete this; 35 | } 36 | 37 | void Options::clickPushButton_confirm() 38 | { 39 | clickPushButton_apply(); 40 | clickPushButton_return(); 41 | } 42 | 43 | void Options::clickPushButton_apply() 44 | { 45 | updatedata_appearance(); 46 | } 47 | 48 | void Options::stackedWidget_change() 49 | { 50 | switch (ui->listWidget->currentRow()) 51 | { 52 | case 0: 53 | ui->stackedWidget->setCurrentWidget(ui->page_appearance); 54 | ; 55 | } 56 | 57 | } 58 | 59 | void Options::updatedata_appearance() 60 | { 61 | QString theme(ui->comboBox_theme->currentText()+".qss"); 62 | theme=":/styles/qss/"+theme; 63 | QFile file(theme); 64 | file.open(QFile::ReadOnly); 65 | QString styleSheet = QString::fromLatin1(file.readAll()); 66 | qApp->setStyleSheet(styleSheet); 67 | } 68 | -------------------------------------------------------------------------------- /Students/options.h: -------------------------------------------------------------------------------- 1 | #ifndef OPTIONS_H 2 | #define OPTIONS_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui { 9 | class Options; 10 | } 11 | 12 | class Options : public QMainWindow 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit Options(QWidget *parent = nullptr); 18 | ~Options(); 19 | 20 | private slots: 21 | void clickPushButton_return(); 22 | void clickPushButton_confirm(); 23 | void clickPushButton_apply(); 24 | void stackedWidget_change(); 25 | 26 | void updatedata_appearance(); 27 | 28 | private: 29 | Ui::Options *ui; 30 | }; 31 | 32 | #endif // OPTIONS_H 33 | -------------------------------------------------------------------------------- /Students/options.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1101 10 | 603 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 0 23 | 0 24 | 25 | 26 | 27 | 28 | 100 29 | 0 30 | 31 | 32 | 33 | 34 | 100 35 | 16777215 36 | 37 | 38 | 39 | 100 40 | 41 | 42 | 43 | 外观 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 1 54 | 55 | 56 | 57 | true 58 | 59 | 60 | 61 | 62 | true 63 | 64 | 65 | 66 | 67 | 10 68 | 10 69 | 160 70 | 80 71 | 72 | 73 | 74 | 75 | 17 76 | 77 | 78 | 79 | 80 | 主题 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 返回 98 | 99 | 100 | 101 | 102 | 103 | 104 | 确认 105 | 106 | 107 | 108 | 109 | 110 | 111 | 应用 112 | 113 | 114 | 115 | 116 | 117 | 118 | Qt::Horizontal 119 | 120 | 121 | 122 | 40 123 | 20 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 0 138 | 0 139 | 1101 140 | 20 141 | 142 | 143 | 144 | 145 | 文件 146 | 147 | 148 | 149 | 150 | 151 | 编辑 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 退出 161 | 162 | 163 | 164 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /Students/punish.cpp: -------------------------------------------------------------------------------- 1 | #include "punish.h" 2 | #include "ui_punish.h" 3 | 4 | Punish::Punish(QString number,QString time,int flag,QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::Punish),number(number),time(time),flag(flag) 7 | { 8 | ui->setupUi(this); 9 | 10 | db = QSqlDatabase::database("conn"); 11 | query=new QSqlQuery(db); 12 | 13 | ui->checkBox->setChecked(true); 14 | ui->dateEdit->setEnabled(false); 15 | ui->dateEdit->setDate(QDate::currentDate()); 16 | 17 | ui->comboBox_semester->setCurrentIndex(-1); 18 | ui->comboBox_year->setCurrentIndex(-1); 19 | 20 | connect(ui->pushButton_add1,&QPushButton::clicked,this,&Punish::clickPushButton_add1); 21 | connect(ui->pushButton_add2,&QPushButton::clicked,this,&Punish::clickPushButton_add2); 22 | connect(ui->pushButton,&QPushButton::clicked,this,&Punish::clickPushButton); 23 | connect(ui->checkBox,&QCheckBox::stateChanged,this,[this](){ 24 | if(ui->checkBox->isChecked()) 25 | ui->dateEdit->setEnabled(false); 26 | else 27 | ui->dateEdit->setEnabled(true); 28 | }); 29 | 30 | updataDataDictionary(); 31 | 32 | if(flag==1) 33 | { 34 | if(query->exec(QString("SELECT * FROM punish WHERE time = '%1'").arg(time))) 35 | { 36 | query->first(); 37 | ui->lineEdit_reason->setText(query->value(1).toString()); 38 | ui->lineEdit_handling->setText(query->value(2).toString()); 39 | if(query->value(3).toString()!="") 40 | { 41 | ui->checkBox->setChecked(false); 42 | ui->dateEdit->setDate(QDate::fromString(query->value(3).toString(),"d/M/yyyy")); 43 | } 44 | ui->comboBox_semester->setCurrentText(query->value(4).toString()); 45 | ui->comboBox_year->setCurrentText(query->value(5).toString());; 46 | ui->lineEdit_result->setText(query->value(6).toString()); 47 | } 48 | } 49 | } 50 | 51 | Punish::~Punish() 52 | { 53 | delete ui; 54 | } 55 | 56 | void Punish::clickPushButton() 57 | { 58 | QString data; 59 | if(ui->checkBox->isChecked()) 60 | data=""; 61 | else 62 | data=ui->dateEdit->text(); 63 | QString str; 64 | if(flag==0) 65 | { 66 | str=QString("INSERT INTO `punish`(`number`, `reason`, `handling`,`date`, `semester`, `year`,`result`, `time`) VALUES " 67 | "('%1','%2','%3','%4','%5','%6','%7','%8')").arg(number,ui->lineEdit_reason->text(),ui->lineEdit_handling->text(), 68 | data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(), 69 | ui->lineEdit_result->text(),QDateTime::currentDateTime().toString()); 70 | } 71 | else 72 | { 73 | str=QString("UPDATE punish set reason='%1',handling='%2',date='%3',semester='%4',year='%5',result='%6' WHERE " 74 | "time='%7'").arg(ui->lineEdit_reason->text(),ui->lineEdit_handling->text(),data,ui->comboBox_semester->currentText(), 75 | ui->comboBox_year->currentText(),ui->lineEdit_result->text(),time); 76 | } 77 | 78 | if(query->exec(str)) 79 | { 80 | emit needUpdataData(); 81 | delete this; 82 | } 83 | else 84 | { 85 | qDebug()<exec("select name from semester")) 93 | { 94 | int index=ui->comboBox_semester->currentIndex(); 95 | ui->comboBox_semester->clear(); 96 | while (query->next()) 97 | { 98 | QString name = query->value("name").toString(); 99 | if(!name.isEmpty()) 100 | { 101 | ui->comboBox_semester->addItem(name); 102 | } 103 | } 104 | ui->comboBox_semester->setCurrentIndex(index); 105 | } 106 | if(query->exec("select name from year")) 107 | { 108 | int index=ui->comboBox_year->currentIndex(); 109 | ui->comboBox_year->clear(); 110 | while (query->next()) 111 | { 112 | QString name = query->value("name").toString(); 113 | if(!name.isEmpty()) 114 | { 115 | ui->comboBox_year->addItem(name); 116 | } 117 | } 118 | ui->comboBox_year->setCurrentIndex(index); 119 | } 120 | } 121 | 122 | void Punish::clickPushButton_add1() 123 | { 124 | bool ok; 125 | QString text = QInputDialog::getText(this, tr("添加学期"),tr("学期:"), QLineEdit::Normal,"", &ok); 126 | if (ok && !text.isEmpty()) 127 | { 128 | if(query->exec(QString("INSERT INTO `semester` (`name`) VALUES ('%1')").arg(text))) 129 | { 130 | qDebug()<exec(QString("INSERT INTO `year` (`name`) VALUES ('%1')").arg(text))) 143 | { 144 | qDebug()< 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Ui { 10 | class Punish; 11 | } 12 | 13 | class Punish : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit Punish(QString number,QString time="",int flag=0,QWidget *parent = nullptr); 19 | ~Punish(); 20 | 21 | private slots: 22 | void clickPushButton(); 23 | void updataDataDictionary(); 24 | void clickPushButton_add1(); 25 | void clickPushButton_add2(); 26 | 27 | signals: 28 | void needUpdataData(); 29 | 30 | private: 31 | Ui::Punish *ui; 32 | QSqlDatabase db; 33 | QSqlQuery *query; 34 | QString number; 35 | QString time; 36 | int flag; 37 | }; 38 | 39 | 40 | #endif // PUNISH_H 41 | -------------------------------------------------------------------------------- /Students/punish.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Punish 4 | 5 | 6 | 7 | 0 8 | 0 9 | 339 10 | 241 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 年份 29 | 30 | 31 | 32 | 33 | 34 | 35 | 日期 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 学期 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 处理 56 | 57 | 58 | 59 | 60 | 61 | 62 | 原因 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 25 74 | 25 75 | 76 | 77 | 78 | 79 | 25 80 | 25 81 | 82 | 83 | 84 | #pushButton_add2{ 85 | Border-image:url(:/images/add.png); 86 | } 87 | #pushButton_add2:pressed{ 88 | border: 1px solid rgb(24, 103, 155); 89 | border-radius: 5px; 90 | background-color: rgb(124, 203, 255); 91 | color: white; 92 | } 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 25 104 | 25 105 | 106 | 107 | 108 | 109 | 25 110 | 25 111 | 112 | 113 | 114 | #pushButton_add1{ 115 | Border-image:url(:/images/add.png); 116 | } 117 | #pushButton_add1:pressed{ 118 | border: 1px solid rgb(24, 103, 155); 119 | border-radius: 5px; 120 | background-color: rgb(124, 203, 255); 121 | color: white; 122 | } 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | Qt::LeftToRight 133 | 134 | 135 | 136 | 3 137 | 138 | 139 | 0 140 | 141 | 142 | 0 143 | 144 | 145 | 0 146 | 147 | 148 | 0 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 结果 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | Qt::Horizontal 181 | 182 | 183 | 184 | 40 185 | 20 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 确认 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | -------------------------------------------------------------------------------- /Students/scholarship.cpp: -------------------------------------------------------------------------------- 1 | #include "scholarship.h" 2 | #include "ui_scholarship.h" 3 | 4 | ScholarShip::ScholarShip(QString number,QString time,int flag,QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::ScholarShip),number(number),time(time),flag(flag) 7 | { 8 | ui->setupUi(this); 9 | 10 | db = QSqlDatabase::database("conn"); 11 | query=new QSqlQuery(db); 12 | 13 | ui->checkBox->setChecked(true); 14 | ui->dateEdit->setEnabled(false); 15 | ui->dateEdit->setDate(QDate::currentDate()); 16 | 17 | ui->comboBox_semester->setCurrentIndex(-1); 18 | ui->comboBox_year->setCurrentIndex(-1); 19 | 20 | connect(ui->pushButton_add1,&QPushButton::clicked,this,&ScholarShip::clickPushButton_add1); 21 | connect(ui->pushButton_add2,&QPushButton::clicked,this,&ScholarShip::clickPushButton_add2); 22 | connect(ui->pushButton,&QPushButton::clicked,this,&ScholarShip::clickPushButton); 23 | connect(ui->checkBox,&QCheckBox::stateChanged,this,[this](){ 24 | if(ui->checkBox->isChecked()) 25 | ui->dateEdit->setEnabled(false); 26 | else 27 | ui->dateEdit->setEnabled(true); 28 | }); 29 | 30 | updataDataDictionary(); 31 | 32 | if(flag==1) 33 | { 34 | if(query->exec(QString("SELECT * FROM scholarship WHERE time = '%1'").arg(time))) 35 | { 36 | query->first(); 37 | ui->lineEdit_count->setText(query->value(1).toString()); 38 | if(query->value(2).toString()!="") 39 | { 40 | ui->checkBox->setChecked(false); 41 | ui->dateEdit->setDate(QDate::fromString(query->value(2).toString(),"d/M/yyyy")); 42 | } 43 | ui->comboBox_semester->setCurrentText(query->value(3).toString()); 44 | ui->comboBox_year->setCurrentText(query->value(4).toString());; 45 | 46 | } 47 | } 48 | } 49 | 50 | ScholarShip::~ScholarShip() 51 | { 52 | delete ui; 53 | } 54 | 55 | void ScholarShip::clickPushButton() 56 | { 57 | QString data; 58 | if(ui->checkBox->isChecked()) 59 | data=""; 60 | else 61 | data=ui->dateEdit->text(); 62 | QString str; 63 | if(flag==0) 64 | { 65 | str=QString("INSERT INTO `scholarship`(`number`, `count`, `date`, `semester`, `year`, `time`) VALUES " 66 | "('%1','%2','%3','%4','%5','%6')").arg(number,ui->lineEdit_count->text(), 67 | data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(), 68 | QDateTime::currentDateTime().toString()); 69 | } 70 | else 71 | { 72 | str=QString("UPDATE scholarship set count='%1',date='%3',semester='%4',year='%5' WHERE " 73 | "time='%6'").arg(ui->lineEdit_count->text(),data,ui->comboBox_semester->currentText(),ui->comboBox_year->currentText(),time); 74 | } 75 | 76 | if(query->exec(str)) 77 | { 78 | emit needUpdataData(); 79 | delete this; 80 | } 81 | else 82 | { 83 | qDebug()<exec("select name from semester")) 91 | { 92 | int index=ui->comboBox_semester->currentIndex(); 93 | ui->comboBox_semester->clear(); 94 | while (query->next()) 95 | { 96 | QString name = query->value("name").toString(); 97 | if(!name.isEmpty()) 98 | { 99 | ui->comboBox_semester->addItem(name); 100 | } 101 | } 102 | ui->comboBox_semester->setCurrentIndex(index); 103 | } 104 | if(query->exec("select name from year")) 105 | { 106 | int index=ui->comboBox_year->currentIndex(); 107 | ui->comboBox_year->clear(); 108 | while (query->next()) 109 | { 110 | QString name = query->value("name").toString(); 111 | if(!name.isEmpty()) 112 | { 113 | ui->comboBox_year->addItem(name); 114 | } 115 | } 116 | ui->comboBox_year->setCurrentIndex(index); 117 | } 118 | } 119 | 120 | void ScholarShip::clickPushButton_add1() 121 | { 122 | bool ok; 123 | QString text = QInputDialog::getText(this, tr("添加学期"),tr("学期:"), QLineEdit::Normal,"", &ok); 124 | if (ok && !text.isEmpty()) 125 | { 126 | if(query->exec(QString("INSERT INTO `semester` (`name`) VALUES ('%1')").arg(text))) 127 | { 128 | qDebug()<exec(QString("INSERT INTO `year` (`name`) VALUES ('%1')").arg(text))) 141 | { 142 | qDebug()< 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Ui { 10 | class ScholarShip; 11 | } 12 | 13 | class ScholarShip : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit ScholarShip(QString number,QString time="",int flag=0,QWidget *parent = nullptr); 19 | ~ScholarShip(); 20 | 21 | private slots: 22 | void clickPushButton(); 23 | void updataDataDictionary(); 24 | void clickPushButton_add1(); 25 | void clickPushButton_add2(); 26 | 27 | signals: 28 | void needUpdataData(); 29 | 30 | private: 31 | Ui::ScholarShip *ui; 32 | QSqlDatabase db; 33 | QSqlQuery *query; 34 | QString number; 35 | QString time; 36 | int flag; 37 | 38 | }; 39 | 40 | #endif // SCHOLARSHIP_H 41 | -------------------------------------------------------------------------------- /Students/scholarship.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ScholarShip 4 | 5 | 6 | 7 | 0 8 | 0 9 | 299 10 | 242 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 22 | 23 | 24 | 25 | 日期 26 | 27 | 28 | 29 | 30 | 31 | 32 | 学期 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 金额 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 25 54 | 25 55 | 56 | 57 | 58 | 59 | 25 60 | 25 61 | 62 | 63 | 64 | #pushButton_add1{ 65 | Border-image:url(:/images/add.png); 66 | } 67 | #pushButton_add1:pressed{ 68 | border: 1px solid rgb(24, 103, 155); 69 | border-radius: 5px; 70 | background-color: rgb(124, 203, 255); 71 | color: white; 72 | } 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 年份 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 16777215 91 | 60 92 | 93 | 94 | 95 | Qt::LeftToRight 96 | 97 | 98 | 99 | 3 100 | 101 | 102 | 0 103 | 104 | 105 | 0 106 | 107 | 108 | 0 109 | 110 | 111 | 0 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 25 134 | 25 135 | 136 | 137 | 138 | 139 | 25 140 | 25 141 | 142 | 143 | 144 | #pushButton_add2{ 145 | Border-image:url(:/images/add.png); 146 | } 147 | #pushButton_add2:pressed{ 148 | border: 1px solid rgb(24, 103, 155); 149 | border-radius: 5px; 150 | background-color: rgb(124, 203, 255); 151 | color: white; 152 | } 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | Qt::Horizontal 167 | 168 | 169 | 170 | 40 171 | 20 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 确认 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | -------------------------------------------------------------------------------- /Students/studentinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef STUDENTINFO_H 2 | #define STUDENTINFO_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "datadictionary.h" 9 | #include "grade.h" 10 | #include "honor.h" 11 | #include "debt.h" 12 | #include "scholarship.h" 13 | #include "punish.h" 14 | 15 | namespace Ui { 16 | class StudentInfo; 17 | } 18 | 19 | class StudentInfo : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit StudentInfo(QString username,QWidget *parent = nullptr,int flag = 0,QString number = ""); 25 | ~StudentInfo(); 26 | 27 | private slots: 28 | 29 | void clickPushButton_save(); 30 | void clickPushButton_dataDictionary(); 31 | void clickPushButton_addGrade(); 32 | void clickPushButton_editGrade(); 33 | void clickPushButton_deleteGrade(); 34 | void clickPushButton_addHonor(); 35 | void clickPushButton_editHonor(); 36 | void clickPushButton_deleteHonor(); 37 | void clickPushButton_addDebt(); 38 | void clickPushButton_editDebt(); 39 | void clickPushButton_deleteDebt(); 40 | void clickPushButton_addScholarShip(); 41 | void clickPushButton_editScholarShip(); 42 | void clickPushButton_deleteScholarShip(); 43 | void clickPushButton_addPunish(); 44 | void clickPushButton_editPunish(); 45 | void clickPushButton_deletePunish(); 46 | 47 | void clickPushButton_openFile1(); 48 | void clickPushButton_openFile2(); 49 | void clickPushButton_openFile3(); 50 | void clickPushButton_openFile4(); 51 | void clickPushButton_saveFile1(); 52 | void clickPushButton_saveFile2(); 53 | void clickPushButton_saveFile3(); 54 | void clickPushButton_saveFile4(); 55 | void clickPushButton_openPhoto(); 56 | void clickPushButton_cancelPhoto(); 57 | 58 | signals: 59 | void needUpdataData(); 60 | 61 | private: 62 | Ui::StudentInfo *ui; 63 | 64 | QSqlDatabase db; 65 | QSqlQuery *query; 66 | QString read; 67 | QString write; 68 | QString remove; 69 | QString search; 70 | QString print; 71 | QString import; 72 | QString admin; 73 | 74 | public: 75 | int flag; //flag=0表示插入状态,1为编辑/查看状态 76 | QString number; //学号 77 | QString photoPath; //头像路径 78 | QString username; 79 | void updataDataDictonary(); 80 | void initInfoForInsert(); 81 | void initInforForEdit(); 82 | void updataData_grade(); 83 | void updataData_honor(); 84 | void updataData_debt(); 85 | void updataData_scholarShip(); 86 | void updataData_punish(); 87 | 88 | }; 89 | 90 | #endif // STUDENTINFO_H 91 | -------------------------------------------------------------------------------- /Students/styles/qss/AMOLED.qss: -------------------------------------------------------------------------------- 1 | /* 2 | AMOLED Style Sheet for QT Applications 3 | Author: Jaime A. Quiroga P. 4 | Company: GTRONICK 5 | Last updated: 15/10/2019, 11:40. 6 | Available at: https://github.com/GTRONICK/QSS/blob/master/AMOLED.qss 7 | */ 8 | QMainWindow { 9 | background-color:#000000; 10 | } 11 | QDialog { 12 | background-color:#000000; 13 | } 14 | QColorDialog { 15 | background-color:#000000; 16 | } 17 | QTextEdit { 18 | background-color:#000000; 19 | color: #a9b7c6; 20 | } 21 | QPlainTextEdit { 22 | selection-background-color:#f39c12; 23 | background-color:#000000; 24 | border-style: solid; 25 | border-top-color: transparent; 26 | border-right-color: transparent; 27 | border-left-color: transparent; 28 | border-bottom-color: transparent; 29 | border-width: 1px; 30 | color: #a9b7c6; 31 | } 32 | QPushButton{ 33 | border-style: solid; 34 | border-top-color: transparent; 35 | border-right-color: transparent; 36 | border-left-color: transparent; 37 | border-bottom-color: transparent; 38 | border-width: 1px; 39 | border-style: solid; 40 | color: #a9b7c6; 41 | padding: 2px; 42 | background-color: #000000; 43 | } 44 | QPushButton::default{ 45 | border-style: solid; 46 | border-top-color: transparent; 47 | border-right-color: transparent; 48 | border-left-color: transparent; 49 | border-bottom-color: #e67e22; 50 | border-width: 1px; 51 | color: #a9b7c6; 52 | padding: 2px; 53 | background-color: #000000; 54 | } 55 | QPushButton:hover{ 56 | border-style: solid; 57 | border-top-color: transparent; 58 | border-right-color: transparent; 59 | border-left-color: transparent; 60 | border-bottom-color: #e67e22; 61 | border-bottom-width: 1px; 62 | border-bottom-radius: 6px; 63 | border-style: solid; 64 | color: #FFFFFF; 65 | padding-bottom: 2px; 66 | background-color: #000000; 67 | } 68 | QPushButton:pressed{ 69 | border-style: solid; 70 | border-top-color: transparent; 71 | border-right-color: transparent; 72 | border-left-color: transparent; 73 | border-bottom-color: #e67e22; 74 | border-bottom-width: 2px; 75 | border-bottom-radius: 6px; 76 | border-style: solid; 77 | color: #e67e22; 78 | padding-bottom: 1px; 79 | background-color: #000000; 80 | } 81 | QPushButton:disabled{ 82 | border-style: solid; 83 | border-top-color: transparent; 84 | border-right-color: transparent; 85 | border-left-color: transparent; 86 | border-bottom-color: transparent; 87 | border-bottom-width: 2px; 88 | border-bottom-radius: 6px; 89 | border-style: solid; 90 | color: #808086; 91 | padding-bottom: 1px; 92 | background-color: #000000; 93 | } 94 | QToolButton { 95 | border-style: solid; 96 | border-top-color: transparent; 97 | border-right-color: transparent; 98 | border-left-color: transparent; 99 | border-bottom-color: #e67e22; 100 | border-bottom-width: 1px; 101 | border-style: solid; 102 | color: #a9b7c6; 103 | padding: 2px; 104 | background-color: #000000; 105 | } 106 | QToolButton:hover{ 107 | border-style: solid; 108 | border-top-color: transparent; 109 | border-right-color: transparent; 110 | border-left-color: transparent; 111 | border-bottom-color: #e67e22; 112 | border-bottom-width: 2px; 113 | border-bottom-radius: 6px; 114 | border-style: solid; 115 | color: #FFFFFF; 116 | padding-bottom: 1px; 117 | background-color: #000000; 118 | } 119 | QLineEdit { 120 | border-width: 1px; border-radius: 4px; 121 | border-color: rgb(58, 58, 58); 122 | border-style: inset; 123 | padding: 0 8px; 124 | color: #a9b7c6; 125 | background:#000000; 126 | selection-background-color:#007b50; 127 | selection-color: #FFFFFF; 128 | } 129 | QLabel { 130 | color: #a9b7c6; 131 | } 132 | QLCDNumber { 133 | color: #e67e22; 134 | } 135 | QProgressBar { 136 | text-align: center; 137 | color: rgb(240, 240, 240); 138 | border-width: 1px; 139 | border-radius: 10px; 140 | border-color: rgb(58, 58, 58); 141 | border-style: inset; 142 | background-color:#000000; 143 | } 144 | QProgressBar::chunk { 145 | background-color: #e67e22; 146 | border-radius: 5px; 147 | } 148 | QMenu{ 149 | background-color:#000000; 150 | } 151 | QMenuBar { 152 | background:rgb(0, 0, 0); 153 | color: #a9b7c6; 154 | } 155 | QMenuBar::item { 156 | spacing: 3px; 157 | padding: 1px 4px; 158 | background: transparent; 159 | } 160 | QMenuBar::item:selected { 161 | border-style: solid; 162 | border-top-color: transparent; 163 | border-right-color: transparent; 164 | border-left-color: transparent; 165 | border-bottom-color: #e67e22; 166 | border-bottom-width: 1px; 167 | border-bottom-radius: 6px; 168 | border-style: solid; 169 | color: #FFFFFF; 170 | padding-bottom: 0px; 171 | background-color: #000000; 172 | } 173 | QMenu::item:selected { 174 | border-style: solid; 175 | border-top-color: transparent; 176 | border-right-color: transparent; 177 | border-left-color: #e67e22; 178 | border-bottom-color: transparent; 179 | border-left-width: 2px; 180 | color: #FFFFFF; 181 | padding-left:15px; 182 | padding-top:4px; 183 | padding-bottom:4px; 184 | padding-right:7px; 185 | background-color:#000000; 186 | } 187 | QMenu::item { 188 | border-style: solid; 189 | border-top-color: transparent; 190 | border-right-color: transparent; 191 | border-left-color: transparent; 192 | border-bottom-color: transparent; 193 | border-bottom-width: 1px; 194 | border-style: solid; 195 | color: #a9b7c6; 196 | padding-left:17px; 197 | padding-top:4px; 198 | padding-bottom:4px; 199 | padding-right:7px; 200 | background-color:#000000; 201 | } 202 | QTabWidget { 203 | color:rgb(0,0,0); 204 | background-color:#000000; 205 | } 206 | QTabWidget::pane { 207 | border-color: rgb(77,77,77); 208 | background-color:#000000; 209 | border-style: solid; 210 | border-width: 1px; 211 | border-radius: 6px; 212 | } 213 | QTabBar::tab { 214 | border-style: solid; 215 | border-top-color: transparent; 216 | border-right-color: transparent; 217 | border-left-color: transparent; 218 | border-bottom-color: transparent; 219 | border-bottom-width: 1px; 220 | border-style: solid; 221 | color: #808086; 222 | padding: 3px; 223 | margin-left:3px; 224 | background-color:#000000; 225 | } 226 | QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { 227 | border-style: solid; 228 | border-top-color: transparent; 229 | border-right-color: transparent; 230 | border-left-color: transparent; 231 | border-bottom-color: #e67e22; 232 | border-bottom-width: 2px; 233 | border-style: solid; 234 | color: #FFFFFF; 235 | padding-left: 3px; 236 | padding-bottom: 2px; 237 | margin-left:3px; 238 | background-color:#000000; 239 | } 240 | 241 | QCheckBox { 242 | color: #a9b7c6; 243 | padding: 2px; 244 | } 245 | QCheckBox:disabled { 246 | color: #808086; 247 | padding: 2px; 248 | } 249 | 250 | QCheckBox:hover { 251 | border-radius:4px; 252 | border-style:solid; 253 | padding-left: 1px; 254 | padding-right: 1px; 255 | padding-bottom: 1px; 256 | padding-top: 1px; 257 | border-width:1px; 258 | border-color: rgb(87, 97, 106); 259 | background-color:#000000; 260 | } 261 | QCheckBox::indicator:checked { 262 | 263 | height: 10px; 264 | width: 10px; 265 | border-style:solid; 266 | border-width: 1px; 267 | border-color: #e67e22; 268 | color: #a9b7c6; 269 | background-color: #e67e22; 270 | } 271 | QCheckBox::indicator:unchecked { 272 | 273 | height: 10px; 274 | width: 10px; 275 | border-style:solid; 276 | border-width: 1px; 277 | border-color: #e67e22; 278 | color: #a9b7c6; 279 | background-color: transparent; 280 | } 281 | QRadioButton { 282 | color: #a9b7c6; 283 | background-color:#000000; 284 | padding: 1px; 285 | } 286 | QRadioButton::indicator:checked { 287 | height: 10px; 288 | width: 10px; 289 | border-style:solid; 290 | border-radius:5px; 291 | border-width: 1px; 292 | border-color: #e67e22; 293 | color: #a9b7c6; 294 | background-color: #e67e22; 295 | } 296 | QRadioButton::indicator:!checked { 297 | height: 10px; 298 | width: 10px; 299 | border-style:solid; 300 | border-radius:5px; 301 | border-width: 1px; 302 | border-color: #e67e22; 303 | color: #a9b7c6; 304 | background-color: transparent; 305 | } 306 | QStatusBar { 307 | color:#027f7f; 308 | } 309 | QSpinBox { 310 | color: #a9b7c6; 311 | background-color:#000000; 312 | } 313 | QDoubleSpinBox { 314 | color: #a9b7c6; 315 | background-color:#000000; 316 | } 317 | QTimeEdit { 318 | color: #a9b7c6; 319 | background-color:#000000; 320 | } 321 | QDateTimeEdit { 322 | color: #a9b7c6; 323 | background-color:#000000; 324 | } 325 | QDateEdit { 326 | color: #a9b7c6; 327 | background-color:#000000; 328 | } 329 | QComboBox { 330 | color: #a9b7c6; 331 | background: #1e1d23; 332 | } 333 | QComboBox:editable { 334 | background: #1e1d23; 335 | color: #a9b7c6; 336 | selection-background-color:#000000; 337 | } 338 | QComboBox QAbstractItemView { 339 | color: #a9b7c6; 340 | background: #1e1d23; 341 | selection-color: #FFFFFF; 342 | selection-background-color:#000000; 343 | } 344 | QComboBox:!editable:on, QComboBox::drop-down:editable:on { 345 | color: #a9b7c6; 346 | background: #1e1d23; 347 | } 348 | QFontComboBox { 349 | color: #a9b7c6; 350 | background-color:#000000; 351 | } 352 | QToolBox { 353 | color: #a9b7c6; 354 | background-color:#000000; 355 | } 356 | QToolBox::tab { 357 | color: #a9b7c6; 358 | background-color:#000000; 359 | } 360 | QToolBox::tab:selected { 361 | color: #FFFFFF; 362 | background-color:#000000; 363 | } 364 | QScrollArea { 365 | color: #FFFFFF; 366 | background-color:#000000; 367 | } 368 | QSlider::groove:horizontal { 369 | height: 5px; 370 | background: #e67e22; 371 | } 372 | QSlider::groove:vertical { 373 | width: 5px; 374 | background: #e67e22; 375 | } 376 | QSlider::handle:horizontal { 377 | background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f); 378 | border: 1px solid #5c5c5c; 379 | width: 14px; 380 | margin: -5px 0; 381 | border-radius: 7px; 382 | } 383 | QSlider::handle:vertical { 384 | background: qlineargradient(x1:1, y1:1, x2:0, y2:0, stop:0 #b4b4b4, stop:1 #8f8f8f); 385 | border: 1px solid #5c5c5c; 386 | height: 14px; 387 | margin: 0 -5px; 388 | border-radius: 7px; 389 | } 390 | QSlider::add-page:horizontal { 391 | background: white; 392 | } 393 | QSlider::add-page:vertical { 394 | background: white; 395 | } 396 | QSlider::sub-page:horizontal { 397 | background: #e67e22; 398 | } 399 | QSlider::sub-page:vertical { 400 | background: #e67e22; 401 | } 402 | QScrollBar:horizontal { 403 | max-height: 20px; 404 | background: rgb(0,0,0); 405 | border: 1px transparent grey; 406 | margin: 0px 20px 0px 20px; 407 | } 408 | QScrollBar::handle:horizontal { 409 | background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34)); 410 | border-style: solid; 411 | border-width: 1px; 412 | border-color: rgb(0,0,0); 413 | min-width: 25px; 414 | } 415 | QScrollBar::handle:horizontal:hover { 416 | background: rgb(230, 126, 34); 417 | border-style: solid; 418 | border-width: 1px; 419 | border-color: rgb(0,0,0); 420 | min-width: 25px; 421 | } 422 | QScrollBar::add-line:horizontal { 423 | border: 1px solid; 424 | border-color: rgb(0,0,0); 425 | background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34)); 426 | width: 20px; 427 | subcontrol-position: right; 428 | subcontrol-origin: margin; 429 | } 430 | QScrollBar::add-line:horizontal:hover { 431 | border: 1px solid; 432 | border-color: rgb(0,0,0); 433 | border-radius: 8px; 434 | background: rgb(230, 126, 34); 435 | height: 16px; 436 | width: 16px; 437 | subcontrol-position: right; 438 | subcontrol-origin: margin; 439 | } 440 | QScrollBar::add-line:horizontal:pressed { 441 | border: 1px solid; 442 | border-color: grey; 443 | border-radius: 8px; 444 | background: rgb(230, 126, 34); 445 | height: 16px; 446 | width: 16px; 447 | subcontrol-position: right; 448 | subcontrol-origin: margin; 449 | } 450 | QScrollBar::sub-line:horizontal { 451 | border: 1px solid; 452 | border-color: rgb(0,0,0); 453 | background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34)); 454 | width: 20px; 455 | subcontrol-position: left; 456 | subcontrol-origin: margin; 457 | } 458 | QScrollBar::sub-line:horizontal:hover { 459 | border: 1px solid; 460 | border-color: rgb(0,0,0); 461 | border-radius: 8px; 462 | background: rgb(230, 126, 34); 463 | height: 16px; 464 | width: 16px; 465 | subcontrol-position: left; 466 | subcontrol-origin: margin; 467 | } 468 | QScrollBar::sub-line:horizontal:pressed { 469 | border: 1px solid; 470 | border-color: grey; 471 | border-radius: 8px; 472 | background: rgb(230, 126, 34); 473 | height: 16px; 474 | width: 16px; 475 | subcontrol-position: left; 476 | subcontrol-origin: margin; 477 | } 478 | QScrollBar::left-arrow:horizontal { 479 | border: 1px transparent grey; 480 | border-radius: 3px; 481 | width: 6px; 482 | height: 6px; 483 | background: rgb(0,0,0); 484 | } 485 | QScrollBar::right-arrow:horizontal { 486 | border: 1px transparent grey; 487 | border-radius: 3px; 488 | width: 6px; 489 | height: 6px; 490 | background: rgb(0,0,0); 491 | } 492 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { 493 | background: none; 494 | } 495 | QScrollBar:vertical { 496 | max-width: 20px; 497 | background: rgb(0,0,0); 498 | border: 1px transparent grey; 499 | margin: 20px 0px 20px 0px; 500 | } 501 | QScrollBar::add-line:vertical { 502 | border: 1px solid; 503 | border-color: rgb(0,0,0); 504 | background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34)); 505 | height: 20px; 506 | subcontrol-position: bottom; 507 | subcontrol-origin: margin; 508 | } 509 | QScrollBar::add-line:vertical:hover { 510 | border: 1px solid; 511 | border-color: rgb(0,0,0); 512 | border-radius: 8px; 513 | background: rgb(230, 126, 34); 514 | height: 16px; 515 | width: 16px; 516 | subcontrol-position: bottom; 517 | subcontrol-origin: margin; 518 | } 519 | QScrollBar::add-line:vertical:pressed { 520 | border: 1px solid; 521 | border-color: grey; 522 | border-radius: 8px; 523 | background: rgb(230, 126, 34); 524 | height: 16px; 525 | width: 16px; 526 | subcontrol-position: bottom; 527 | subcontrol-origin: margin; 528 | } 529 | QScrollBar::sub-line:vertical { 530 | border: 1px solid; 531 | border-color: rgb(0,0,0); 532 | background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34)); 533 | height: 20px; 534 | subcontrol-position: top; 535 | subcontrol-origin: margin; 536 | } 537 | QScrollBar::sub-line:vertical:hover { 538 | border: 1px solid; 539 | border-color: rgb(0,0,0); 540 | border-radius: 8px; 541 | background: rgb(230, 126, 34); 542 | height: 16px; 543 | width: 16px; 544 | subcontrol-position: top; 545 | subcontrol-origin: margin; 546 | } 547 | QScrollBar::sub-line:vertical:pressed { 548 | border: 1px solid; 549 | border-color: grey; 550 | border-radius: 8px; 551 | background: rgb(230, 126, 34); 552 | height: 16px; 553 | width: 16px; 554 | subcontrol-position: top; 555 | subcontrol-origin: margin; 556 | } 557 | QScrollBar::handle:vertical { 558 | background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(255, 0, 0, 0), stop:0.7 rgba(255, 0, 0, 0), stop:0.71 rgb(230, 126, 34), stop:1 rgb(230, 126, 34)); 559 | border-style: solid; 560 | border-width: 1px; 561 | border-color: rgb(0,0,0); 562 | min-height: 25px; 563 | } 564 | QScrollBar::handle:vertical:hover { 565 | background: rgb(230, 126, 34); 566 | border-style: solid; 567 | border-width: 1px; 568 | border-color: rgb(0,0,0); 569 | min-heigth: 25px; 570 | } 571 | QScrollBar::up-arrow:vertical { 572 | border: 1px transparent grey; 573 | border-radius: 3px; 574 | width: 6px; 575 | height: 6px; 576 | background: rgb(0,0,0); 577 | } 578 | QScrollBar::down-arrow:vertical { 579 | border: 1px transparent grey; 580 | border-radius: 3px; 581 | width: 6px; 582 | height: 6px; 583 | background: rgb(0,0,0); 584 | } 585 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { 586 | background: none; 587 | } 588 | -------------------------------------------------------------------------------- /Students/styles/qss/ConsoleStyle.qss: -------------------------------------------------------------------------------- 1 | /* 2 | Dark Console Style Sheet for QT Applications 3 | Author: Jaime A. Quiroga P. 4 | Company: GTRONICK 5 | Last updated: 24/05/2018, 17:12. 6 | Available at: https://github.com/GTRONICK/QSS/blob/master/ConsoleStyle.qss 7 | */ 8 | QWidget { 9 | background-color:rgb(0, 0, 0); 10 | color: rgb(240, 240, 240); 11 | border-color: rgb(58, 58, 58); 12 | } 13 | 14 | QPlainTextEdit { 15 | background-color:rgb(0, 0, 0); 16 | color: rgb(200, 200, 200); 17 | selection-background-color: rgb(255, 153, 0); 18 | selection-color: rgb(0, 0, 0); 19 | } 20 | 21 | QTabWidget::pane { 22 | border-top: 1px solid #000000; 23 | } 24 | 25 | QTabBar::tab { 26 | background-color:rgb(0, 0, 0); 27 | border-style: outset; 28 | border-width: 1px; 29 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 30 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 31 | border-bottom-color: rgb(58, 58, 58); 32 | border-bottom-width: 1px; 33 | border-top-width: 0px; 34 | border-style: solid; 35 | color: rgb(255, 153, 0); 36 | padding: 4px; 37 | } 38 | 39 | QTabBar::tab:selected, QTabBar::tab:hover { 40 | color: rgb(255, 255, 255); 41 | background-color:rgb(0, 0, 0); 42 | border-color:rgb(42, 42, 42); 43 | margin-left: 0px; 44 | margin-right: 0px; 45 | border-bottom-right-radius:4px; 46 | border-bottom-left-radius:4px; 47 | } 48 | 49 | QTabBar::tab:last:selected { 50 | background-color:rgb(0, 0, 0); 51 | border-color:rgb(42, 42, 42); 52 | margin-left: 0px; 53 | margin-right: 0px; 54 | border-bottom-right-radius:4px; 55 | border-bottom-left-radius:4px; 56 | } 57 | 58 | QTabBar::tab:!selected { 59 | margin-bottom: 4px; 60 | border-bottom-right-radius:4px; 61 | border-bottom-left-radius:4px; 62 | } 63 | 64 | QPushButton{ 65 | border-style: outset; 66 | border-width: 2px; 67 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 68 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 69 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 70 | border-bottom-color: rgb(58, 58, 58); 71 | border-bottom-width: 1px; 72 | border-style: solid; 73 | color: rgb(255, 255, 255); 74 | padding: 6px; 75 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255)); 76 | } 77 | 78 | QPushButton:hover{ 79 | border-style: outset; 80 | border-width: 2px; 81 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255)); 82 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255)); 83 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255)); 84 | border-bottom-color: rgb(115, 115, 115); 85 | border-bottom-width: 1px; 86 | border-style: solid; 87 | color: rgb(255, 255, 255); 88 | padding: 6px; 89 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(107, 107, 107, 255), stop:1 rgba(157, 157, 157, 255)); 90 | } 91 | 92 | QPushButton:pressed{ 93 | border-style: outset; 94 | border-width: 2px; 95 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(62, 62, 62, 255), stop:1 rgba(22, 22, 22, 255)); 96 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 97 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 98 | border-bottom-color: rgb(58, 58, 58); 99 | border-bottom-width: 1px; 100 | border-style: solid; 101 | color: rgb(255, 255, 255); 102 | padding: 6px; 103 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255)); 104 | } 105 | 106 | QPushButton:disabled{ 107 | border-style: outset; 108 | border-width: 2px; 109 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 110 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 111 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 112 | border-bottom-color: rgb(58, 58, 58); 113 | border-bottom-width: 1px; 114 | border-style: solid; 115 | color: rgb(0, 0, 0); 116 | padding: 6px; 117 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(57, 57, 57, 255), stop:1 rgba(77, 77, 77, 255)); 118 | } 119 | 120 | QLineEdit { 121 | border-width: 1px; border-radius: 4px; 122 | border-color: rgb(58, 58, 58); 123 | border-style: inset; 124 | padding: 0 8px; 125 | color: rgb(255, 255, 255); 126 | background:rgb(101, 101, 101); 127 | selection-background-color: rgb(187, 187, 187); 128 | selection-color: rgb(60, 63, 65); 129 | } 130 | 131 | QProgressBar { 132 | text-align: center; 133 | color: rgb(255, 255, 255); 134 | border-width: 1px; 135 | border-radius: 10px; 136 | border-color: rgb(58, 58, 58); 137 | border-style: inset; 138 | } 139 | 140 | QProgressBar::chunk { 141 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(0, 200, 0, 255), stop:1 rgba(30, 230, 30, 255)); 142 | border-radius: 10px; 143 | } 144 | 145 | QMenuBar { 146 | background:rgb(0, 0, 0); 147 | color: rgb(255, 153, 0); 148 | } 149 | 150 | QMenuBar::item { 151 | spacing: 3px; 152 | padding: 1px 4px; 153 | background: transparent; 154 | } 155 | 156 | QMenuBar::item:selected { 157 | background:rgb(115, 115, 115); 158 | } 159 | 160 | QMenu { 161 | border-width: 2px; 162 | border-radius: 10px; 163 | border-color: rgb(255, 153, 0); 164 | border-style: outset; 165 | } 166 | 167 | QMenu::item { 168 | spacing: 3px; 169 | padding: 3px 15px; 170 | } 171 | 172 | QMenu::item:selected { 173 | spacing: 3px; 174 | padding: 3px 15px; 175 | background:rgb(115, 115, 115); 176 | color:rgb(255, 255, 255); 177 | border-width: 1px; 178 | border-radius: 10px; 179 | border-color: rgb(58, 58, 58); 180 | border-style: inset; 181 | } 182 | -------------------------------------------------------------------------------- /Students/styles/qss/ElegantDark.qss: -------------------------------------------------------------------------------- 1 | /* 2 | ElegantDark Style Sheet for QT Applications 3 | Author: Jaime A. Quiroga P. 4 | Company: GTRONICK 5 | Last updated: 17/04/2018 6 | Available at: https://github.com/GTRONICK/QSS/blob/master/ElegantDark.qss 7 | */ 8 | QMainWindow { 9 | background-color:rgb(82, 82, 82); 10 | } 11 | QTextEdit { 12 | background-color:rgb(42, 42, 42); 13 | color: rgb(0, 255, 0); 14 | } 15 | QPushButton{ 16 | border-style: outset; 17 | border-width: 2px; 18 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 19 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 20 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 21 | border-bottom-color: rgb(58, 58, 58); 22 | border-bottom-width: 1px; 23 | border-style: solid; 24 | color: rgb(255, 255, 255); 25 | padding: 2px; 26 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255)); 27 | } 28 | QPushButton:hover{ 29 | border-style: outset; 30 | border-width: 2px; 31 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255)); 32 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255)); 33 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(180, 180, 180, 255), stop:1 rgba(110, 110, 110, 255)); 34 | border-bottom-color: rgb(115, 115, 115); 35 | border-bottom-width: 1px; 36 | border-style: solid; 37 | color: rgb(255, 255, 255); 38 | padding: 2px; 39 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(107, 107, 107, 255), stop:1 rgba(157, 157, 157, 255)); 40 | } 41 | QPushButton:pressed{ 42 | border-style: outset; 43 | border-width: 2px; 44 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(62, 62, 62, 255), stop:1 rgba(22, 22, 22, 255)); 45 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 46 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 47 | border-bottom-color: rgb(58, 58, 58); 48 | border-bottom-width: 1px; 49 | border-style: solid; 50 | color: rgb(255, 255, 255); 51 | padding: 2px; 52 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255)); 53 | } 54 | QPushButton:disabled{ 55 | border-style: outset; 56 | border-width: 2px; 57 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 58 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 59 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 60 | border-bottom-color: rgb(58, 58, 58); 61 | border-bottom-width: 1px; 62 | border-style: solid; 63 | color: rgb(0, 0, 0); 64 | padding: 2px; 65 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(57, 57, 57, 255), stop:1 rgba(77, 77, 77, 255)); 66 | } 67 | QLineEdit { 68 | border-width: 1px; border-radius: 4px; 69 | border-color: rgb(58, 58, 58); 70 | border-style: inset; 71 | padding: 0 8px; 72 | color: rgb(255, 255, 255); 73 | background:rgb(100, 100, 100); 74 | selection-background-color: rgb(187, 187, 187); 75 | selection-color: rgb(60, 63, 65); 76 | } 77 | QLabel { 78 | color:rgb(255,255,255); 79 | } 80 | QProgressBar { 81 | text-align: center; 82 | color: rgb(240, 240, 240); 83 | border-width: 1px; 84 | border-radius: 10px; 85 | border-color: rgb(58, 58, 58); 86 | border-style: inset; 87 | background-color:rgb(77,77,77); 88 | } 89 | QProgressBar::chunk { 90 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(87, 97, 106, 255), stop:1 rgba(93, 103, 113, 255)); 91 | border-radius: 5px; 92 | } 93 | QMenuBar { 94 | background:rgb(82, 82, 82); 95 | } 96 | QMenuBar::item { 97 | color:rgb(223,219,210); 98 | spacing: 3px; 99 | padding: 1px 4px; 100 | background: transparent; 101 | } 102 | 103 | QMenuBar::item:selected { 104 | background:rgb(115, 115, 115); 105 | } 106 | QMenu::item:selected { 107 | color:rgb(255,255,255); 108 | border-width:2px; 109 | border-style:solid; 110 | padding-left:18px; 111 | padding-right:8px; 112 | padding-top:2px; 113 | padding-bottom:3px; 114 | background:qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(87, 97, 106, 255), stop:1 rgba(93, 103, 113, 255)); 115 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 116 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 117 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(62, 62, 62, 255)); 118 | border-bottom-color: rgb(58, 58, 58); 119 | border-bottom-width: 1px; 120 | } 121 | QMenu::item { 122 | color:rgb(223,219,210); 123 | background-color:rgb(78,78,78); 124 | padding-left:20px; 125 | padding-top:4px; 126 | padding-bottom:4px; 127 | padding-right:10px; 128 | } 129 | QMenu{ 130 | background-color:rgb(78,78,78); 131 | } 132 | QTabWidget { 133 | color:rgb(0,0,0); 134 | background-color:rgb(247,246,246); 135 | } 136 | QTabWidget::pane { 137 | border-color: rgb(77,77,77); 138 | background-color:rgb(101,101,101); 139 | border-style: solid; 140 | border-width: 1px; 141 | border-radius: 6px; 142 | } 143 | QTabBar::tab { 144 | padding:2px; 145 | color:rgb(250,250,250); 146 | background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(77, 77, 77, 255), stop:1 rgba(97, 97, 97, 255)); 147 | border-style: solid; 148 | border-width: 2px; 149 | border-top-right-radius:4px; 150 | border-top-left-radius:4px; 151 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:0.6, x2:0.5, y2:0.4, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(95, 92, 93, 255)); 152 | border-right-color: qlineargradient(spread:pad, x1:0.4, y1:0.5, x2:0.6, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(95, 92, 93, 255)); 153 | border-left-color: qlineargradient(spread:pad, x1:0.6, y1:0.5, x2:0.4, y2:0.5, stop:0 rgba(115, 115, 115, 255), stop:1 rgba(95, 92, 93, 255)); 154 | border-bottom-color: rgb(101,101,101); 155 | } 156 | QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { 157 | background-color:rgb(101,101,101); 158 | margin-left: 0px; 159 | margin-right: 1px; 160 | } 161 | QTabBar::tab:!selected { 162 | margin-top: 1px; 163 | margin-right: 1px; 164 | } 165 | QCheckBox { 166 | color:rgb(223,219,210); 167 | padding: 2px; 168 | } 169 | QCheckBox:hover { 170 | border-radius:4px; 171 | border-style:solid; 172 | padding-left: 1px; 173 | padding-right: 1px; 174 | padding-bottom: 1px; 175 | padding-top: 1px; 176 | border-width:1px; 177 | border-color: rgb(87, 97, 106); 178 | background-color:qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(87, 97, 106, 150), stop:1 rgba(93, 103, 113, 150)); 179 | } 180 | QCheckBox::indicator:checked { 181 | border-radius:4px; 182 | border-style:solid; 183 | border-width:1px; 184 | border-color: rgb(180,180,180); 185 | background-color:qlineargradient(spread:pad, x1:0.5, y1:0.7, x2:0.5, y2:0.3, stop:0 rgba(87, 97, 106, 255), stop:1 rgba(93, 103, 113, 255)); 186 | } 187 | QCheckBox::indicator:unchecked { 188 | border-radius:4px; 189 | border-style:solid; 190 | border-width:1px; 191 | border-color: rgb(87, 97, 106); 192 | background-color:rgb(255,255,255); 193 | } 194 | QStatusBar { 195 | color:rgb(240,240,240); 196 | } 197 | -------------------------------------------------------------------------------- /Students/styles/qss/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Jaime Quiroga 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Students/styles/qss/MacOS.qss: -------------------------------------------------------------------------------- 1 | /* 2 | * MacOS Style Sheet for QT Applications 3 | * Author: Jaime A. Quiroga P. 4 | * Company: GTRONICK 5 | * Last updated: 25/12/2020, 23:10. 6 | * Available at: https://github.com/GTRONICK/QSS/blob/master/MacOS.qss 7 | */ 8 | QMainWindow { 9 | background-color:#ececec; 10 | } 11 | QPushButton, QToolButton, QCommandLinkButton{ 12 | padding: 0 5px 0 5px; 13 | border-style: solid; 14 | border-top-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #c1c9cf, stop:1 #d2d8dd); 15 | border-right-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 16 | border-bottom-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 17 | border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 18 | border-width: 2px; 19 | border-radius: 8px; 20 | color: #616161; 21 | font-weight: bold; 22 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #fbfdfd, stop:0.5 #ffffff, stop:1 #fbfdfd); 23 | } 24 | QPushButton::default, QToolButton::default, QCommandLinkButton::default{ 25 | border: 2px solid transparent; 26 | color: #FFFFFF; 27 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #84afe5, stop:1 #1168e4); 28 | } 29 | QPushButton:hover, QToolButton:hover, QCommandLinkButton:hover{ 30 | color: #3d3d3d; 31 | } 32 | QPushButton:pressed, QToolButton:pressed, QCommandLinkButton:pressed{ 33 | color: #aeaeae; 34 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #ffffff, stop:0.5 #fbfdfd, stop:1 #ffffff); 35 | } 36 | QPushButton:disabled, QToolButton:disabled, QCommandLinkButton:disabled{ 37 | color: #616161; 38 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #dce7eb, stop:0.5 #e0e8eb, stop:1 #dee7ec); 39 | } 40 | QLineEdit, QTextEdit, QPlainTextEdit, QSpinBox, QDoubleSpinBox, QTimeEdit, QDateEdit, QDateTimeEdit { 41 | border-width: 2px; 42 | border-radius: 8px; 43 | border-style: solid; 44 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 45 | border-right-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 46 | border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #c1c9cf, stop:1 #d2d8dd); 47 | border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 48 | background-color: #f4f4f4; 49 | color: #3d3d3d; 50 | } 51 | QLineEdit:focus, QTextEdit:focus, QPlainTextEdit:focus, QSpinBox:focus, QDoubleSpinBox:focus, QTimeEdit:focus, QDateEdit:focus, QDateTimeEdit:focus { 52 | border-width: 2px; 53 | border-radius: 8px; 54 | border-style: solid; 55 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 #85b7e3, stop:1 #9ec1db); 56 | border-right-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #85b7e3, stop:1 #9ec1db); 57 | border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #85b7e3, stop:1 #9ec1db); 58 | border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 #85b7e3, stop:1 #9ec1db); 59 | background-color: #f4f4f4; 60 | color: #3d3d3d; 61 | } 62 | QLineEdit:disabled, QTextEdit:disabled, QPlainTextEdit:disabled, QSpinBox:disabled, QDoubleSpinBox:disabled, QTimeEdit:disabled, QDateEdit:disabled, QDateTimeEdit:disabled { 63 | color: #b9b9b9; 64 | } 65 | QSpinBox::up-button, QDoubleSpinBox::up-button, QTimeEdit::up-button, QDateEdit::up-button, QDateTimeEdit::up-button { 66 | subcontrol-origin: padding; 67 | subcontrol-position: top right; 68 | width: 15px; 69 | color: #272727; 70 | border-left-width: 1px; 71 | border-left-color: darkgray; 72 | border-left-style: solid; 73 | border-top-right-radius: 3px; 74 | padding: 3px; 75 | } 76 | QSpinBox::down-button, QDoubleSpinBox::down-button, QTimeEdit::down-button, QDateEdit::down-button, QDateTimeEdit::down-button { 77 | subcontrol-origin: padding; 78 | subcontrol-position: bottom right; 79 | width: 15px; 80 | color: #272727; 81 | border-left-width: 1px; 82 | border-left-color: darkgray; 83 | border-left-style: solid; 84 | border-bottom-right-radius: 3px; 85 | padding: 3px; 86 | } 87 | QSpinBox::up-button:pressed, QDoubleSpinBox::up-button:pressed, QTimeEdit::up-button:pressed, QDateEdit::up-button:pressed, QDateTimeEdit::up-button:pressed { 88 | color: #aeaeae; 89 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #ffffff, stop:0.5 #fbfdfd, stop:1 #ffffff); 90 | } 91 | QSpinBox::down-button:pressed, QDoubleSpinBox::down-button:pressed, QTimeEdit::down-button:pressed, QDateEdit::down-button:pressed, QDateTimeEdit::down-button:pressed { 92 | color: #aeaeae; 93 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #ffffff, stop:0.5 #fbfdfd, stop:1 #ffffff); 94 | } 95 | QSpinBox::up-button:hover, QDoubleSpinBox::up-button:hover, QTimeEdit::up-button:hover, QDateEdit::up-button:hover, QDateTimeEdit::up-button:hover { 96 | color: #FFFFFF; 97 | border-top-right-radius: 5px; 98 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #84afe5, stop:1 #1168e4); 99 | 100 | } 101 | QSpinBox::down-button:hover, QDoubleSpinBox::down-button:hover, QTimeEdit::down-button:hover, QDateEdit::down-button:hover, QDateTimeEdit::down-button:hover { 102 | color: #FFFFFF; 103 | border-bottom-right-radius: 5px; 104 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #84afe5, stop:1 #1168e4); 105 | } 106 | QSpinBox::up-arrow, QDoubleSpinBox::up-arrow, QTimeEdit::up-arrow, QDateEdit::up-arrow, QDateTimeEdit::up-arrow { 107 | image: url(/usr/share/icons/Adwaita/16x16/actions/go-up-symbolic.symbolic.png); 108 | } 109 | QSpinBox::down-arrow, QDoubleSpinBox::down-arrow, QTimeEdit::down-arrow, QDateEdit::down-arrow, QDateTimeEdit::down-arrow { 110 | image: url(/usr/share/icons/Adwaita/16x16/actions/go-down-symbolic.symbolic.png); 111 | } 112 | QProgressBar { 113 | max-height: 8px; 114 | text-align: center; 115 | font: italic bold 11px; 116 | color: #3d3d3d; 117 | border: 1px solid transparent; 118 | border-radius:4px; 119 | background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #ddd5d5, stop:0.5 #dad3d3, stop:1 #ddd5d5); 120 | } 121 | QProgressBar::chunk { 122 | background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1); 123 | border-radius: 4px; 124 | } 125 | QProgressBar:disabled { 126 | color: #616161; 127 | } 128 | QProgressBar::chunk:disabled { 129 | background-color: #aeaeae; 130 | } 131 | QSlider::groove { 132 | border: 1px solid #bbbbbb; 133 | background-color: #52595d; 134 | border-radius: 4px; 135 | } 136 | QSlider::groove:horizontal { 137 | height: 6px; 138 | } 139 | QSlider::groove:vertical { 140 | width: 6px; 141 | } 142 | QSlider::handle:horizontal { 143 | background: #ffffff; 144 | border-style: solid; 145 | border-width: 1px; 146 | border-color: rgb(207,207,207); 147 | width: 12px; 148 | margin: -5px 0; 149 | border-radius: 7px; 150 | } 151 | QSlider::handle:vertical { 152 | background: #ffffff; 153 | border-style: solid; 154 | border-width: 1px; 155 | border-color: rgb(207,207,207); 156 | height: 12px; 157 | margin: 0 -5px; 158 | border-radius: 7px; 159 | } 160 | QSlider::add-page, QSlider::sub-page { 161 | border: 1px transparent; 162 | background-color: #52595d; 163 | border-radius: 4px; 164 | } 165 | QSlider::add-page:horizontal { 166 | background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #ddd5d5, stop:0.5 #dad3d3, stop:1 #ddd5d5); 167 | } 168 | QSlider::sub-page:horizontal { 169 | background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1); 170 | } 171 | QSlider::add-page:vertical { 172 | background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1); 173 | } 174 | QSlider::sub-page:vertical { 175 | background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #ddd5d5, stop:0.5 #dad3d3, stop:1 #ddd5d5); 176 | } 177 | QSlider::add-page:horizontal:disabled, QSlider::sub-page:horizontal:disabled, QSlider::add-page:vertical:disabled, QSlider::sub-page:vertical:disabled { 178 | background: #b9b9b9; 179 | } 180 | QComboBox, QFontComboBox { 181 | border-width: 2px; 182 | border-radius: 8px; 183 | border-style: solid; 184 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 185 | border-right-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 186 | border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #c1c9cf, stop:1 #d2d8dd); 187 | border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 #c1c9cf, stop:1 #d2d8dd); 188 | background-color: #f4f4f4; 189 | color: #272727; 190 | padding-left: 5px; 191 | } 192 | QComboBox:editable, QComboBox:!editable, QComboBox::drop-down:editable, QComboBox:!editable:on, QComboBox::drop-down:editable:on { 193 | background: #ffff; 194 | } 195 | QComboBox::drop-down { 196 | subcontrol-origin: padding; 197 | subcontrol-position: top right; 198 | width: 15px; 199 | color: #272727; 200 | border-left-width: 1px; 201 | border-left-color: darkgray; 202 | border-left-style: solid; 203 | border-top-right-radius: 3px; 204 | border-bottom-right-radius: 3px; 205 | } 206 | QComboBox::down-arrow { 207 | image: url(/usr/share/icons/Adwaita/16x16/actions/go-down-symbolic.symbolic.png); /*Adawaita icon thene*/ 208 | } 209 | 210 | QComboBox::down-arrow:on { 211 | top: 1px; 212 | left: 1px; 213 | } 214 | QComboBox QAbstractItemView { 215 | border: 1px solid darkgray; 216 | border-radius: 8px; 217 | selection-background-color: #dadada; 218 | selection-color: #272727; 219 | color: #272727; 220 | background: white; 221 | } 222 | QLabel, QCheckBox, QRadioButton { 223 | color: #272727; 224 | } 225 | QCheckBox { 226 | padding: 2px; 227 | } 228 | QCheckBox:disabled, QRadioButton:disabled { 229 | color: #808086; 230 | padding: 2px; 231 | } 232 | 233 | QCheckBox:hover { 234 | border-radius:4px; 235 | border-style:solid; 236 | padding-left: 1px; 237 | padding-right: 1px; 238 | padding-bottom: 1px; 239 | padding-top: 1px; 240 | border-width:1px; 241 | border-color: transparent; 242 | } 243 | QCheckBox::indicator:checked { 244 | image: url(/usr/share/icons/Adwaita/16x16/actions/object-select-symbolic.symbolic.png); 245 | height: 15px; 246 | width: 15px; 247 | border-style:solid; 248 | border-width: 1px; 249 | border-color: #48a5fd; 250 | color: #ffffff; 251 | border-radius: 3px; 252 | background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #48a5fd, stop:0.5 #329cfb, stop:1 #48a5fd); 253 | } 254 | QCheckBox::indicator:unchecked { 255 | 256 | height: 15px; 257 | width: 15px; 258 | border-style:solid; 259 | border-width: 1px; 260 | border-color: #48a5fd; 261 | border-radius: 3px; 262 | background-color: #fbfdfa; 263 | } 264 | QLCDNumber { 265 | color: #616161;; 266 | } 267 | QMenuBar { 268 | background-color: #ececec; 269 | } 270 | QMenuBar::item { 271 | color: #616161; 272 | spacing: 3px; 273 | padding: 1px 4px; 274 | background-color: #ececec; 275 | } 276 | 277 | QMenuBar::item:selected { 278 | background-color: #dadada; 279 | color: #3d3d3d; 280 | } 281 | QMenu { 282 | background-color: #ececec; 283 | } 284 | QMenu::item:selected { 285 | background-color: #dadada; 286 | color: #3d3d3d; 287 | } 288 | QMenu::item { 289 | color: #616161;; 290 | background-color: #e0e0e0; 291 | } 292 | QTabWidget { 293 | color:rgb(0,0,0); 294 | background-color:#000000; 295 | } 296 | QTabWidget::pane { 297 | border-color: #050a0e; 298 | background-color: #e0e0e0; 299 | border-width: 1px; 300 | border-radius: 4px; 301 | position: absolute; 302 | top: -0.5em; 303 | padding-top: 0.5em; 304 | } 305 | 306 | QTabWidget::tab-bar { 307 | alignment: center; 308 | } 309 | 310 | QTabBar::tab { 311 | border-bottom: 1px solid #c0c0c0; 312 | padding: 3px; 313 | color: #272727; 314 | background-color: #fefefc; 315 | margin-left:0px; 316 | } 317 | QTabBar::tab:!last { 318 | border-right: 1px solid; 319 | border-right-color: #c0c0c0; 320 | border-bottom-color: #c0c0c0; 321 | } 322 | QTabBar::tab:first { 323 | border-top-left-radius: 4px; 324 | border-bottom-left-radius: 4px; 325 | } 326 | QTabBar::tab:last { 327 | border-top-right-radius: 4px; 328 | border-bottom-right-radius: 4px; 329 | } 330 | QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { 331 | color: #FFFFFF; 332 | background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #84afe5, stop:1 #1168e4); 333 | } 334 | QRadioButton::indicator { 335 | height: 14px; 336 | width: 14px; 337 | border-style:solid; 338 | border-radius:7px; 339 | border-width: 1px; 340 | } 341 | QRadioButton::indicator:checked { 342 | border-color: #48a5fd; 343 | background-color: qradialgradient(cx:0.5, cy:0.5, radius:0.4,fx:0.5, fy:0.5, stop:0 #ffffff, stop:0.5 #ffffff, stop:0.6 #48a5fd, stop:1 #48a5fd); 344 | } 345 | QRadioButton::indicator:!checked { 346 | border-color: #a9b7c6; 347 | background-color: #fbfdfa; 348 | } 349 | QStatusBar { 350 | color:#027f7f; 351 | } 352 | 353 | QDial { 354 | background: #16a085; 355 | } 356 | 357 | QToolBox { 358 | color: #a9b7c6; 359 | background-color: #222b2e; 360 | } 361 | QToolBox::tab { 362 | color: #a9b7c6; 363 | background-color:#222b2e; 364 | } 365 | QToolBox::tab:selected { 366 | color: #FFFFFF; 367 | background-color:#222b2e; 368 | } 369 | QScrollArea { 370 | color: #FFFFFF; 371 | background-color:#222b2e; 372 | } 373 | 374 | QScrollBar:horizontal { 375 | max-height: 10px; 376 | border: 1px transparent grey; 377 | margin: 0px 20px 0px 20px; 378 | background: transparent; 379 | } 380 | QScrollBar:vertical { 381 | max-width: 10px; 382 | border: 1px transparent grey; 383 | margin: 20px 0px 20px 0px; 384 | background: transparent; 385 | } 386 | QScrollBar::handle:vertical, QScrollBar::handle:horizontal { 387 | background: #52595d; 388 | border-style: transparent; 389 | border-radius: 4px; 390 | min-height: 25px; 391 | } 392 | QScrollBar::handle:horizontal:hover, QScrollBar::handle:vertical:hover { 393 | background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1); 394 | } 395 | QScrollBar::add-line, QScrollBar::sub-line { 396 | border: 2px transparent grey; 397 | border-radius: 4px; 398 | subcontrol-origin: margin; 399 | background: #b9b9b9; 400 | } 401 | QScrollBar::add-line:horizontal { 402 | width: 20px; 403 | subcontrol-position: right; 404 | } 405 | QScrollBar::add-line:vertical { 406 | height: 20px; 407 | subcontrol-position: bottom; 408 | } 409 | QScrollBar::sub-line:horizontal { 410 | width: 20px; 411 | subcontrol-position: left; 412 | } 413 | QScrollBar::sub-line:vertical { 414 | height: 20px; 415 | subcontrol-position: top; 416 | } 417 | QScrollBar::add-line:vertical:pressed, QScrollBar::add-line:horizontal:pressed, QScrollBar::sub-line:horizontal:pressed, QScrollBar::sub-line:vertical:pressed { 418 | background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #467dd1, stop:0.5 #3b88fc, stop:1 #467dd1); 419 | } 420 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal, QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { 421 | background: none; 422 | } 423 | QScrollBar::up-arrow:vertical { 424 | image: url(/usr/share/icons/Adwaita/16x16/actions/go-up-symbolic.symbolic.png); 425 | } 426 | QScrollBar::down-arrow:vertical { 427 | image: url(/usr/share/icons/Adwaita/16x16/actions/go-down-symbolic.symbolic.png); 428 | } 429 | QScrollBar::left-arrow:horizontal { 430 | image: url(/usr/share/icons/Adwaita/16x16/actions/go-previous-symbolic.symbolic.png); 431 | } 432 | QScrollBar::right-arrow:horizontal { 433 | image: url(/usr/share/icons/Adwaita/16x16/actions/go-next-symbolic.symbolic.png); 434 | } 435 | -------------------------------------------------------------------------------- /Students/styles/qss/ManjaroMix.qss: -------------------------------------------------------------------------------- 1 | /* 2 | ManjaroMix Style Sheet for QT Applications 3 | Author: Jaime A. Quiroga P. 4 | Company: GTRONICK 5 | Last updated: 25/02/2020, 15:42. 6 | Available at: https://github.com/GTRONICK/QSS/blob/master/ManjaroMix.qss 7 | */ 8 | QMainWindow { 9 | background-color:#151a1e; 10 | } 11 | QCalendar { 12 | background-color: #151a1e; 13 | } 14 | QTextEdit { 15 | border-width: 1px; 16 | border-style: solid; 17 | border-color: #4fa08b; 18 | background-color: #222b2e; 19 | color: #d3dae3; 20 | } 21 | QPlainTextEdit { 22 | border-width: 1px; 23 | border-style: solid; 24 | border-color: #4fa08b; 25 | background-color: #222b2e; 26 | color: #d3dae3; 27 | } 28 | QToolButton { 29 | border-style: solid; 30 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); 31 | border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); 32 | border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); 33 | border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); 34 | border-width: 1px; 35 | border-radius: 5px; 36 | color: #d3dae3; 37 | padding: 2px; 38 | background-color: rgb(255,255,255); 39 | } 40 | QToolButton:hover{ 41 | border-style: solid; 42 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); 43 | border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(197, 197, 197), stop:1 rgb(227, 227, 227)); 44 | border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(197, 197, 197)); 45 | border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); 46 | border-width: 1px; 47 | border-radius: 5px; 48 | color: rgb(0,0,0); 49 | padding: 2px; 50 | background-color: rgb(255,255,255); 51 | } 52 | QToolButton:pressed{ 53 | border-style: solid; 54 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); 55 | border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); 56 | border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); 57 | border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); 58 | border-width: 1px; 59 | border-radius: 5px; 60 | color: rgb(0,0,0); 61 | padding: 2px; 62 | background-color: rgb(142,142,142); 63 | } 64 | QPushButton{ 65 | border-style: solid; 66 | border-color: #050a0e; 67 | border-width: 1px; 68 | border-radius: 5px; 69 | color: #d3dae3; 70 | padding: 2px; 71 | background-color: #151a1e; 72 | } 73 | QPushButton::default{ 74 | border-style: solid; 75 | border-color: #050a0e; 76 | border-width: 1px; 77 | border-radius: 5px; 78 | color: #FFFFFF; 79 | padding: 2px; 80 | background-color: #151a1e;; 81 | } 82 | QPushButton:hover{ 83 | border-style: solid; 84 | border-color: #050a0e; 85 | border-width: 1px; 86 | border-radius: 5px; 87 | color: #d3dae3; 88 | padding: 2px; 89 | background-color: #1c1f1f; 90 | } 91 | QPushButton:pressed{ 92 | border-style: solid; 93 | border-color: #050a0e; 94 | border-width: 1px; 95 | border-radius: 5px; 96 | color: #d3dae3; 97 | padding: 2px; 98 | background-color: #2c2f2f; 99 | } 100 | QPushButton:disabled{ 101 | border-style: solid; 102 | border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); 103 | border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); 104 | border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); 105 | border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); 106 | border-width: 1px; 107 | border-radius: 5px; 108 | color: #808086; 109 | padding: 2px; 110 | background-color: rgb(142,142,142); 111 | } 112 | QLineEdit { 113 | border-width: 1px; 114 | border-style: solid; 115 | border-color: #4fa08b; 116 | background-color: #222b2e; 117 | color: #d3dae3; 118 | } 119 | QLabel { 120 | color: #d3dae3; 121 | } 122 | QLCDNumber { 123 | color: #4d9b87; 124 | } 125 | QProgressBar { 126 | text-align: center; 127 | color: #d3dae3; 128 | border-radius: 10px; 129 | border-color: transparent; 130 | border-style: solid; 131 | background-color: #52595d; 132 | } 133 | QProgressBar::chunk { 134 | background-color: #214037 ; 135 | border-radius: 10px; 136 | } 137 | QMenuBar { 138 | background-color: #151a1e; 139 | } 140 | QMenuBar::item { 141 | color: #d3dae3; 142 | spacing: 3px; 143 | padding: 1px 4px; 144 | background-color: #151a1e; 145 | } 146 | 147 | QMenuBar::item:selected { 148 | background-color: #252a2e; 149 | color: #FFFFFF; 150 | } 151 | QMenu { 152 | background-color: #151a1e; 153 | } 154 | QMenu::item:selected { 155 | background-color: #252a2e; 156 | color: #FFFFFF; 157 | } 158 | QMenu::item { 159 | color: #d3dae3; 160 | background-color: #151a1e; 161 | } 162 | QTabWidget { 163 | color:rgb(0,0,0); 164 | background-color:#000000; 165 | } 166 | QTabWidget::pane { 167 | border-color: #050a0e; 168 | background-color: #1e282c; 169 | border-style: solid; 170 | border-width: 1px; 171 | border-bottom-left-radius: 4px; 172 | border-bottom-right-radius: 4px; 173 | } 174 | QTabBar::tab:first { 175 | border-style: solid; 176 | border-left-width:1px; 177 | border-right-width:0px; 178 | border-top-width:1px; 179 | border-bottom-width:0px; 180 | border-top-color: #050a0e; 181 | border-left-color: #050a0e; 182 | border-bottom-color: #050a0e; 183 | border-top-left-radius: 4px; 184 | color: #d3dae3; 185 | padding: 3px; 186 | margin-left:0px; 187 | background-color: #151a1e; 188 | } 189 | QTabBar::tab:last { 190 | border-style: solid; 191 | border-top-width:1px; 192 | border-left-width:1px; 193 | border-right-width:1px; 194 | border-bottom-width:0px; 195 | border-color: #050a0e; 196 | border-top-right-radius: 4px; 197 | color: #d3dae3; 198 | padding: 3px; 199 | margin-left:0px; 200 | background-color: #151a1e; 201 | } 202 | QTabBar::tab { 203 | border-style: solid; 204 | border-top-width:1px; 205 | border-bottom-width:0px; 206 | border-left-width:1px; 207 | border-top-color: #050a0e; 208 | border-left-color: #050a0e; 209 | border-bottom-color: #050a0e; 210 | color: #d3dae3; 211 | padding: 3px; 212 | margin-left:0px; 213 | background-color: #151a1e; 214 | } 215 | QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { 216 | border-style: solid; 217 | border-left-width:1px; 218 | border-bottom-width:0px; 219 | border-right-color: transparent; 220 | border-top-color: #050a0e; 221 | border-left-color: #050a0e; 222 | border-bottom-color: #050a0e; 223 | color: #FFFFFF; 224 | padding: 3px; 225 | margin-left:0px; 226 | background-color: #1e282c; 227 | } 228 | 229 | QTabBar::tab:selected, QTabBar::tab:first:selected, QTabBar::tab:hover { 230 | border-style: solid; 231 | border-left-width:1px; 232 | border-bottom-width:0px; 233 | border-top-width:1px; 234 | border-right-color: transparent; 235 | border-top-color: #050a0e; 236 | border-left-color: #050a0e; 237 | border-bottom-color: #050a0e; 238 | color: #FFFFFF; 239 | padding: 3px; 240 | margin-left:0px; 241 | background-color: #1e282c; 242 | } 243 | 244 | QCheckBox { 245 | color: #d3dae3; 246 | padding: 2px; 247 | } 248 | QCheckBox:disabled { 249 | color: #808086; 250 | padding: 2px; 251 | } 252 | 253 | QCheckBox:hover { 254 | border-radius:4px; 255 | border-style:solid; 256 | padding-left: 1px; 257 | padding-right: 1px; 258 | padding-bottom: 1px; 259 | padding-top: 1px; 260 | border-width:1px; 261 | border-color: transparent; 262 | } 263 | QCheckBox::indicator:checked { 264 | 265 | height: 10px; 266 | width: 10px; 267 | border-style:solid; 268 | border-width: 1px; 269 | border-color: #4fa08b; 270 | color: #000000; 271 | background-color: qradialgradient(cx:0.4, cy:0.4, radius: 1.5,fx:0, fy:0, stop:0 #1e282c, stop:0.3 #1e282c, stop:0.4 #4fa08b, stop:0.5 #1e282c, stop:1 #1e282c); 272 | } 273 | QCheckBox::indicator:unchecked { 274 | 275 | height: 10px; 276 | width: 10px; 277 | border-style:solid; 278 | border-width: 1px; 279 | border-color: #4fa08b; 280 | color: #000000; 281 | } 282 | QRadioButton { 283 | color: #d3dae3; 284 | padding: 1px; 285 | } 286 | QRadioButton::indicator:checked { 287 | height: 10px; 288 | width: 10px; 289 | border-style:solid; 290 | border-radius:5px; 291 | border-width: 1px; 292 | border-color: #4fa08b; 293 | color: #a9b7c6; 294 | background-color: qradialgradient(cx:0.5, cy:0.5, radius:0.4,fx:0.5, fy:0.5, stop:0 #4fa08b, stop:1 #1e282c); 295 | } 296 | QRadioButton::indicator:!checked { 297 | height: 10px; 298 | width: 10px; 299 | border-style:solid; 300 | border-radius:5px; 301 | border-width: 1px; 302 | border-color: #4fa08b; 303 | color: #a9b7c6; 304 | background-color: transparent; 305 | } 306 | QStatusBar { 307 | color:#027f7f; 308 | } 309 | QSpinBox { 310 | color: #d3dae3; 311 | background-color: #222b2e; 312 | border-width: 1px; 313 | border-style: solid; 314 | border-color: #4fa08b; 315 | } 316 | QDoubleSpinBox { 317 | color: #d3dae3; 318 | background-color: #222b2e; 319 | border-width: 1px; 320 | border-style: solid; 321 | border-color: #4fa08b; 322 | } 323 | QTimeEdit { 324 | color: #d3dae3; 325 | background-color: #222b2e; 326 | border-width: 1px; 327 | border-style: solid; 328 | border-color: #4fa08b; 329 | } 330 | QDateTimeEdit { 331 | color: #d3dae3; 332 | background-color: #222b2e; 333 | border-width: 1px; 334 | border-style: solid; 335 | border-color: #4fa08b; 336 | } 337 | QDateEdit { 338 | color: #d3dae3; 339 | background-color: #222b2e; 340 | border-width: 1px; 341 | border-style: solid; 342 | border-color: #4fa08b; 343 | } 344 | QFontComboBox { 345 | color: #d3dae3; 346 | background-color: #222b2e; 347 | border-width: 1px; 348 | border-style: solid; 349 | border-color: #4fa08b; 350 | } 351 | QComboBox { 352 | color: #d3dae3; 353 | background-color: #222b2e; 354 | border-width: 1px; 355 | border-style: solid; 356 | border-color: #4fa08b; 357 | } 358 | 359 | QDial { 360 | background: #16a085; 361 | } 362 | 363 | QToolBox { 364 | color: #a9b7c6; 365 | background-color: #222b2e; 366 | } 367 | QToolBox::tab { 368 | color: #a9b7c6; 369 | background-color:#222b2e; 370 | } 371 | QToolBox::tab:selected { 372 | color: #FFFFFF; 373 | background-color:#222b2e; 374 | } 375 | QScrollArea { 376 | color: #FFFFFF; 377 | background-color:#222b2e; 378 | } 379 | QSlider::groove:horizontal { 380 | height: 5px; 381 | background-color: #52595d; 382 | } 383 | QSlider::groove:vertical { 384 | width: 5px; 385 | background-color: #52595d; 386 | } 387 | QSlider::handle:horizontal { 388 | background: #1a2224; 389 | border-style: solid; 390 | border-width: 1px; 391 | border-color: rgb(207,207,207); 392 | width: 12px; 393 | margin: -5px 0; 394 | border-radius: 7px; 395 | } 396 | QSlider::handle:vertical { 397 | background: #1a2224; 398 | border-style: solid; 399 | border-width: 1px; 400 | border-color: rgb(207,207,207); 401 | height: 12px; 402 | margin: 0 -5px; 403 | border-radius: 7px; 404 | } 405 | QSlider::add-page:horizontal { 406 | background: #52595d; 407 | } 408 | QSlider::add-page:vertical { 409 | background: #52595d; 410 | } 411 | QSlider::sub-page:horizontal { 412 | background-color: #15433a; 413 | } 414 | QSlider::sub-page:vertical { 415 | background-color: #15433a; 416 | } 417 | QScrollBar:horizontal { 418 | max-height: 10px; 419 | border: 1px transparent grey; 420 | margin: 0px 20px 0px 20px; 421 | background: transparent; 422 | } 423 | QScrollBar:vertical { 424 | max-width: 10px; 425 | border: 1px transparent grey; 426 | margin: 20px 0px 20px 0px; 427 | background: transparent; 428 | } 429 | QScrollBar::handle:horizontal { 430 | background: #52595d; 431 | border-style: transparent; 432 | border-radius: 4px; 433 | min-width: 25px; 434 | } 435 | QScrollBar::handle:horizontal:hover { 436 | background: #58a492; 437 | border-style: transparent; 438 | border-radius: 4px; 439 | min-width: 25px; 440 | } 441 | QScrollBar::handle:vertical { 442 | background: #52595d; 443 | border-style: transparent; 444 | border-radius: 4px; 445 | min-height: 25px; 446 | } 447 | QScrollBar::handle:vertical:hover { 448 | background: #58a492; 449 | border-style: transparent; 450 | border-radius: 4px; 451 | min-height: 25px; 452 | } 453 | QScrollBar::add-line:horizontal { 454 | border: 2px transparent grey; 455 | border-top-right-radius: 4px; 456 | border-bottom-right-radius: 4px; 457 | background: #15433a; 458 | width: 20px; 459 | subcontrol-position: right; 460 | subcontrol-origin: margin; 461 | } 462 | QScrollBar::add-line:horizontal:pressed { 463 | border: 2px transparent grey; 464 | border-top-right-radius: 4px; 465 | border-bottom-right-radius: 4px; 466 | background: rgb(181,181,181); 467 | width: 20px; 468 | subcontrol-position: right; 469 | subcontrol-origin: margin; 470 | } 471 | QScrollBar::add-line:vertical { 472 | border: 2px transparent grey; 473 | border-bottom-left-radius: 4px; 474 | border-bottom-right-radius: 4px; 475 | background: #15433a; 476 | height: 20px; 477 | subcontrol-position: bottom; 478 | subcontrol-origin: margin; 479 | } 480 | QScrollBar::add-line:vertical:pressed { 481 | border: 2px transparent grey; 482 | border-bottom-left-radius: 4px; 483 | border-bottom-right-radius: 4px; 484 | background: rgb(181,181,181); 485 | height: 20px; 486 | subcontrol-position: bottom; 487 | subcontrol-origin: margin; 488 | } 489 | QScrollBar::sub-line:horizontal { 490 | border: 2px transparent grey; 491 | border-top-left-radius: 4px; 492 | border-bottom-left-radius: 4px; 493 | background: #15433a; 494 | width: 20px; 495 | subcontrol-position: left; 496 | subcontrol-origin: margin; 497 | } 498 | QScrollBar::sub-line:horizontal:pressed { 499 | border: 2px transparent grey; 500 | border-top-left-radius: 4px; 501 | border-bottom-left-radius: 4px; 502 | background: rgb(181,181,181); 503 | width: 20px; 504 | subcontrol-position: left; 505 | subcontrol-origin: margin; 506 | } 507 | QScrollBar::sub-line:vertical { 508 | border: 2px transparent grey; 509 | border-top-left-radius: 4px; 510 | border-top-right-radius: 4px; 511 | background: #15433a; 512 | height: 20px; 513 | subcontrol-position: top; 514 | subcontrol-origin: margin; 515 | } 516 | QScrollBar::sub-line:vertical:pressed { 517 | border: 2px transparent grey; 518 | border-top-left-radius: 4px; 519 | border-top-right-radius: 4px; 520 | background: rgb(181,181,181); 521 | height: 20px; 522 | subcontrol-position: top; 523 | subcontrol-origin: margin; 524 | } 525 | 526 | QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { 527 | background: none; 528 | } 529 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { 530 | background: none; 531 | } 532 | -------------------------------------------------------------------------------- /Students/styles/qss/MaterialDark.qss: -------------------------------------------------------------------------------- 1 | /* 2 | Material Dark Style Sheet for QT Applications 3 | Author: Jaime A. Quiroga P. 4 | Inspired on https://github.com/jxfwinter/qt-material-stylesheet 5 | Company: GTRONICK 6 | Last updated: 04/12/2018, 15:00. 7 | Available at: https://github.com/GTRONICK/QSS/blob/master/MaterialDark.qss 8 | */ 9 | QMainWindow { 10 | background-color:#1e1d23; 11 | } 12 | QDialog { 13 | background-color:#1e1d23; 14 | } 15 | QColorDialog { 16 | background-color:#1e1d23; 17 | } 18 | QTextEdit { 19 | background-color:#1e1d23; 20 | color: #a9b7c6; 21 | } 22 | QPlainTextEdit { 23 | selection-background-color:#007b50; 24 | background-color:#1e1d23; 25 | border-style: solid; 26 | border-top-color: transparent; 27 | border-right-color: transparent; 28 | border-left-color: transparent; 29 | border-bottom-color: transparent; 30 | border-width: 1px; 31 | color: #a9b7c6; 32 | } 33 | QPushButton{ 34 | border-style: solid; 35 | border-top-color: transparent; 36 | border-right-color: transparent; 37 | border-left-color: transparent; 38 | border-bottom-color: transparent; 39 | border-width: 1px; 40 | border-style: solid; 41 | color: #a9b7c6; 42 | padding: 2px; 43 | background-color: #1e1d23; 44 | } 45 | QPushButton::default{ 46 | border-style: inset; 47 | border-top-color: transparent; 48 | border-right-color: transparent; 49 | border-left-color: transparent; 50 | border-bottom-color: #04b97f; 51 | border-width: 1px; 52 | color: #a9b7c6; 53 | padding: 2px; 54 | background-color: #1e1d23; 55 | } 56 | QToolButton { 57 | border-style: solid; 58 | border-top-color: transparent; 59 | border-right-color: transparent; 60 | border-left-color: transparent; 61 | border-bottom-color: #04b97f; 62 | border-bottom-width: 1px; 63 | border-style: solid; 64 | color: #a9b7c6; 65 | padding: 2px; 66 | background-color: #1e1d23; 67 | } 68 | QToolButton:hover{ 69 | border-style: solid; 70 | border-top-color: transparent; 71 | border-right-color: transparent; 72 | border-left-color: transparent; 73 | border-bottom-color: #37efba; 74 | border-bottom-width: 2px; 75 | border-style: solid; 76 | color: #FFFFFF; 77 | padding-bottom: 1px; 78 | background-color: #1e1d23; 79 | } 80 | QPushButton:hover{ 81 | border-style: solid; 82 | border-top-color: transparent; 83 | border-right-color: transparent; 84 | border-left-color: transparent; 85 | border-bottom-color: #37efba; 86 | border-bottom-width: 1px; 87 | border-style: solid; 88 | color: #FFFFFF; 89 | padding-bottom: 2px; 90 | background-color: #1e1d23; 91 | } 92 | QPushButton:pressed{ 93 | border-style: solid; 94 | border-top-color: transparent; 95 | border-right-color: transparent; 96 | border-left-color: transparent; 97 | border-bottom-color: #37efba; 98 | border-bottom-width: 2px; 99 | border-style: solid; 100 | color: #37efba; 101 | padding-bottom: 1px; 102 | background-color: #1e1d23; 103 | } 104 | QPushButton:disabled{ 105 | border-style: solid; 106 | border-top-color: transparent; 107 | border-right-color: transparent; 108 | border-left-color: transparent; 109 | border-bottom-color: #808086; 110 | border-bottom-width: 2px; 111 | border-style: solid; 112 | color: #808086; 113 | padding-bottom: 1px; 114 | background-color: #1e1d23; 115 | } 116 | QLineEdit { 117 | border-width: 1px; border-radius: 4px; 118 | border-color: rgb(58, 58, 58); 119 | border-style: inset; 120 | padding: 0 8px; 121 | color: #a9b7c6; 122 | background:#1e1d23; 123 | selection-background-color:#007b50; 124 | selection-color: #FFFFFF; 125 | } 126 | QLabel { 127 | color: #a9b7c6; 128 | } 129 | QLCDNumber { 130 | color: #37e6b4; 131 | } 132 | QProgressBar { 133 | text-align: center; 134 | color: rgb(240, 240, 240); 135 | border-width: 1px; 136 | border-radius: 10px; 137 | border-color: rgb(58, 58, 58); 138 | border-style: inset; 139 | background-color:#1e1d23; 140 | } 141 | QProgressBar::chunk { 142 | background-color: #04b97f; 143 | border-radius: 5px; 144 | } 145 | QMenuBar { 146 | background-color: #1e1d23; 147 | } 148 | QMenuBar::item { 149 | color: #a9b7c6; 150 | spacing: 3px; 151 | padding: 1px 4px; 152 | background: #1e1d23; 153 | } 154 | 155 | QMenuBar::item:selected { 156 | background:#1e1d23; 157 | color: #FFFFFF; 158 | } 159 | QMenu::item:selected { 160 | border-style: solid; 161 | border-top-color: transparent; 162 | border-right-color: transparent; 163 | border-left-color: #04b97f; 164 | border-bottom-color: transparent; 165 | border-left-width: 2px; 166 | color: #FFFFFF; 167 | padding-left:15px; 168 | padding-top:4px; 169 | padding-bottom:4px; 170 | padding-right:7px; 171 | background-color: #1e1d23; 172 | } 173 | QMenu::item { 174 | border-style: solid; 175 | border-top-color: transparent; 176 | border-right-color: transparent; 177 | border-left-color: transparent; 178 | border-bottom-color: transparent; 179 | border-bottom-width: 1px; 180 | border-style: solid; 181 | color: #a9b7c6; 182 | padding-left:17px; 183 | padding-top:4px; 184 | padding-bottom:4px; 185 | padding-right:7px; 186 | background-color: #1e1d23; 187 | } 188 | QMenu{ 189 | background-color:#1e1d23; 190 | } 191 | QTabWidget { 192 | color:rgb(0,0,0); 193 | background-color:#1e1d23; 194 | } 195 | QTabWidget::pane { 196 | border-color: rgb(77,77,77); 197 | background-color:#1e1d23; 198 | border-style: solid; 199 | border-width: 1px; 200 | border-radius: 6px; 201 | } 202 | QTabBar::tab { 203 | border-style: solid; 204 | border-top-color: transparent; 205 | border-right-color: transparent; 206 | border-left-color: transparent; 207 | border-bottom-color: transparent; 208 | border-bottom-width: 1px; 209 | border-style: solid; 210 | color: #808086; 211 | padding: 3px; 212 | margin-left:3px; 213 | background-color: #1e1d23; 214 | } 215 | QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { 216 | border-style: solid; 217 | border-top-color: transparent; 218 | border-right-color: transparent; 219 | border-left-color: transparent; 220 | border-bottom-color: #04b97f; 221 | border-bottom-width: 2px; 222 | border-style: solid; 223 | color: #FFFFFF; 224 | padding-left: 3px; 225 | padding-bottom: 2px; 226 | margin-left:3px; 227 | background-color: #1e1d23; 228 | } 229 | 230 | QCheckBox { 231 | color: #a9b7c6; 232 | padding: 2px; 233 | } 234 | QCheckBox:disabled { 235 | color: #808086; 236 | padding: 2px; 237 | } 238 | 239 | QCheckBox:hover { 240 | border-radius:4px; 241 | border-style:solid; 242 | padding-left: 1px; 243 | padding-right: 1px; 244 | padding-bottom: 1px; 245 | padding-top: 1px; 246 | border-width:1px; 247 | border-color: rgb(87, 97, 106); 248 | background-color:#1e1d23; 249 | } 250 | QCheckBox::indicator:checked { 251 | 252 | height: 10px; 253 | width: 10px; 254 | border-style:solid; 255 | border-width: 1px; 256 | border-color: #04b97f; 257 | color: #a9b7c6; 258 | background-color: #04b97f; 259 | } 260 | QCheckBox::indicator:unchecked { 261 | 262 | height: 10px; 263 | width: 10px; 264 | border-style:solid; 265 | border-width: 1px; 266 | border-color: #04b97f; 267 | color: #a9b7c6; 268 | background-color: transparent; 269 | } 270 | QRadioButton { 271 | color: #a9b7c6; 272 | background-color: #1e1d23; 273 | padding: 1px; 274 | } 275 | QRadioButton::indicator:checked { 276 | height: 10px; 277 | width: 10px; 278 | border-style:solid; 279 | border-radius:5px; 280 | border-width: 1px; 281 | border-color: #04b97f; 282 | color: #a9b7c6; 283 | background-color: #04b97f; 284 | } 285 | QRadioButton::indicator:!checked { 286 | height: 10px; 287 | width: 10px; 288 | border-style:solid; 289 | border-radius:5px; 290 | border-width: 1px; 291 | border-color: #04b97f; 292 | color: #a9b7c6; 293 | background-color: transparent; 294 | } 295 | QStatusBar { 296 | color:#027f7f; 297 | } 298 | QSpinBox { 299 | color: #a9b7c6; 300 | background-color: #1e1d23; 301 | } 302 | QDoubleSpinBox { 303 | color: #a9b7c6; 304 | background-color: #1e1d23; 305 | } 306 | QTimeEdit { 307 | color: #a9b7c6; 308 | background-color: #1e1d23; 309 | } 310 | QDateTimeEdit { 311 | color: #a9b7c6; 312 | background-color: #1e1d23; 313 | } 314 | QDateEdit { 315 | color: #a9b7c6; 316 | background-color: #1e1d23; 317 | } 318 | QComboBox { 319 | color: #a9b7c6; 320 | background: #1e1d23; 321 | } 322 | QComboBox:editable { 323 | background: #1e1d23; 324 | color: #a9b7c6; 325 | selection-background-color: #1e1d23; 326 | } 327 | QComboBox QAbstractItemView { 328 | color: #a9b7c6; 329 | background: #1e1d23; 330 | selection-color: #FFFFFF; 331 | selection-background-color: #1e1d23; 332 | } 333 | QComboBox:!editable:on, QComboBox::drop-down:editable:on { 334 | color: #a9b7c6; 335 | background: #1e1d23; 336 | } 337 | QFontComboBox { 338 | color: #a9b7c6; 339 | background-color: #1e1d23; 340 | } 341 | QToolBox { 342 | color: #a9b7c6; 343 | background-color: #1e1d23; 344 | } 345 | QToolBox::tab { 346 | color: #a9b7c6; 347 | background-color: #1e1d23; 348 | } 349 | QToolBox::tab:selected { 350 | color: #FFFFFF; 351 | background-color: #1e1d23; 352 | } 353 | QScrollArea { 354 | color: #FFFFFF; 355 | background-color: #1e1d23; 356 | } 357 | QSlider::groove:horizontal { 358 | height: 5px; 359 | background: #04b97f; 360 | } 361 | QSlider::groove:vertical { 362 | width: 5px; 363 | background: #04b97f; 364 | } 365 | QSlider::handle:horizontal { 366 | background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f); 367 | border: 1px solid #5c5c5c; 368 | width: 14px; 369 | margin: -5px 0; 370 | border-radius: 7px; 371 | } 372 | QSlider::handle:vertical { 373 | background: qlineargradient(x1:1, y1:1, x2:0, y2:0, stop:0 #b4b4b4, stop:1 #8f8f8f); 374 | border: 1px solid #5c5c5c; 375 | height: 14px; 376 | margin: 0 -5px; 377 | border-radius: 7px; 378 | } 379 | QSlider::add-page:horizontal { 380 | background: white; 381 | } 382 | QSlider::add-page:vertical { 383 | background: white; 384 | } 385 | QSlider::sub-page:horizontal { 386 | background: #04b97f; 387 | } 388 | QSlider::sub-page:vertical { 389 | background: #04b97f; 390 | } 391 | -------------------------------------------------------------------------------- /Students/styles/qss/NeonButtons.qss: -------------------------------------------------------------------------------- 1 | /* 2 | Neon Style Sheet for QT Applications (QpushButton) 3 | Author: Jaime A. Quiroga P. 4 | Company: GTRONICK 5 | Last updated: 24/10/2020, 15:42. 6 | Available at: https://github.com/GTRONICK/QSS/blob/master/NeonButtons.qss 7 | */ 8 | QPushButton{ 9 | border-style: solid; 10 | border-color: #050a0e; 11 | border-width: 1px; 12 | border-radius: 5px; 13 | color: #d3dae3; 14 | padding: 2px; 15 | background-color: #100E19; 16 | } 17 | QPushButton::default{ 18 | border-style: solid; 19 | border-color: #050a0e; 20 | border-width: 1px; 21 | border-radius: 5px; 22 | color: #FFFFFF; 23 | padding: 2px; 24 | background-color: #151a1e; 25 | } 26 | QPushButton:hover{ 27 | border-style: solid; 28 | border-top-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 #C0DB50, stop:0.4 #C0DB50, stop:0.5 #100E19, stop:1 #100E19); 29 | border-bottom-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 #100E19, stop:0.5 #100E19, stop:0.6 #C0DB50, stop:1 #C0DB50); 30 | border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #C0DB50, stop:0.3 #C0DB50, stop:0.7 #100E19, stop:1 #100E19); 31 | border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 #C0DB50, stop:0.3 #C0DB50, stop:0.7 #100E19, stop:1 #100E19); 32 | border-width: 2px; 33 | border-radius: 1px; 34 | color: #d3dae3; 35 | padding: 2px; 36 | } 37 | QPushButton:pressed{ 38 | border-style: solid; 39 | border-top-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 #d33af1, stop:0.4 #d33af1, stop:0.5 #100E19, stop:1 #100E19); 40 | border-bottom-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 #100E19, stop:0.5 #100E19, stop:0.6 #d33af1, stop:1 #d33af1); 41 | border-left-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #d33af1, stop:0.3 #d33af1, stop:0.7 #100E19, stop:1 #100E19); 42 | border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 #d33af1, stop:0.3 #d33af1, stop:0.7 #100E19, stop:1 #100E19); 43 | border-width: 2px; 44 | border-radius: 1px; 45 | color: #d3dae3; 46 | padding: 2px; 47 | } -------------------------------------------------------------------------------- /Students/user.cpp: -------------------------------------------------------------------------------- 1 | #include "user.h" 2 | #include "ui_user.h" 3 | 4 | User::User(int flag,QString username,QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::User),flag(flag),username(username) 7 | { 8 | ui->setupUi(this); 9 | db = QSqlDatabase::database("conn"); 10 | query=new QSqlQuery(db); 11 | 12 | setWindowTitle(tr("添加用户")); 13 | 14 | ui->checkBox_read->setChecked(false); 15 | ui->checkBox_admin->setChecked(false); 16 | ui->checkBox_print->setChecked(false); 17 | ui->checkBox_write->setChecked(false); 18 | ui->checkBox_delete->setChecked(false); 19 | ui->checkBox_import->setChecked(false); 20 | ui->checkBox_search->setChecked(false); 21 | 22 | if(flag==1) 23 | { 24 | ui->lineEdit_username->setEnabled(false); 25 | 26 | if(query->exec(QString("SELECT * FROM user WHERE username = '%1'").arg(username))) 27 | { 28 | query->first(); 29 | ui->lineEdit_username->setText(query->value(0).toString()); 30 | ui->lineEdit_password->setText(query->value(1).toString()); 31 | if(query->value(2).toString()=="Yes") 32 | ui->checkBox_read->setChecked(true); 33 | if(query->value(3).toString()=="Yes") 34 | ui->checkBox_write->setChecked(true); 35 | if(query->value(4).toString()=="Yes") 36 | ui->checkBox_delete->setChecked(true); 37 | if(query->value(5).toString()=="Yes") 38 | ui->checkBox_search->setChecked(true); 39 | if(query->value(6).toString()=="Yes") 40 | ui->checkBox_print->setChecked(true); 41 | if(query->value(7).toString()=="Yes") 42 | ui->checkBox_import->setChecked(true); 43 | if(query->value(8).toString()=="Yes") 44 | ui->checkBox_admin->setChecked(true); 45 | } 46 | } 47 | 48 | connect(ui->checkBox_admin,&QCheckBox::stateChanged,this,[this](){ 49 | if(ui->checkBox_admin->isChecked()) 50 | { 51 | ui->checkBox_read->setChecked(true); 52 | ui->checkBox_write->setChecked(true); 53 | ui->checkBox_print->setChecked(true); 54 | ui->checkBox_delete->setChecked(true); 55 | ui->checkBox_import->setChecked(true); 56 | ui->checkBox_search->setChecked(true); 57 | } 58 | }); 59 | 60 | connect(ui->checkBox_read,&QCheckBox::stateChanged,this,[this](){ 61 | if(ui->checkBox_read->isChecked()) 62 | ui->checkBox_search->setChecked(true); 63 | else 64 | ui->checkBox_search->setChecked(false); 65 | }); 66 | connect(ui->checkBox_search,&QCheckBox::stateChanged,this,[this](){ 67 | if(ui->checkBox_search->isChecked()) 68 | ui->checkBox_read->setChecked(true); 69 | else 70 | ui->checkBox_read->setChecked(false); 71 | }); 72 | connect(ui->checkBox_write,&QCheckBox::stateChanged,this,[this](){ 73 | if(ui->checkBox_write->isChecked()) 74 | { 75 | ui->checkBox_read->setChecked(true); 76 | ui->checkBox_search->setChecked(true); 77 | } 78 | }); 79 | connect(ui->checkBox_delete,&QCheckBox::stateChanged,this,[this](){ 80 | if(ui->checkBox_delete->isChecked()) 81 | { 82 | ui->checkBox_read->setChecked(true); 83 | ui->checkBox_search->setChecked(true); 84 | ui->checkBox_write->setChecked(true); 85 | } 86 | }); 87 | 88 | connect(ui->pushButton_save,&QPushButton::clicked,this,&User::clickPushButton_save); 89 | connect(ui->pushButton_close,&QPushButton::clicked,this,&User::clickPushButton_close); 90 | } 91 | 92 | User::~User() 93 | { 94 | delete ui; 95 | } 96 | 97 | void User::clickPushButton_save() 98 | { 99 | QString str; 100 | QString read,write,remove,search,print,import,admin; 101 | read=write=remove=search=print=import=admin="No"; 102 | if(ui->checkBox_read->isChecked()) 103 | { 104 | read="Yes"; 105 | } 106 | if(ui->checkBox_write->isChecked()) 107 | { 108 | write="Yes"; 109 | } 110 | if(ui->checkBox_delete->isChecked()) 111 | { 112 | remove="Yes"; 113 | } 114 | if(ui->checkBox_search->isChecked()) 115 | { 116 | search="Yes"; 117 | } 118 | if(ui->checkBox_search->isChecked()) 119 | { 120 | search="Yes"; 121 | } 122 | if(ui->checkBox_import->isChecked()) 123 | { 124 | import="Yes"; 125 | } 126 | if(ui->checkBox_admin->isChecked()) 127 | { 128 | admin="Yes"; 129 | } 130 | if(flag==0) 131 | { 132 | str=QString("INSERT INTO `user`(`username`, `password`, `read`,`write`, `remove`, `search`,`print`,`import`,`admin`) VALUES " 133 | "('%1','%2','%3','%4','%5','%6','%7','%8','%9')").arg(ui->lineEdit_username->text(),ui->lineEdit_password->text(),read, 134 | write,remove,search,print,import,admin); 135 | } 136 | else 137 | { 138 | str=QString("UPDATE user set password='%1',read='%2',write='%3',remove='%4',search='%5',print='%6',import='%7',admin='%8' WHERE " 139 | "username='%9'").arg(ui->lineEdit_password->text(),read,write,remove, 140 | search,print,import,admin,ui->lineEdit_username->text()); 141 | } 142 | 143 | if(query->exec(str)) 144 | { 145 | emit needUpdataData(); 146 | delete this; 147 | } 148 | } 149 | 150 | void User::clickPushButton_close() 151 | { 152 | delete this; 153 | } 154 | -------------------------------------------------------------------------------- /Students/user.h: -------------------------------------------------------------------------------- 1 | #ifndef USER_H 2 | #define USER_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class User; 9 | } 10 | 11 | class User : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit User(int flag=0,QString username="",QWidget *parent = nullptr); 17 | ~User(); 18 | 19 | private slots: 20 | void clickPushButton_save(); 21 | void clickPushButton_close(); 22 | 23 | signals: 24 | void needUpdataData(); 25 | 26 | private: 27 | Ui::User *ui; 28 | QSqlDatabase db; 29 | QSqlQuery *query; 30 | int flag; 31 | QString username; 32 | }; 33 | 34 | #endif // USER_H 35 | -------------------------------------------------------------------------------- /Students/user.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | User 4 | 5 | 6 | 7 | 0 8 | 0 9 | 369 10 | 266 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | 19 | 20 | 25 21 | 22 | 23 | 7 24 | 25 | 26 | 17 27 | 28 | 29 | 27 30 | 31 | 32 | 33 | 34 | 用户 35 | 36 | 37 | 38 | 39 | 40 | 41 | 密码 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 权限 57 | 58 | 59 | 60 | 61 | 62 | 导入 63 | 64 | 65 | 66 | 67 | 68 | 69 | 管理员 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 删除 84 | 85 | 86 | 87 | 88 | 89 | 90 | 查找 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 打印 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | Qt::Horizontal 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | Qt::Horizontal 124 | 125 | 126 | 127 | 40 128 | 20 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 保存 137 | 138 | 139 | 140 | 141 | 142 | 143 | 关闭 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /Students/usercontrol.cpp: -------------------------------------------------------------------------------- 1 | #include "usercontrol.h" 2 | #include "ui_usercontrol.h" 3 | 4 | UserControl::UserControl(QString username,QWidget *parent) : 5 | QDialog(parent), 6 | ui(new Ui::UserControl),username(username) 7 | { 8 | ui->setupUi(this); 9 | 10 | db = QSqlDatabase::database("conn"); 11 | query=new QSqlQuery(db); 12 | 13 | setWindowTitle(tr("用户控制")); 14 | 15 | ui->pushButton_add->setEnabled(false); 16 | ui->pushButton_edit->setEnabled(false); 17 | ui->pushButton_delete->setEnabled(false); 18 | 19 | //获取权限 20 | if(query->exec(QString("SELECT * FROM user WHERE username = '%1'").arg(username))) 21 | { 22 | query->first(); 23 | read=query->value(2).toString(); 24 | write=query->value(3).toString(); 25 | remove=query->value(4).toString(); 26 | search=query->value(5).toString(); 27 | print=query->value(6).toString(); 28 | import=query->value(7).toString(); 29 | admin=query->value(8).toString(); 30 | } 31 | 32 | if(read=="Yes") 33 | { 34 | updataData_table(); 35 | ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows); //整行选中的方式 36 | } 37 | if(admin=="Yes") 38 | { 39 | ui->pushButton_add->setEnabled(true); 40 | ui->pushButton_edit->setEnabled(true); 41 | ui->pushButton_delete->setEnabled(true); 42 | connect(ui->pushButton_add,&QPushButton::clicked,this,&UserControl::clickPushButton_add); 43 | connect(ui->pushButton_edit,&QPushButton::clicked,this,&UserControl::clickPushButton_edit); 44 | connect(ui->pushButton_delete,&QPushButton::clicked,this,&UserControl::clickPushButton_delete); 45 | } 46 | } 47 | 48 | UserControl::~UserControl() 49 | { 50 | delete ui; 51 | } 52 | 53 | void UserControl::updataData_table() 54 | { 55 | ui->tableWidget->clear(); 56 | ui->tableWidget->setColumnCount(8); 57 | ui->tableWidget->setHorizontalHeaderLabels(QStringList()<<"用户"<<"读"<<"写"<<"删除"<<"查找"<<"打印"<<"导出"<<"管理员"); 58 | 59 | if(query->exec(QString("SELECT * FROM user"))) 60 | { 61 | if(query->last()!= 0) 62 | { 63 | query->last(); 64 | int num=query->at()+1; 65 | ui->tableWidget->setRowCount(num); 66 | 67 | query->first(); 68 | int count = 0; 69 | while(true) //挨个遍历数据 70 | { 71 | ui->tableWidget->setItem(count,0,new QTableWidgetItem(query->value(0).toString())); 72 | ui->tableWidget->setItem(count,1,new QTableWidgetItem(query->value(2).toString())); 73 | ui->tableWidget->setItem(count,2,new QTableWidgetItem(query->value(3).toString())); 74 | ui->tableWidget->setItem(count,3,new QTableWidgetItem(query->value(4).toString())); 75 | ui->tableWidget->setItem(count,4,new QTableWidgetItem(query->value(5).toString())); 76 | ui->tableWidget->setItem(count,5,new QTableWidgetItem(query->value(6).toString())); 77 | ui->tableWidget->setItem(count,6,new QTableWidgetItem(query->value(7).toString())); 78 | ui->tableWidget->setItem(count,7,new QTableWidgetItem(query->value(8).toString())); 79 | count++; 80 | if(!query->next()) 81 | { 82 | break; 83 | } 84 | } 85 | } 86 | else 87 | { 88 | return; 89 | } 90 | } 91 | } 92 | 93 | void UserControl::clickPushButton_add() 94 | { 95 | User *user=new User(); 96 | user->show(); 97 | user->setAttribute(Qt::WA_QuitOnClose,false); 98 | user->setAttribute(Qt::WA_DeleteOnClose); 99 | connect(user,&User::needUpdataData,this,&UserControl::updataData_table); 100 | } 101 | 102 | void UserControl::clickPushButton_edit() 103 | { 104 | QList items = ui->tableWidget->selectedItems(); 105 | QString username=items.at(0)->text(); 106 | User *user=new User(1,username); 107 | user->show(); 108 | user->setAttribute(Qt::WA_QuitOnClose,false); 109 | user->setAttribute(Qt::WA_DeleteOnClose); 110 | } 111 | 112 | void UserControl::clickPushButton_delete() 113 | { 114 | QList items = ui->tableWidget->selectedItems(); 115 | QString username=items.at(0)->text(); 116 | QMessageBox message(QMessageBox::NoIcon,"提示","确定删除此用户吗?",QMessageBox::Yes|QMessageBox::No,NULL); 117 | message.setAttribute(Qt::WA_QuitOnClose,false); 118 | if(message.exec() == QMessageBox::Yes) 119 | { 120 | if(username=="admin") 121 | QMessageBox::information(this,"错误","管理员无法删除!"); 122 | else 123 | { 124 | query->exec(QString("DELETE FROM `user` WHERE username = '%1'").arg(username)); 125 | qDebug()< 5 | #include 6 | #include 7 | #include "user.h" 8 | 9 | namespace Ui { 10 | class UserControl; 11 | } 12 | 13 | class UserControl : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit UserControl(QString username,QWidget *parent = nullptr); 19 | ~UserControl(); 20 | 21 | private slots: 22 | void updataData_table(); 23 | void clickPushButton_add(); 24 | void clickPushButton_edit(); 25 | void clickPushButton_delete(); 26 | 27 | private: 28 | Ui::UserControl *ui; 29 | QSqlDatabase db; 30 | QSqlQuery *query; 31 | QString username; 32 | QString read; 33 | QString write; 34 | QString remove; 35 | QString search; 36 | QString print; 37 | QString import; 38 | QString admin; 39 | }; 40 | 41 | #endif // USERCONTROL_H 42 | -------------------------------------------------------------------------------- /Students/usercontrol.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | UserControl 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1050 10 | 600 11 | 12 | 13 | 14 | 15 | 1050 16 | 600 17 | 18 | 19 | 20 | 21 | 1050 22 | 600 23 | 24 | 25 | 26 | Dialog 27 | 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 0 35 | 36 | 37 | 38 | 39 | 16777215 40 | 16777215 41 | 42 | 43 | 44 | QAbstractItemView::NoEditTriggers 45 | 46 | 47 | 48 | 用户 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 删除 64 | 65 | 66 | 67 | 68 | 查找 69 | 70 | 71 | 72 | 73 | 打印 74 | 75 | 76 | 77 | 78 | 导入 79 | 80 | 81 | 82 | 83 | 管理员 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 添加 94 | 95 | 96 | 97 | 98 | 99 | 100 | 编辑 101 | 102 | 103 | 104 | 105 | 106 | 107 | 删除 108 | 109 | 110 | 111 | 112 | 113 | 114 | Qt::Horizontal 115 | 116 | 117 | 118 | 40 119 | 20 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 记录 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /students.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 5.0.4 3 | -- https://www.phpmyadmin.net/ 4 | -- 5 | -- 主机: 127.0.0.1 6 | -- 生成日期: 2021-03-15 06:54:52 7 | -- 服务器版本: 10.4.17-MariaDB 8 | -- PHP 版本: 8.0.2 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | START TRANSACTION; 12 | SET time_zone = "+00:00"; 13 | 14 | 15 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 16 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 17 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 18 | /*!40101 SET NAMES utf8mb4 */; 19 | 20 | -- 21 | -- 数据库: `students` 22 | -- 23 | 24 | -- -------------------------------------------------------- 25 | 26 | -- 27 | -- 表的结构 `blood` 28 | -- 29 | 30 | CREATE TABLE `blood` ( 31 | `name` varchar(10) NOT NULL 32 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 33 | 34 | -- 35 | -- 转存表中的数据 `blood` 36 | -- 37 | 38 | INSERT INTO `blood` (`name`) VALUES 39 | ('AB型'), 40 | ('O型'); 41 | 42 | -- -------------------------------------------------------- 43 | 44 | -- 45 | -- 表的结构 `city` 46 | -- 47 | 48 | CREATE TABLE `city` ( 49 | `name` varchar(10) NOT NULL 50 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 51 | 52 | -- 53 | -- 转存表中的数据 `city` 54 | -- 55 | 56 | INSERT INTO `city` (`name`) VALUES 57 | ('宁波市'), 58 | ('昆山市'); 59 | 60 | -- -------------------------------------------------------- 61 | 62 | -- 63 | -- 表的结构 `college` 64 | -- 65 | 66 | CREATE TABLE `college` ( 67 | `name` varchar(50) NOT NULL 68 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 69 | 70 | -- 71 | -- 转存表中的数据 `college` 72 | -- 73 | 74 | INSERT INTO `college` (`name`) VALUES 75 | ('医学院'), 76 | ('经济学院'), 77 | ('数学科学学院'), 78 | ('物理学院'), 79 | ('工学院'); 80 | 81 | -- -------------------------------------------------------- 82 | 83 | -- 84 | -- 表的结构 `debt` 85 | -- 86 | 87 | CREATE TABLE `debt` ( 88 | `number` varchar(50) NOT NULL, 89 | `subject` varchar(50) NOT NULL, 90 | `grade` varchar(20) NOT NULL, 91 | `type` varchar(20) NOT NULL, 92 | `date` varchar(50) NOT NULL, 93 | `semester` varchar(20) NOT NULL, 94 | `year` varchar(20) NOT NULL, 95 | `time` varchar(50) NOT NULL 96 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 97 | 98 | -- -------------------------------------------------------- 99 | 100 | -- 101 | -- 表的结构 `eye` 102 | -- 103 | 104 | CREATE TABLE `eye` ( 105 | `name` varchar(10) NOT NULL 106 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 107 | 108 | -- 109 | -- 转存表中的数据 `eye` 110 | -- 111 | 112 | INSERT INTO `eye` (`name`) VALUES 113 | ('褐色'), 114 | ('棕色'); 115 | 116 | -- -------------------------------------------------------- 117 | 118 | -- 119 | -- 表的结构 `file` 120 | -- 121 | 122 | CREATE TABLE `file` ( 123 | `number` varchar(50) DEFAULT NULL, 124 | `file1` varchar(100) DEFAULT NULL, 125 | `file2` varchar(100) DEFAULT NULL, 126 | `file3` varchar(100) DEFAULT NULL, 127 | `file4` varchar(100) DEFAULT NULL 128 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 129 | 130 | -- -------------------------------------------------------- 131 | 132 | -- 133 | -- 表的结构 `grade` 134 | -- 135 | 136 | CREATE TABLE `grade` ( 137 | `number` varchar(20) NOT NULL, 138 | `subject` varchar(20) NOT NULL, 139 | `grade` varchar(20) NOT NULL, 140 | `date` varchar(20) DEFAULT NULL, 141 | `semester` varchar(20) NOT NULL, 142 | `year` varchar(20) NOT NULL, 143 | `time` varchar(50) NOT NULL 144 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 145 | 146 | -- 147 | -- 转存表中的数据 `grade` 148 | -- 149 | 150 | INSERT INTO `grade` (`number`, `subject`, `grade`, `date`, `semester`, `year`, `time`) VALUES 151 | ('1616466001', '大学英语2', '234', '', '1', '2019', 'Mon Mar 15 11:20:36 2021'); 152 | 153 | -- -------------------------------------------------------- 154 | 155 | -- 156 | -- 表的结构 `honor` 157 | -- 158 | 159 | CREATE TABLE `honor` ( 160 | `number` varchar(50) NOT NULL, 161 | `name` varchar(50) NOT NULL, 162 | `level` varchar(50) NOT NULL, 163 | `date` varchar(50) NOT NULL, 164 | `semester` varchar(50) NOT NULL, 165 | `year` varchar(50) NOT NULL, 166 | `time` varchar(50) NOT NULL 167 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 168 | 169 | -- -------------------------------------------------------- 170 | 171 | -- 172 | -- 表的结构 `nation` 173 | -- 174 | 175 | CREATE TABLE `nation` ( 176 | `name` varchar(10) NOT NULL 177 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 178 | 179 | -- 180 | -- 转存表中的数据 `nation` 181 | -- 182 | 183 | INSERT INTO `nation` (`name`) VALUES 184 | ('汉族'), 185 | ('维吾尔族'), 186 | ('彝族'), 187 | ('苗族'), 188 | ('蒙古族'); 189 | 190 | -- -------------------------------------------------------- 191 | 192 | -- 193 | -- 表的结构 `political` 194 | -- 195 | 196 | CREATE TABLE `political` ( 197 | `name` varchar(10) NOT NULL 198 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 199 | 200 | -- 201 | -- 转存表中的数据 `political` 202 | -- 203 | 204 | INSERT INTO `political` (`name`) VALUES 205 | ('群众'), 206 | ('团员'), 207 | ('党员'); 208 | 209 | -- -------------------------------------------------------- 210 | 211 | -- 212 | -- 表的结构 `profession` 213 | -- 214 | 215 | CREATE TABLE `profession` ( 216 | `name` varchar(50) NOT NULL 217 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 218 | 219 | -- 220 | -- 转存表中的数据 `profession` 221 | -- 222 | 223 | INSERT INTO `profession` (`name`) VALUES 224 | ('计算机科学与技术'), 225 | ('数学'); 226 | 227 | -- -------------------------------------------------------- 228 | 229 | -- 230 | -- 表的结构 `province` 231 | -- 232 | 233 | CREATE TABLE `province` ( 234 | `name` varchar(10) NOT NULL 235 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 236 | 237 | -- 238 | -- 转存表中的数据 `province` 239 | -- 240 | 241 | INSERT INTO `province` (`name`) VALUES 242 | (''), 243 | ('浙江省'), 244 | ('江苏省'), 245 | ('河北省'), 246 | ('山西省'), 247 | ('辽宁省'), 248 | ('河南省'), 249 | ('四川省'), 250 | ('湖北省'), 251 | ('安徽省'), 252 | ('海南省'); 253 | 254 | -- -------------------------------------------------------- 255 | 256 | -- 257 | -- 表的结构 `punish` 258 | -- 259 | 260 | CREATE TABLE `punish` ( 261 | `number` varchar(50) NOT NULL, 262 | `reason` varchar(50) NOT NULL, 263 | `handling` varchar(50) NOT NULL, 264 | `date` varchar(50) NOT NULL, 265 | `semester` varchar(50) NOT NULL, 266 | `year` varchar(50) NOT NULL, 267 | `result` varchar(50) NOT NULL, 268 | `time` varchar(50) NOT NULL 269 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 270 | 271 | -- -------------------------------------------------------- 272 | 273 | -- 274 | -- 表的结构 `scholarship` 275 | -- 276 | 277 | CREATE TABLE `scholarship` ( 278 | `number` varchar(50) NOT NULL, 279 | `count` varchar(20) NOT NULL, 280 | `date` varchar(20) NOT NULL, 281 | `semester` varchar(20) NOT NULL, 282 | `year` varchar(20) NOT NULL, 283 | `time` varchar(50) NOT NULL 284 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 285 | 286 | -- -------------------------------------------------------- 287 | 288 | -- 289 | -- 表的结构 `semester` 290 | -- 291 | 292 | CREATE TABLE `semester` ( 293 | `name` varchar(10) NOT NULL 294 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 295 | 296 | -- 297 | -- 转存表中的数据 `semester` 298 | -- 299 | 300 | INSERT INTO `semester` (`name`) VALUES 301 | ('1'), 302 | ('2'); 303 | 304 | -- -------------------------------------------------------- 305 | 306 | -- 307 | -- 表的结构 `skin` 308 | -- 309 | 310 | CREATE TABLE `skin` ( 311 | `name` varchar(10) NOT NULL 312 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 313 | 314 | -- 315 | -- 转存表中的数据 `skin` 316 | -- 317 | 318 | INSERT INTO `skin` (`name`) VALUES 319 | ('黄色'), 320 | ('白色'); 321 | 322 | -- -------------------------------------------------------- 323 | 324 | -- 325 | -- 表的结构 `socialstatus` 326 | -- 327 | 328 | CREATE TABLE `socialstatus` ( 329 | `name` varchar(10) NOT NULL 330 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 331 | 332 | -- 333 | -- 转存表中的数据 `socialstatus` 334 | -- 335 | 336 | INSERT INTO `socialstatus` (`name`) VALUES 337 | ('微博'), 338 | ('QQ'), 339 | ('Facebook'); 340 | 341 | -- -------------------------------------------------------- 342 | 343 | -- 344 | -- 表的结构 `status` 345 | -- 346 | 347 | CREATE TABLE `status` ( 348 | `name` varchar(10) NOT NULL 349 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 350 | 351 | -- 352 | -- 转存表中的数据 `status` 353 | -- 354 | 355 | INSERT INTO `status` (`name`) VALUES 356 | ('在校'), 357 | ('毕业'), 358 | ('隔离'); 359 | 360 | -- -------------------------------------------------------- 361 | 362 | -- 363 | -- 表的结构 `studentinfo` 364 | -- 365 | 366 | CREATE TABLE `studentinfo` ( 367 | `name` varchar(20) NOT NULL, 368 | `number` varchar(50) NOT NULL, 369 | `sex` varchar(10) NOT NULL, 370 | `nation` varchar(10) NOT NULL, 371 | `political` varchar(10) NOT NULL, 372 | `birthData` varchar(20) NOT NULL, 373 | `birthPlace` varchar(50) NOT NULL, 374 | `idCard` varchar(50) NOT NULL, 375 | `province` varchar(50) NOT NULL, 376 | `city` varchar(50) NOT NULL, 377 | `university` varchar(50) NOT NULL, 378 | `college` varchar(50) NOT NULL, 379 | `profession` varchar(50) NOT NULL, 380 | `status` varchar(10) NOT NULL, 381 | `dataOfAdmission` varchar(20) NOT NULL, 382 | `dataOfGraduation` varchar(20) NOT NULL, 383 | `homeAddress` varchar(50) NOT NULL, 384 | `phone` varchar(20) NOT NULL, 385 | `socialStatus` varchar(10) NOT NULL, 386 | `blood` varchar(10) NOT NULL, 387 | `eye` varchar(10) NOT NULL, 388 | `skin` varchar(10) NOT NULL, 389 | `fatherName` varchar(20) NOT NULL, 390 | `fatherWork` varchar(20) NOT NULL, 391 | `motherName` varchar(20) NOT NULL, 392 | `motherWork` varchar(20) NOT NULL, 393 | `parentOtherInformation` varchar(200) DEFAULT NULL, 394 | `photo` varchar(50) DEFAULT NULL, 395 | `otherInterest` varchar(200) DEFAULT NULL 396 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 397 | 398 | -- 399 | -- 转存表中的数据 `studentinfo` 400 | -- 401 | 402 | INSERT INTO `studentinfo` (`name`, `number`, `sex`, `nation`, `political`, `birthData`, `birthPlace`, `idCard`, `province`, `city`, `university`, `college`, `profession`, `status`, `dataOfAdmission`, `dataOfGraduation`, `homeAddress`, `phone`, `socialStatus`, `blood`, `eye`, `skin`, `fatherName`, `fatherWork`, `motherName`, `motherWork`, `parentOtherInformation`, `photo`, `otherInterest`) VALUES 403 | ('陈1', '1616466001', '男', '汉族', '群众', '4/12/1998', '江苏省苏州市昆山市', '320583199804122568', '浙江省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '毕业', '9/1/2016', '7/1/2020', '江苏省苏州市昆山市', '13913271901', 'QQ', 'AB型', '褐色', '黄色', '陈11', '为国家工作', '陈12', '自由职业者', '', '', '篮球'), 404 | ('陈2', '1616466002', '女', '汉族', '群众', '4/5/1997', '江苏省苏州市昆山市', '320583199704052565', '浙江省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '9/1/2016', '7/1/2020', '江苏省苏州市昆山市', '13913271902', 'QQ', 'AB型', '褐色', '黄色', '陈21', '为国家工作', '陈22', '自由职业者', '', '', '篮球'), 405 | ('陈3', '1616466003', '男', '汉族', '群众', '12/1/1997', '江苏省苏州市昆山市', '320583199804122568', '河北省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '1/9/2016', '1/7/2020', '江苏省苏州市昆山市', '13913271903', 'QQ', 'AB型', '褐色', '黄色', '陈31', '为国家工作', '陈32', '自由职业者', '', '', '篮球'), 406 | ('陈4', '1616466004', '男', '汉族', '群众', '1/1/2000', '江苏省苏州市昆山市', '320583199804122568', '安徽省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '1/9/2016', '1/7/2020', '江苏省苏州市昆山市', '13913271904', 'QQ', 'AB型', '褐色', '黄色', '陈41', '为国家工作', '陈42', '自由职业者', '', '', '篮球'), 407 | ('陈5', '1616466005', '男', '汉族', '群众', '2/7/1997', '江苏省苏州市昆山市', '320583199804122568', '江苏省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '9/1/2016', '7/1/2020', '江苏省苏州市昆山市', '13913271905', 'QQ', 'AB型', '褐色', '黄色', '陈51', '为国家工作', '陈52', '自由职业者', '', '', '篮球'), 408 | ('陈6', '1616466006', '男', '汉族', '群众', '6/6/1997', '江苏省苏州市昆山市', '320583199804122568', '安徽省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '1/9/2016', '1/7/2020', '江苏省苏州市昆山市', '13913271906', 'QQ', 'AB型', '褐色', '黄色', '陈61', '为国家工作', '陈62', '自由职业者', '', '', '篮球'), 409 | ('陈7', '1616466007', '男', '汉族', '群众', '5/5/1998', '江苏省苏州市昆山市', '320583199804122568', '湖北省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '1/9/2016', '1/7/2020', '江苏省苏州市昆山市', '13913271907', 'QQ', 'AB型', '褐色', '黄色', '陈72', '为国家工作', '陈72', '自由职业者', '', '', '篮球'), 410 | ('陈8', '1616466008', '男', '汉族', '群众', '2/9/1997', '江苏省苏州市昆山市', '320583199804122568', '浙江省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '1/9/2016', '1/7/2020', '江苏省苏州市昆山市', '13913271908', 'QQ', 'AB型', '褐色', '黄色', '陈81', '为国家工作', '陈82', '自由职业者', '', '', '篮球'), 411 | ('陈9', '1616466009', '男', '汉族', '群众', '7/7/1998', '江苏省苏州市昆山市', '320583199804122568', '江苏省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '9/1/2016', '7/1/2020', '江苏省苏州市昆山市', '13913271909', 'QQ', 'AB型', '褐色', '黄色', '陈91', '为国家工作', '陈92', '自由职业者', '', '', '篮球'), 412 | ('陈10', '1616466010', '男', '汉族', '群众', '5/2/1997', '江苏省苏州市昆山市', '320583199804122568', '江苏省', '昆山市', '苏州大学', '工学院', '计算机科学与技术', '在校', '9/1/2016', '7/1/2020', '江苏省苏州市昆山市', '13913271910', 'QQ', 'AB型', '褐色', '黄色', '陈101', '为国家工作', '陈02', '自由职业者', '', '', '篮球'); 413 | 414 | -- -------------------------------------------------------- 415 | 416 | -- 417 | -- 表的结构 `subject` 418 | -- 419 | 420 | CREATE TABLE `subject` ( 421 | `name` varchar(20) NOT NULL 422 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 423 | 424 | -- 425 | -- 转存表中的数据 `subject` 426 | -- 427 | 428 | INSERT INTO `subject` (`name`) VALUES 429 | ('大学英语1'), 430 | ('大学英语2'), 431 | ('离散数学'), 432 | ('大学英语3'), 433 | ('大学英语4'); 434 | 435 | -- -------------------------------------------------------- 436 | 437 | -- 438 | -- 表的结构 `typeofexam` 439 | -- 440 | 441 | CREATE TABLE `typeofexam` ( 442 | `name` varchar(20) NOT NULL 443 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 444 | 445 | -- 446 | -- 转存表中的数据 `typeofexam` 447 | -- 448 | 449 | INSERT INTO `typeofexam` (`name`) VALUES 450 | ('通识教育课程'), 451 | ('专业必修课程'); 452 | 453 | -- -------------------------------------------------------- 454 | 455 | -- 456 | -- 表的结构 `university` 457 | -- 458 | 459 | CREATE TABLE `university` ( 460 | `name` varchar(50) NOT NULL 461 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 462 | 463 | -- 464 | -- 转存表中的数据 `university` 465 | -- 466 | 467 | INSERT INTO `university` (`name`) VALUES 468 | ('苏州大学应用技术学院'), 469 | ('苏州大学'), 470 | ('苏州科技大学'), 471 | ('苏州大学文正学院'); 472 | 473 | -- -------------------------------------------------------- 474 | 475 | -- 476 | -- 表的结构 `user` 477 | -- 478 | 479 | CREATE TABLE `user` ( 480 | `username` varchar(100) NOT NULL, 481 | `password` varchar(100) NOT NULL, 482 | `read` varchar(10) NOT NULL, 483 | `write` varchar(10) NOT NULL, 484 | `remove` varchar(10) NOT NULL, 485 | `search` varchar(10) NOT NULL, 486 | `print` varchar(10) NOT NULL, 487 | `import` varchar(10) NOT NULL, 488 | `admin` varchar(10) NOT NULL 489 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 490 | 491 | -- 492 | -- 转存表中的数据 `user` 493 | -- 494 | 495 | INSERT INTO `user` (`username`, `password`, `read`, `write`, `remove`, `search`, `print`, `import`, `admin`) VALUES 496 | ('admin', '123456', 'Yes', 'Yes', 'Yes', 'Yes', 'Yes', 'Yes', 'Yes'); 497 | 498 | -- -------------------------------------------------------- 499 | 500 | -- 501 | -- 表的结构 `year` 502 | -- 503 | 504 | CREATE TABLE `year` ( 505 | `name` varchar(10) NOT NULL 506 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 507 | 508 | -- 509 | -- 转存表中的数据 `year` 510 | -- 511 | 512 | INSERT INTO `year` (`name`) VALUES 513 | ('2019'), 514 | ('2018'), 515 | ('2017'), 516 | ('2020'); 517 | COMMIT; 518 | 519 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 520 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 521 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 522 | -------------------------------------------------------------------------------- /导入导出格式参考.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TmSakura/C-Qt-StudentManagementSystem-Multi-Users/c0265e1ea2c675d461b03447e9af4ebfe4874723/导入导出格式参考.xls --------------------------------------------------------------------------------