├── myapp.rc ├── demo ├── editor.png ├── login.png ├── testDoc.html ├── testDoc.pdf ├── testDoc2.pdf ├── qtexteditor.png ├── Qt-TextEditor.png ├── login-module.png ├── Qt-TextEditor-Server.png ├── testDoc.tex ├── testDoc2.htm └── testDoc3.html ├── resources ├── cn.qm ├── en.qm ├── images │ ├── ico │ │ ├── close.png │ │ ├── mini.png │ │ ├── user0.png │ │ ├── user1.png │ │ ├── user2.png │ │ ├── user3.png │ │ ├── user4.png │ │ ├── user5.png │ │ ├── setting.png │ │ ├── editor-cut.png │ │ ├── editor-hr.png │ │ ├── login_tray.png │ │ ├── n-delete.png │ │ ├── n-refresh.png │ │ ├── n-upload.png │ │ ├── order-list.png │ │ ├── split-page.png │ │ ├── strike-out.png │ │ ├── bullet-list.png │ │ ├── editor-bold.png │ │ ├── editor-copy .png │ │ ├── editor-image.png │ │ ├── editor-link.png │ │ ├── editor-paste.png │ │ ├── editor-redo.png │ │ ├── editor-undo.png │ │ ├── Qt-TextEditor.ico │ │ ├── editor-italic.png │ │ ├── split-paragraph.png │ │ ├── editor-add-indent.png │ │ ├── editor-align-left.png │ │ ├── editor-underline.png │ │ ├── editor-align-center.png │ │ ├── editor-align-right.png │ │ ├── editor-list-bulleted.png │ │ ├── editor-list-numbers.png │ │ ├── editor-reduce-indent.png │ │ └── editor-strikethrough.png │ ├── keyBoard.png │ ├── top_img0.png │ ├── top_img1.png │ ├── top_img2.png │ ├── top_img3.png │ ├── top_img4.png │ ├── top_img5.png │ ├── background.png │ └── qss │ │ ├── Black │ │ ├── left.png │ │ ├── nscc.png │ │ ├── open.png │ │ ├── scan.png │ │ ├── skin.png │ │ ├── close.png │ │ ├── delete.png │ │ ├── error.png │ │ ├── right.png │ │ ├── arrowLeft.png │ │ ├── arrowTop.png │ │ ├── checkBox.png │ │ ├── feedback.png │ │ ├── maximize.png │ │ ├── minimize.png │ │ ├── openHover.png │ │ ├── question.png │ │ ├── restore.png │ │ ├── skinHover.png │ │ ├── success.png │ │ ├── topArrow.png │ │ ├── transfer.png │ │ ├── upButton.png │ │ ├── warning.png │ │ ├── arrowBottom.png │ │ ├── arrowRight.png │ │ ├── bottomArrow.png │ │ ├── closeHover.png │ │ ├── deleteHover.png │ │ ├── downButton.png │ │ ├── information.png │ │ ├── openPressed.png │ │ ├── progressBar.png │ │ ├── radioButton.png │ │ ├── skinPressed.png │ │ ├── checkBoxHover.png │ │ ├── closePressed.png │ │ ├── deletePressed.png │ │ ├── feedbackHover.png │ │ ├── maximizeHover.png │ │ ├── minimizeHover.png │ │ ├── restoreHover.png │ │ ├── restorePressed.png │ │ ├── topArrowHover.png │ │ ├── bottomArrowHover.png │ │ ├── checkBoxChecked.png │ │ ├── checkBoxPressed.png │ │ ├── feedbackPressed.png │ │ ├── maximizePressed.png │ │ ├── minimizePressed.png │ │ ├── progressBarChunk.png │ │ ├── radioButtonHover.png │ │ ├── radioButtonChecked.png │ │ ├── radioButtonPressed.png │ │ ├── checkBoxCheckedHover.png │ │ ├── checkBoxIndeterminate.png │ │ ├── checkBoxCheckedPressed.png │ │ ├── radioButtonCheckedHover.png │ │ ├── checkBoxIndeterminateHover.png │ │ ├── radioButtonCheckedPressed.png │ │ └── checkBoxIndeterminatePressed.png │ │ ├── White │ │ ├── left.png │ │ ├── nscc.png │ │ ├── open.png │ │ ├── scan.png │ │ ├── skin.png │ │ ├── close.png │ │ ├── delete.png │ │ ├── error.png │ │ ├── right.png │ │ ├── arrowLeft.png │ │ ├── arrowTop.png │ │ ├── checkBox.png │ │ ├── feedback.png │ │ ├── maximize.png │ │ ├── minimize.png │ │ ├── openHover.png │ │ ├── question.png │ │ ├── restore.png │ │ ├── skinHover.png │ │ ├── success.png │ │ ├── topArrow.png │ │ ├── transfer.png │ │ ├── upButton.png │ │ ├── warning.png │ │ ├── arrowBottom.png │ │ ├── arrowRight.png │ │ ├── bottomArrow.png │ │ ├── closeHover.png │ │ ├── deleteHover.png │ │ ├── downButton.png │ │ ├── information.png │ │ ├── openPressed.png │ │ ├── progressBar.png │ │ ├── radioButton.png │ │ ├── skinPressed.png │ │ ├── checkBoxHover.png │ │ ├── closePressed.png │ │ ├── deletePressed.png │ │ ├── feedbackHover.png │ │ ├── maximizeHover.png │ │ ├── minimizeHover.png │ │ ├── restoreHover.png │ │ ├── restorePressed.png │ │ ├── topArrowHover.png │ │ ├── bottomArrowHover.png │ │ ├── checkBoxChecked.png │ │ ├── checkBoxPressed.png │ │ ├── feedbackPressed.png │ │ ├── maximizePressed.png │ │ ├── minimizePressed.png │ │ ├── progressBarChunk.png │ │ ├── radioButtonHover.png │ │ ├── radioButtonChecked.png │ │ ├── radioButtonPressed.png │ │ ├── checkBoxCheckedHover.png │ │ ├── checkBoxIndeterminate.png │ │ ├── checkBoxCheckedPressed.png │ │ ├── radioButtonCheckedHover.png │ │ ├── checkBoxIndeterminateHover.png │ │ ├── radioButtonCheckedPressed.png │ │ └── checkBoxIndeterminatePressed.png │ │ └── white.qss ├── lang.qrc ├── myqrc.qrc ├── qss.qrc ├── cn.ts └── en.ts ├── Qt-TextEditor.ico ├── .gitignore ├── plugins └── htmltolatex.jar ├── .gitmodules ├── src ├── mtextedit.h ├── register.h ├── main.cpp ├── systemtrayicon.h ├── register.cpp ├── AccountManager.h ├── login.h ├── mtextedit.cpp ├── editor.h ├── systemtrayicon.cpp ├── register.ui ├── login.ui ├── AccountManager.cpp └── login.cpp ├── QtLaTeX.pro └── README.md /myapp.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "Qt-TextEditor.ico" -------------------------------------------------------------------------------- /demo/editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/editor.png -------------------------------------------------------------------------------- /demo/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/login.png -------------------------------------------------------------------------------- /resources/cn.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/cn.qm -------------------------------------------------------------------------------- /resources/en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/en.qm -------------------------------------------------------------------------------- /Qt-TextEditor.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/Qt-TextEditor.ico -------------------------------------------------------------------------------- /demo/testDoc.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/testDoc.html -------------------------------------------------------------------------------- /demo/testDoc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/testDoc.pdf -------------------------------------------------------------------------------- /demo/testDoc2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/testDoc2.pdf -------------------------------------------------------------------------------- /demo/qtexteditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/qtexteditor.png -------------------------------------------------------------------------------- /demo/Qt-TextEditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/Qt-TextEditor.png -------------------------------------------------------------------------------- /demo/login-module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/login-module.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | cmake-build-debug 3 | cmake-build-release 4 | QtLaTeX.pro.user 5 | CMakeLists.txt -------------------------------------------------------------------------------- /plugins/htmltolatex.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/plugins/htmltolatex.jar -------------------------------------------------------------------------------- /demo/Qt-TextEditor-Server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/demo/Qt-TextEditor-Server.png -------------------------------------------------------------------------------- /resources/images/ico/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/close.png -------------------------------------------------------------------------------- /resources/images/ico/mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/mini.png -------------------------------------------------------------------------------- /resources/images/ico/user0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/user0.png -------------------------------------------------------------------------------- /resources/images/ico/user1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/user1.png -------------------------------------------------------------------------------- /resources/images/ico/user2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/user2.png -------------------------------------------------------------------------------- /resources/images/ico/user3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/user3.png -------------------------------------------------------------------------------- /resources/images/ico/user4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/user4.png -------------------------------------------------------------------------------- /resources/images/ico/user5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/user5.png -------------------------------------------------------------------------------- /resources/images/keyBoard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/keyBoard.png -------------------------------------------------------------------------------- /resources/images/top_img0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/top_img0.png -------------------------------------------------------------------------------- /resources/images/top_img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/top_img1.png -------------------------------------------------------------------------------- /resources/images/top_img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/top_img2.png -------------------------------------------------------------------------------- /resources/images/top_img3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/top_img3.png -------------------------------------------------------------------------------- /resources/images/top_img4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/top_img4.png -------------------------------------------------------------------------------- /resources/images/top_img5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/top_img5.png -------------------------------------------------------------------------------- /resources/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/background.png -------------------------------------------------------------------------------- /resources/images/ico/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/setting.png -------------------------------------------------------------------------------- /resources/images/ico/editor-cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-cut.png -------------------------------------------------------------------------------- /resources/images/ico/editor-hr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-hr.png -------------------------------------------------------------------------------- /resources/images/ico/login_tray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/login_tray.png -------------------------------------------------------------------------------- /resources/images/ico/n-delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/n-delete.png -------------------------------------------------------------------------------- /resources/images/ico/n-refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/n-refresh.png -------------------------------------------------------------------------------- /resources/images/ico/n-upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/n-upload.png -------------------------------------------------------------------------------- /resources/images/ico/order-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/order-list.png -------------------------------------------------------------------------------- /resources/images/ico/split-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/split-page.png -------------------------------------------------------------------------------- /resources/images/ico/strike-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/strike-out.png -------------------------------------------------------------------------------- /resources/images/qss/Black/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/left.png -------------------------------------------------------------------------------- /resources/images/qss/Black/nscc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/nscc.png -------------------------------------------------------------------------------- /resources/images/qss/Black/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/open.png -------------------------------------------------------------------------------- /resources/images/qss/Black/scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/scan.png -------------------------------------------------------------------------------- /resources/images/qss/Black/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/skin.png -------------------------------------------------------------------------------- /resources/images/qss/White/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/left.png -------------------------------------------------------------------------------- /resources/images/qss/White/nscc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/nscc.png -------------------------------------------------------------------------------- /resources/images/qss/White/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/open.png -------------------------------------------------------------------------------- /resources/images/qss/White/scan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/scan.png -------------------------------------------------------------------------------- /resources/images/qss/White/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/skin.png -------------------------------------------------------------------------------- /resources/images/ico/bullet-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/bullet-list.png -------------------------------------------------------------------------------- /resources/images/ico/editor-bold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-bold.png -------------------------------------------------------------------------------- /resources/images/ico/editor-copy .png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-copy .png -------------------------------------------------------------------------------- /resources/images/ico/editor-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-image.png -------------------------------------------------------------------------------- /resources/images/ico/editor-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-link.png -------------------------------------------------------------------------------- /resources/images/ico/editor-paste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-paste.png -------------------------------------------------------------------------------- /resources/images/ico/editor-redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-redo.png -------------------------------------------------------------------------------- /resources/images/ico/editor-undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-undo.png -------------------------------------------------------------------------------- /resources/images/qss/Black/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/close.png -------------------------------------------------------------------------------- /resources/images/qss/Black/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/delete.png -------------------------------------------------------------------------------- /resources/images/qss/Black/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/error.png -------------------------------------------------------------------------------- /resources/images/qss/Black/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/right.png -------------------------------------------------------------------------------- /resources/images/qss/White/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/close.png -------------------------------------------------------------------------------- /resources/images/qss/White/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/delete.png -------------------------------------------------------------------------------- /resources/images/qss/White/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/error.png -------------------------------------------------------------------------------- /resources/images/qss/White/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/right.png -------------------------------------------------------------------------------- /resources/images/ico/Qt-TextEditor.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/Qt-TextEditor.ico -------------------------------------------------------------------------------- /resources/images/ico/editor-italic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-italic.png -------------------------------------------------------------------------------- /resources/images/ico/split-paragraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/split-paragraph.png -------------------------------------------------------------------------------- /resources/images/qss/Black/arrowLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/arrowLeft.png -------------------------------------------------------------------------------- /resources/images/qss/Black/arrowTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/arrowTop.png -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBox.png -------------------------------------------------------------------------------- /resources/images/qss/Black/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/feedback.png -------------------------------------------------------------------------------- /resources/images/qss/Black/maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/maximize.png -------------------------------------------------------------------------------- /resources/images/qss/Black/minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/minimize.png -------------------------------------------------------------------------------- /resources/images/qss/Black/openHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/openHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/question.png -------------------------------------------------------------------------------- /resources/images/qss/Black/restore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/restore.png -------------------------------------------------------------------------------- /resources/images/qss/Black/skinHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/skinHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/success.png -------------------------------------------------------------------------------- /resources/images/qss/Black/topArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/topArrow.png -------------------------------------------------------------------------------- /resources/images/qss/Black/transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/transfer.png -------------------------------------------------------------------------------- /resources/images/qss/Black/upButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/upButton.png -------------------------------------------------------------------------------- /resources/images/qss/Black/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/warning.png -------------------------------------------------------------------------------- /resources/images/qss/White/arrowLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/arrowLeft.png -------------------------------------------------------------------------------- /resources/images/qss/White/arrowTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/arrowTop.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBox.png -------------------------------------------------------------------------------- /resources/images/qss/White/feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/feedback.png -------------------------------------------------------------------------------- /resources/images/qss/White/maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/maximize.png -------------------------------------------------------------------------------- /resources/images/qss/White/minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/minimize.png -------------------------------------------------------------------------------- /resources/images/qss/White/openHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/openHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/question.png -------------------------------------------------------------------------------- /resources/images/qss/White/restore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/restore.png -------------------------------------------------------------------------------- /resources/images/qss/White/skinHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/skinHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/success.png -------------------------------------------------------------------------------- /resources/images/qss/White/topArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/topArrow.png -------------------------------------------------------------------------------- /resources/images/qss/White/transfer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/transfer.png -------------------------------------------------------------------------------- /resources/images/qss/White/upButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/upButton.png -------------------------------------------------------------------------------- /resources/images/qss/White/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/warning.png -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "qtexteditor-server"] 2 | path = qtexteditor-server 3 | url = https://github.com/PTYin/qtexteditor-server 4 | -------------------------------------------------------------------------------- /resources/images/ico/editor-add-indent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-add-indent.png -------------------------------------------------------------------------------- /resources/images/ico/editor-align-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-align-left.png -------------------------------------------------------------------------------- /resources/images/ico/editor-underline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-underline.png -------------------------------------------------------------------------------- /resources/images/qss/Black/arrowBottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/arrowBottom.png -------------------------------------------------------------------------------- /resources/images/qss/Black/arrowRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/arrowRight.png -------------------------------------------------------------------------------- /resources/images/qss/Black/bottomArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/bottomArrow.png -------------------------------------------------------------------------------- /resources/images/qss/Black/closeHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/closeHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/deleteHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/deleteHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/downButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/downButton.png -------------------------------------------------------------------------------- /resources/images/qss/Black/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/information.png -------------------------------------------------------------------------------- /resources/images/qss/Black/openPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/openPressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/progressBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/progressBar.png -------------------------------------------------------------------------------- /resources/images/qss/Black/radioButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/radioButton.png -------------------------------------------------------------------------------- /resources/images/qss/Black/skinPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/skinPressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/arrowBottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/arrowBottom.png -------------------------------------------------------------------------------- /resources/images/qss/White/arrowRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/arrowRight.png -------------------------------------------------------------------------------- /resources/images/qss/White/bottomArrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/bottomArrow.png -------------------------------------------------------------------------------- /resources/images/qss/White/closeHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/closeHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/deleteHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/deleteHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/downButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/downButton.png -------------------------------------------------------------------------------- /resources/images/qss/White/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/information.png -------------------------------------------------------------------------------- /resources/images/qss/White/openPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/openPressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/progressBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/progressBar.png -------------------------------------------------------------------------------- /resources/images/qss/White/radioButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/radioButton.png -------------------------------------------------------------------------------- /resources/images/qss/White/skinPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/skinPressed.png -------------------------------------------------------------------------------- /resources/images/ico/editor-align-center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-align-center.png -------------------------------------------------------------------------------- /resources/images/ico/editor-align-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-align-right.png -------------------------------------------------------------------------------- /resources/images/ico/editor-list-bulleted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-list-bulleted.png -------------------------------------------------------------------------------- /resources/images/ico/editor-list-numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-list-numbers.png -------------------------------------------------------------------------------- /resources/images/ico/editor-reduce-indent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-reduce-indent.png -------------------------------------------------------------------------------- /resources/images/ico/editor-strikethrough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/ico/editor-strikethrough.png -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBoxHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBoxHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/closePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/closePressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/deletePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/deletePressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/feedbackHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/feedbackHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/maximizeHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/maximizeHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/minimizeHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/minimizeHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/restoreHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/restoreHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/restorePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/restorePressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/topArrowHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/topArrowHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBoxHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBoxHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/closePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/closePressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/deletePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/deletePressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/feedbackHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/feedbackHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/maximizeHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/maximizeHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/minimizeHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/minimizeHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/restoreHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/restoreHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/restorePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/restorePressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/topArrowHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/topArrowHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/bottomArrowHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/bottomArrowHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBoxChecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBoxChecked.png -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBoxPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBoxPressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/feedbackPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/feedbackPressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/maximizePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/maximizePressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/minimizePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/minimizePressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/progressBarChunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/progressBarChunk.png -------------------------------------------------------------------------------- /resources/images/qss/Black/radioButtonHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/radioButtonHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/bottomArrowHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/bottomArrowHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBoxChecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBoxChecked.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBoxPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBoxPressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/feedbackPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/feedbackPressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/maximizePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/maximizePressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/minimizePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/minimizePressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/progressBarChunk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/progressBarChunk.png -------------------------------------------------------------------------------- /resources/images/qss/White/radioButtonHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/radioButtonHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/radioButtonChecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/radioButtonChecked.png -------------------------------------------------------------------------------- /resources/images/qss/Black/radioButtonPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/radioButtonPressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/radioButtonChecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/radioButtonChecked.png -------------------------------------------------------------------------------- /resources/images/qss/White/radioButtonPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/radioButtonPressed.png -------------------------------------------------------------------------------- /resources/lang.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | cn.qm 4 | en.qm 5 | 6 | 7 | -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBoxCheckedHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBoxCheckedHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBoxIndeterminate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBoxIndeterminate.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBoxCheckedHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBoxCheckedHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBoxIndeterminate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBoxIndeterminate.png -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBoxCheckedPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBoxCheckedPressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/radioButtonCheckedHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/radioButtonCheckedHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBoxCheckedPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBoxCheckedPressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/radioButtonCheckedHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/radioButtonCheckedHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBoxIndeterminateHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBoxIndeterminateHover.png -------------------------------------------------------------------------------- /resources/images/qss/Black/radioButtonCheckedPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/radioButtonCheckedPressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBoxIndeterminateHover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBoxIndeterminateHover.png -------------------------------------------------------------------------------- /resources/images/qss/White/radioButtonCheckedPressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/radioButtonCheckedPressed.png -------------------------------------------------------------------------------- /resources/images/qss/Black/checkBoxIndeterminatePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/Black/checkBoxIndeterminatePressed.png -------------------------------------------------------------------------------- /resources/images/qss/White/checkBoxIndeterminatePressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptyin/qtexteditor/HEAD/resources/images/qss/White/checkBoxIndeterminatePressed.png -------------------------------------------------------------------------------- /demo/testDoc.tex: -------------------------------------------------------------------------------- 1 | \documentclass[a4paper,11pt]{article} 2 | \usepackage{ulem} 3 | \usepackage{a4wide} 4 | \usepackage[dvipsnames,svgnames]{xcolor} 5 | \usepackage[pdftex]{graphicx} 6 | 7 | \usepackage{hyperref} 8 | % commands generated by html2latex 9 | 10 | 11 | \begin{document} 12 | 13 | Thisis atest! 14 | 15 | Hello World! 16 | 17 | 18 | \\ 19 | \begin{enumerate} 20 | \item whatever 21 | \item whoever 22 | \item whichever 23 | \item wherever 24 | \end{enumerate} 25 | 26 | \end{document} 27 | -------------------------------------------------------------------------------- /src/mtextedit.h: -------------------------------------------------------------------------------- 1 | #ifndef _MTEXTEDIT_H_ 2 | #define _MTEXTEDIT_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class MTextEdit : public QTextEdit 9 | { 10 | Q_OBJECT 11 | public: 12 | MTextEdit(QWidget *parent); 13 | 14 | void dropImage(const QImage &image, const QString &format); 15 | 16 | void dropImage(const QString &name); 17 | 18 | signals: 19 | void tab(); 20 | 21 | protected: 22 | bool canInsertFromMimeData(const QMimeData *source) const; 23 | 24 | void insertFromMimeData(const QMimeData *source); 25 | 26 | QMimeData *createMimeDataFromSelection() const; 27 | 28 | void keyPressEvent(QKeyEvent *e) override; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/register.h: -------------------------------------------------------------------------------- 1 | #ifndef REGISTER_H 2 | #define REGISTER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "login.h" 10 | 11 | namespace Ui 12 | { 13 | class Register; 14 | } 15 | 16 | class Register : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit Register(AccountManager *manager_, QWidget *parent); 22 | 23 | ~Register(); 24 | 25 | QSqlDatabase database;//database为注册的数据库名称 26 | bool tableFlag; 27 | int sql_max_id; 28 | 29 | private slots: 30 | 31 | void on_registerCheckButton_clicked(); 32 | // void receivedb(QSqlDatabase db); 33 | 34 | private: 35 | Ui::Register *ui; 36 | AccountManager *manager; 37 | 38 | }; 39 | 40 | #endif // REGISTER_H 41 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "login.h" 4 | 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | 11 | // QTextCodec::setCodecForLocale(QTextCodec::codecForLocale()); 12 | 13 | // Login::setStyle("black.qss"); 14 | Login w(nullptr); 15 | // w.setStyle("white.qss"); 16 | // w.setGeometry() 17 | w.move((QApplication::desktop()->width() - w.width()) / 2, (QApplication::desktop()->height() - w.height()) / 2); 18 | w.show(); 19 | 20 | //加载qss start 21 | // QFile file(":/images/qss/white.qss"); //black white QSS 文件路径 22 | // file.open(QIODevice::ReadOnly | QIODevice::Text); 23 | // QString qss(file.readAll()); 24 | // a.setStyleSheet(qss); 25 | //加载qss end 26 | return a.exec(); 27 | } 28 | -------------------------------------------------------------------------------- /QtLaTeX.pro: -------------------------------------------------------------------------------- 1 | Release:DEFINES += QT_NO_WARNING_OUTPUT\ 2 | QT_NO_DEBUG_OUTPUT 3 | 4 | QT += core gui sql network printsupport 5 | QT += widgets 6 | 7 | TARGET = QtTextEditor 8 | TEMPLATE = app 9 | 10 | RC_FILE = myapp.rc 11 | 12 | 13 | SOURCES += src/main.cpp\ 14 | src/login.cpp \ 15 | src/register.cpp \ 16 | src/systemtrayicon.cpp \ 17 | src/editor.cpp \ 18 | src/mtextedit.cpp \ 19 | src/AccountManager.cpp 20 | 21 | HEADERS += src/login.h \ 22 | src/register.h \ 23 | src/systemtrayicon.h \ 24 | src/editor.h \ 25 | src/mtextedit.h \ 26 | src/AccountManager.h 27 | 28 | FORMS += src/login.ui \ 29 | src/register.ui \ 30 | src/editor.ui 31 | 32 | RESOURCES += \ 33 | resources/myqrc.qrc \ 34 | resources/lang.qrc \ 35 | resources/qss.qrc 36 | 37 | TRANSLATIONS+=cn.ts\ 38 | en.ts 39 | -------------------------------------------------------------------------------- /src/systemtrayicon.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSTEMTRAYICON_H 2 | #define SYSTEMTRAYICON_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class SystemTrayIcon : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | //explicit SystemTrayIcon(QWidget *parent = 0); 16 | explicit SystemTrayIcon(QStringList strList, QIcon icon, QWidget *parent = 0); 17 | 18 | void create_sysTrayMenu(); //创建托盘菜单 19 | void create_sysTrayIcon(); //创建托盘菜单的图标 20 | void create_sysTrayMenuAct(); //创建点击托盘菜单项的act行为 21 | void create_sysTrayMenuLangeSettingAct(); //创建点击托盘菜单项的act行为 22 | 23 | 24 | signals: 25 | 26 | void signal_lang_refresh(); 27 | 28 | public slots: 29 | 30 | void slot_sys_tray_iconActivated(QSystemTrayIcon::ActivationReason reason);//系统托盘触发槽函数 31 | void set_lang(QAction *act); 32 | 33 | 34 | public: 35 | QAction *actFixed; //固定位置 36 | QActionGroup *acrLangGrp; 37 | 38 | void refresh(); 39 | 40 | private: 41 | 42 | QWidget *pWidget; //父对象 43 | 44 | QSystemTrayIcon *mSysTrayIcon; //系统托盘 45 | QMenu *mSysTrayMenu; //系统托盘显示菜单 46 | QMenu *mSysTrayMenuLangSetting; //系统托盘语言设置 47 | QAction *act_sys_tray_min; //最小化 48 | QAction *act_sys_tray_normal; //正常 49 | QAction *act_sys_tray_exit; //退出 50 | QAction *act_sys_tray_lang_ch; //china 51 | QAction *act_sys_tray_lang_en; //english 52 | QStringList m_strList; //托盘信息 53 | QIcon m_icon; //托盘图标 54 | QTranslator translator; 55 | 56 | 57 | }; 58 | 59 | #endif // SYSTEMTRAYICON_H 60 | -------------------------------------------------------------------------------- /src/register.cpp: -------------------------------------------------------------------------------- 1 | #include "register.h" 2 | #include "ui_register.h" 3 | #include 4 | 5 | Register::Register(AccountManager* manager_, QWidget *parent= nullptr) : 6 | QDialog(parent), 7 | ui(new Ui::Register) 8 | { 9 | ui->setupUi(this); 10 | 11 | ui->lineEditPassword->setEchoMode(QLineEdit::Password); 12 | ui->lineEditPasswordCheck->setEchoMode(QLineEdit::Password); 13 | ui->lineEditServer->setText("www.peter-sia.top:2333"); 14 | setWindowTitle(tr("register")); 15 | manager = manager_; 16 | 17 | //connect((Login *)parent,SIGNAL(transmitdb(QSqlDatabase)),this,SLOT(receivedb(QSqlDatabase))); 18 | 19 | } 20 | 21 | Register::~Register() 22 | { 23 | delete ui; 24 | } 25 | 26 | //注册函数.仅仅获取相关值,不做检测和数据库操作 27 | void Register::on_registerCheckButton_clicked() 28 | { 29 | QString userName = ui->lineEditName->text(); 30 | QString passwd = ui->lineEditPassword->text(); 31 | QString email = ui->lineEditEmail->text(); 32 | QString server = ui->lineEditServer->text(); 33 | // bool existFlag = false; //判断用户是否存在 34 | 35 | // QSqlDatabase db = pWidget->getDb(); 36 | // if(!db.isOpen()) 37 | // db.open(); 38 | // QSqlQuery query(db); 39 | // query.prepare("insert into userInfo values (user ,passwd, email, false)"); 40 | // query.bindValue(":user", ui->lineEditName->text()); 41 | // query.bindValue(":passwd", ui->lineEditPassword->text()); 42 | // query.bindValue(":email", ui->lineEditEmail->text()); 43 | if (userName.isEmpty() || passwd.isEmpty() || 44 | server.isEmpty()) 45 | { 46 | QMessageBox::warning(this, tr("note"), tr("Username, Password And Server Are Needed!")); 47 | } else if (ui->lineEditPassword->text() != ui->lineEditPasswordCheck->text()) 48 | { 49 | QMessageBox::warning(this, "error", "passwords you type are not the same!"); 50 | } else 51 | { 52 | manager->setUsername(userName); 53 | manager->setPassword(passwd); 54 | manager->setServer(server); 55 | manager->registerUser(email); 56 | this->close(); 57 | } 58 | } -------------------------------------------------------------------------------- /src/AccountManager.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | 5 | #include 6 | 7 | // 8 | // Created by peter on 19-5-27. 9 | // 10 | 11 | #ifndef QTLATEX_ACCOUNTACCESS_H 12 | #define QTLATEX_ACCOUNTACCESS_H 13 | 14 | 15 | #include 16 | #include 17 | 18 | class AccountManager: public QObject 19 | { 20 | Q_OBJECT 21 | public: 22 | explicit AccountManager(QWidget *parent= nullptr); 23 | AccountManager &operator=(const AccountManager &access){return *(new AccountManager(access));} 24 | AccountManager(const AccountManager &access):QObject(access.parent()),manager(access.parent()){username=access.username;password=access.password;server=access.server;token=access.token;} 25 | AccountManager(const QString &username_, const QString &password_, QObject *parent= nullptr):manager(parent){username=username_;password=password_;} 26 | ~AccountManager() override; 27 | void setUsername(const QString &username_){username=username_;} 28 | void setPassword(const QString &password_){password=password_;} 29 | void setServer(const QString &server_){server=server_;} 30 | void registerUser(const QString &email); 31 | void login(); 32 | void uploadFile(QString filename, QString content); 33 | // void updateFile(QString filename, QString content); 34 | void getContent(QString filename); 35 | void getFiles(); 36 | void deleteFile(QString filename); 37 | 38 | const QString &getUsername() const; 39 | 40 | const QString &getServer() const; 41 | 42 | static QString urlEncode(QString string); 43 | 44 | signals: 45 | void login_success(); 46 | void return_content(QString content); 47 | void return_files_list(QList *fileList); 48 | 49 | private slots: 50 | void on_register_finished(); 51 | void on_login_finished(); 52 | void on_uploadFile_finished(); 53 | // void on_updateFile_finished(); 54 | void on_getContent_finished(); 55 | void on_getFiles_finished(); 56 | void on_deleteFile_finished(); 57 | 58 | private: 59 | QNetworkAccessManager manager; 60 | QString token; 61 | QString username; 62 | QString password; 63 | QString server; 64 | 65 | }; 66 | 67 | 68 | #endif //QTLATEX_ACCOUNTACCESS_H 69 | -------------------------------------------------------------------------------- /resources/myqrc.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/keyBoard.png 4 | images/ico/setting.png 5 | images/top_img1.png 6 | images/top_img2.png 7 | images/top_img3.png 8 | images/top_img4.png 9 | images/top_img5.png 10 | images/ico/close.png 11 | images/ico/mini.png 12 | images/ico/user1.png 13 | images/ico/user2.png 14 | images/ico/user3.png 15 | images/ico/user4.png 16 | images/ico/user5.png 17 | images/background.png 18 | images/ico/user0.png 19 | images/top_img0.png 20 | images/ico/login_tray.png 21 | images/ico/strike-out.png 22 | images/ico/bullet-list.png 23 | images/ico/order-list.png 24 | images/ico/split-page.png 25 | images/ico/split-paragraph.png 26 | images/ico/editor-align-center.png 27 | images/ico/editor-align-left.png 28 | images/ico/editor-align-right.png 29 | images/ico/editor-bold.png 30 | images/ico/editor-hr.png 31 | images/ico/editor-image.png 32 | images/ico/editor-italic.png 33 | images/ico/editor-link.png 34 | images/ico/editor-list-numbers.png 35 | images/ico/editor-strikethrough.png 36 | images/ico/editor-underline.png 37 | images/ico/editor-redo.png 38 | images/ico/editor-undo.png 39 | images/ico/editor-list-bulleted.png 40 | images/ico/editor-copy .png 41 | images/ico/editor-cut.png 42 | images/ico/editor-paste.png 43 | images/ico/editor-add-indent.png 44 | images/ico/editor-reduce-indent.png 45 | images/ico/n-delete.png 46 | images/ico/n-refresh.png 47 | images/ico/n-upload.png 48 | images/ico/Qt-TextEditor.ico 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/login.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGIN_H 2 | #define LOGIN_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include "AccountManager.h" 14 | #include "editor.h" 15 | 16 | 17 | namespace Ui 18 | { 19 | class Login; 20 | } 21 | 22 | class Login : public QWidget 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | explicit Login(QWidget *parent); 28 | 29 | Login(QWidget *parent, AccountManager *manager_ptr, Editor *editor); 30 | 31 | ~Login(); 32 | 33 | void init(); 34 | 35 | void get_user_info(); 36 | 37 | void configWindow(); 38 | 39 | void init_sql(); 40 | 41 | void set_top_img(bool isSandom, int index_img);//isSandom is true,set img show by sandom 42 | void set_button();//设置UI上的按钮 43 | void set_user_img(bool isSandom, int index_img);//设置UI上用户头像 44 | 45 | void create_menuLanguage(); //设置语言菜单 46 | 47 | void setStyle(const QString &style);//设置style 48 | 49 | void showAgain(); 50 | 51 | protected: 52 | void mousePressEvent(QMouseEvent *e); 53 | 54 | void mouseMoveEvent(QMouseEvent *e); 55 | 56 | void mouseReleaseEvent(QMouseEvent *e); 57 | 58 | signals: 59 | 60 | void close(); 61 | 62 | private slots: 63 | 64 | void login_success(); 65 | 66 | void login_success_without_entering(); 67 | 68 | void on_btn_annonymous_clicked(); 69 | 70 | void on_btn_login_clicked(); 71 | 72 | void on_btn_regist_clicked(); 73 | 74 | void slot_minWindow(); 75 | 76 | void slot_closeWindow(); 77 | 78 | void slot_setLanguage(); //设置语言 79 | 80 | void slot_actGrp(QAction *act); 81 | 82 | void slot_timer1(); 83 | 84 | void slot_timer2(); 85 | 86 | void on_cBox_account_activated(int index); 87 | 88 | // void on_btn_edit_pwd_clicked(); 89 | 90 | void on_cBox_account_currentIndexChanged(int index); 91 | 92 | void refresh();//刷新login界面字符串 93 | 94 | private: 95 | Ui::Login *ui; 96 | 97 | struct UserInfoStu 98 | { 99 | QString userName; 100 | QString passwd; 101 | QString email; 102 | QString server; 103 | }; 104 | bool m_Drag; 105 | QPoint m_point; 106 | QTimer *timer1, *timer2; 107 | QStringList userPasswd; //用户密码 108 | 109 | QToolButton *minBtn; 110 | QToolButton *closeBbtn; 111 | QToolButton *setBtn; 112 | QToolButton *status_tBtn; //在线状态 113 | 114 | QMenu *menu1; //语言菜单 115 | QAction *act_chinese; 116 | QAction *act_english; 117 | 118 | QMenu *menu2; //在线状态 119 | QAction *act0; //在线 120 | QAction *act1; //隐身 121 | QAction *act2; //离线 122 | QAction *act3; //忙碌 123 | QActionGroup *actGrp; 124 | QList is_remembered; 125 | 126 | AccountManager *manager; 127 | Editor *parentEditor; 128 | public: 129 | UserInfoStu user_info_stu; 130 | QSqlDatabase db; 131 | }; 132 | 133 | #endif // LOGIN_H 134 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | --- 4 | 5 | 一个qt制作的在线富文本编辑器,可用于在线多人协作编辑文本,支持导出html,pdf,latex格式。 6 | A Qt rich text editor, used for online or offline edit text. Support for exporting to .html, .pdf, .tex. 7 | 8 | ![](demo/editor.png) 9 | 10 | ## Function 11 | 12 | ![](demo/Qt-TextEditor.png) 13 | 14 | - Function 15 | - User Administration 16 | - Login 17 | - Register 18 | - Rich Text Function 19 | - format 20 | - font style 21 | - insert link 22 | - insert image 23 | - other common-use operation 24 | - File Fuction 25 | - save as html 26 | - export to latex 27 | - export to pdf 28 | - upload file to remote server 29 | - get file from remote server 30 | - delete file stored in remote server 31 | 32 | ## Login Module 33 | 34 | ![](demo/login.png) 35 | ![](demo/login-module.png) 36 | 37 | ## Usage 38 | 39 | - First Sign Up for An Account(press register button and then ) 40 | - Check Your Email to Activate Your Account 41 | - Sign in with a server address(default server:www.peter-sia.top:2333) 42 | 43 | ## For Developer 44 | 45 | - Use Qt embeded SQLite to store username and password which you have typed before 46 | - Use Qt Network to communicate with remote server 47 | - You can deploy your own server to your local enviroment or production environment, deploy your server according to [Server Project](https://github.com/PTYin/Qt-TextEdit-Server) 48 | 49 | ### Support Cmake Project instead of QMake Project 50 | 51 | CMakeLists.txt should be like that 52 | 53 | cmake_minimum_required(VERSION 3.13) 54 | project(QtLaTeX) 55 | 56 | set(CMAKE_CXX_STANDARD 14) 57 | 58 | set(CMAKE_PREFIX_PATH E:/Qt/Qt5.12.3/5.12.3/mingw73_64) 59 | # Find includes in corresponding build directories 60 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 61 | # Instruct CMake to run moc automatically when needed 62 | set(CMAKE_AUTOMOC ON) 63 | # Create code from a list of Qt designer ui files 64 | set(CMAKE_AUTOUIC ON) 65 | 66 | # Find the QtWidgets library 67 | find_package(Qt5 COMPONENTS Core Widgets Gui Sql Network PrintSupport REQUIRED) 68 | 69 | # Populate a CMake variable with the sources 70 | set(SOURCELIST 71 | src/login.ui 72 | src/login.cpp 73 | src/login.h 74 | src/main.cpp 75 | src/passwdedit.ui 76 | src/passwdedit.cpp 77 | src/passwdedit.h 78 | src/register.ui 79 | src/register.cpp 80 | src/register.h 81 | src/systemtrayicon.cpp 82 | src/systemtrayicon.h 83 | src/mtextedit.cpp 84 | src/mtextedit.h 85 | src/AccountManager.cpp 86 | src/AccountManager.h 87 | src/editor.cpp 88 | src/editor.h) 89 | qt5_add_resources(SOURCELIST resources/lang.qrc resources/myqrc.qrc resources/qss.qrc) 90 | message("${PROJECT_BINARY_DIR}") 91 | file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/plugins) 92 | file(COPY plugins/htmltolatex.jar DESTINATION ${PROJECT_BINARY_DIR}/plugins/) 93 | file(COPY plugins/config.xml DESTINATION ${PROJECT_BINARY_DIR}/) 94 | # Tell CMake to create the QTLaTeX executable 95 | add_executable(QtTextEditor ${SOURCELIST} myapp.rc) 96 | #add_executable(test test/main.cpp test/A.cpp test/A.h) 97 | #file(MAKE_DIRECTORY ) 98 | # Use the Widgets module from Qt 5 99 | target_link_libraries(QtTextEditor Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Sql Qt5::Network Qt5::PrintSupport) 100 | 101 | 102 | 103 | - You can also use qmake, but remember to copy the directory plugins to your build directory and copy the config.xml in plugins to your build root 104 | -------------------------------------------------------------------------------- /src/mtextedit.cpp: -------------------------------------------------------------------------------- 1 | #include "mtextedit.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | 12 | MTextEdit::MTextEdit(QWidget *parent) : QTextEdit(parent) 13 | { 14 | } 15 | 16 | 17 | bool MTextEdit::canInsertFromMimeData(const QMimeData *source) const 18 | { 19 | return source->hasImage() || QTextEdit::canInsertFromMimeData(source); 20 | } 21 | 22 | 23 | void MTextEdit::insertFromMimeData(const QMimeData *source) 24 | { 25 | if (source->hasImage()) 26 | { 27 | QStringList formats = source->formats(); 28 | QString format; 29 | for (int i = 0; i < formats.size(); i++) 30 | { 31 | if (formats[i] == "image/bmp") 32 | { 33 | format = "BMP"; 34 | break; 35 | } 36 | if (formats[i] == "image/jpeg") 37 | { 38 | format = "JPG"; 39 | break; 40 | } 41 | if (formats[i] == "image/jpg") 42 | { 43 | format = "JPG"; 44 | break; 45 | } 46 | if (formats[i] == "image/gif") 47 | { 48 | format = "GIF"; 49 | break; 50 | } 51 | if (formats[i] == "image/png") 52 | { 53 | format = "PNG"; 54 | break; 55 | } 56 | if (formats[i] == "image/pbm") 57 | { 58 | format = "PBM"; 59 | break; 60 | } 61 | if (formats[i] == "image/pgm") 62 | { 63 | format = "PGM"; 64 | break; 65 | } 66 | if (formats[i] == "image/ppm") 67 | { 68 | format = "PPM"; 69 | break; 70 | } 71 | if (formats[i] == "image/tiff") 72 | { 73 | format = "TIFF"; 74 | break; 75 | } 76 | if (formats[i] == "image/xbm") 77 | { 78 | format = "XBM"; 79 | break; 80 | } 81 | if (formats[i] == "image/xpm") 82 | { 83 | format = "XPM"; 84 | break; 85 | } 86 | } 87 | if (!format.isEmpty()) 88 | { 89 | // dropImage(qvariant_cast(source->imageData()), format); 90 | dropImage(qvariant_cast(source->imageData()), "JPG"); // Sorry, ale cokoli jiného dlouho trvá 91 | return; 92 | } 93 | } 94 | QTextEdit::insertFromMimeData(source); 95 | } 96 | 97 | 98 | QMimeData *MTextEdit::createMimeDataFromSelection() const 99 | { 100 | return QTextEdit::createMimeDataFromSelection(); 101 | } 102 | 103 | 104 | void MTextEdit::dropImage(const QImage &image, const QString &format) 105 | { 106 | QByteArray bytes; 107 | QBuffer buffer(&bytes); 108 | buffer.open(QIODevice::WriteOnly); 109 | image.save(&buffer, format.toLocal8Bit().data()); 110 | buffer.close(); 111 | QByteArray base64 = bytes.toBase64(); 112 | QByteArray base64l; 113 | for (int i = 0; i < base64.size(); i++) 114 | { 115 | base64l.append(base64[i]); 116 | if (i % 80 == 0) 117 | { 118 | base64l.append("\n"); 119 | } 120 | } 121 | 122 | QTextCursor cursor = textCursor(); 123 | QTextImageFormat imageFormat; 124 | imageFormat.setWidth(image.width()); 125 | imageFormat.setHeight(image.height()); 126 | imageFormat.setName(QString("data:image/%1;base64,%2") 127 | .arg(QString("%1.%2").arg(rand()).arg(format)) 128 | .arg(base64l.data()) 129 | ); 130 | cursor.insertImage(imageFormat); 131 | } 132 | 133 | void MTextEdit::dropImage(const QString &name) 134 | { 135 | QTextCursor cursor = textCursor(); 136 | cursor.insertImage(name); 137 | } 138 | 139 | void MTextEdit::keyPressEvent(QKeyEvent *e) 140 | { 141 | // if(e->key()==Qt::Key_Tab) 142 | // emit tab(); 143 | // else 144 | QTextEdit::keyPressEvent(e); 145 | } 146 | 147 | -------------------------------------------------------------------------------- /demo/testDoc2.htm: -------------------------------------------------------------------------------- 1 | 2 | 5 |

6 |

为了落实《国家中长期教育改革和发展规划纲要(2010-2020)》,为人才强国战略的实施和创新型国家的建设提供强有力的人才支撑,教育部于2009年启动“基础学科拔尖学生培养试验计划”目的是培养一大批拔尖创新人才,使之成为相关基础学科领域的领军人物,并逐步跻身国际一流科学家队伍。

7 |


8 |

作为入选该计划的17所高水平研究型大学之一山东大学决定成立“山东大学泰山学堂”,全面负责山东大学“基础学科拔尖学生培养试验计划”的实施。

9 |


10 |

   泰山学堂将依托 数学、物理学、化学、生物学、计算机科学 等5个学科良好的学科基础,并综合利用国内外优质教育资源,借鉴世界一流大学的经验,汲取齐鲁文化精华,重点在培养模式、教学方法、学生遴选、制度创新等方面进行大胆的探索和实践。通过多元、多种、多次和专家选才的方式,选拔具有培养潜质的优秀学生,为其配备一流师资,创造一流学习条件,营造一流学术氛围,形成具有山大特色的人才培养模式和机制,培养基础扎实、学风朴实,有德性、富有创新精神和创新能力的未来拔尖创新人才

11 |


12 |

   学校将按照8年“本博贯通”模式对泰山学堂的学生进行长周期培养和精英教育。采用“通专结合、文理交融,学研并重、强化创新,多种经历、三个相跨”的培养模式,为其制定个性化的培养方案,实行弹性化管理,实施住宿学院制、游学制和导师制相结合的学习和管理模式,进一步改革教学方法,创新教学模式,实行小班授课,加强研究性和研讨式教学,不断优化课程体系,选用国际一流教材,使计划学生在本科期间人人拥在世界一流大学进行学习和研究的经历。为有志于从事基础学科研究,有志于成为世界一流科学家的有志学子提供肥沃的土壤,广阔的空间、良好的机遇,为学生的早日成才打下坚实基础,为世界科学的发展和创新型国家的建设做出贡献。  

-------------------------------------------------------------------------------- /demo/testDoc3.html: -------------------------------------------------------------------------------- 1 | 2 | 5 |

Dear Professor:

6 |


7 |

As a teacher in Department of Physics, Shandong University, I am very pleased to take this opportunity to recommend one of my favorite students, Ms Chen, to the Visiting International Student program of Duke university.

8 |


9 |

Ms Chen requested a letter of reference from me to support her application for Visiting International Student program of Duke university. As her tutor in the second academic year in Shandong University, I taught her Classical Mechanics and became acquainted with her, so I am willing to comply with her request.

10 |


11 |

Ms Chen left a deep impression on me by sitting in the front row in my class at first, but later on, I found that she could not only follow my pace and logic, but often voiced her independent thinkings which were reasonable and innovative at most time. Since then, we have discussed various questions occasionally, including some classical theoretical physics problems in my class, certain classical chaos problems, as well as her scientific training project, Quantum Walk, etc. I was impressed by her unique views about these difficulties which reflected her deep thinkings and integrated logic. What’s more, Ms Chen possesses excellent self-learning capacity, which enables her to get hang of many skills such as numerical simulation and programming. Because of that, she would adjust to a brand new environment quickly.

12 |


13 |

At the end of last semester, Ms Chen got the highest score (96/100) in my class, and right now she keeps on learning Quantum Walk in our group.

14 |


15 |

I am glad to recommend this excellent girl who already possessed good quality and strong ability. I therefore lend her my enthusiastic support and would appreciate you favorable consideration of her application.

16 |


17 |

Sincerely yours,

18 |

Huan Yang

19 |


-------------------------------------------------------------------------------- /src/editor.h: -------------------------------------------------------------------------------- 1 | #ifndef EDITOR_H 2 | #define EDITOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "ui_editor.h" 15 | #include "AccountManager.h" 16 | 17 | namespace Ui 18 | { 19 | class Editor; 20 | } 21 | 22 | class Editor : public QMainWindow 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | explicit Editor(AccountManager manager_, QWidget *parent = nullptr, bool anonymous_ = false); 28 | 29 | virtual ~Editor(); 30 | 31 | QString toPlainText() const 32 | { return ui->textEdit->toPlainText(); } 33 | 34 | QString toHtml() const; 35 | 36 | QTextDocument *document() 37 | { return ui->textEdit->document(); } 38 | 39 | QTextCursor textCursor() const 40 | { return ui->textEdit->textCursor(); } 41 | 42 | void setTextCursor(const QTextCursor &cursor) 43 | { ui->textEdit->setTextCursor(cursor); } 44 | 45 | void setUser(QString username) 46 | { 47 | l_username->setText(username); 48 | }; 49 | 50 | void setServer(QString address) 51 | { 52 | l_server->setText(address); 53 | }; 54 | 55 | void setAnonymous(bool anonymous) 56 | { 57 | Editor::anonymous = anonymous; 58 | } 59 | 60 | QTimer *getFileListTimer() const 61 | { 62 | return fileListTimer; 63 | } 64 | 65 | void updateFileListTimer() 66 | { 67 | shotsCount=0; 68 | if(!anonymous) 69 | fileListTimer->start(1000); 70 | } 71 | 72 | public slots: 73 | 74 | void setText(const QString &text); 75 | 76 | protected slots: 77 | 78 | void setPlainText(const QString &text) 79 | { ui->textEdit->setPlainText(text); } 80 | 81 | void setHtml(const QString &text) 82 | { ui->textEdit->setHtml(text); } 83 | 84 | void textRemoveFormat(); 85 | 86 | void textRemoveAllFormat(); 87 | 88 | void textBold(); 89 | 90 | void textUnderline(); 91 | 92 | void textStrikeout(); 93 | 94 | void textItalic(); 95 | 96 | void textSize(const QString &p); 97 | 98 | void textLink(bool checked); 99 | 100 | void textStyle(int index); 101 | 102 | void textFgColor(); 103 | 104 | void textBgColor(); 105 | 106 | void listBullet(bool checked); 107 | 108 | void listOrdered(bool checked); 109 | 110 | void slotCurrentCharFormatChanged(const QTextCharFormat &format); 111 | 112 | void slotCursorPositionChanged(); 113 | 114 | void slotClipboardDataChanged(); 115 | 116 | void increaseIndentation(); 117 | 118 | void decreaseIndentation(); 119 | 120 | void insertImage(); 121 | 122 | void textSource(); 123 | 124 | void justifyCenter(); 125 | 126 | void justifyLeft(); 127 | 128 | void justifyRight(); 129 | 130 | void splitPage() 131 | { 132 | // ui->textEdit->textCursor().insertHtml("
"); 133 | ui->textEdit->textCursor().insertHtml("


"); 134 | } 135 | 136 | void splitPragraph(){ui->textEdit->insertHtml("

");} 137 | 138 | protected: 139 | void mergeFormatOnWordOrSelection(const QTextCharFormat &format); 140 | 141 | void fontChanged(const QFont &f); 142 | 143 | void fgColorChanged(const QColor &c); 144 | 145 | void bgColorChanged(const QColor &c); 146 | 147 | void list(bool checked, QTextListFormat::Style style); 148 | 149 | void indent(int delta); 150 | 151 | void focusInEvent(QFocusEvent *event); 152 | 153 | QStringList m_paragraphItems; 154 | int m_fontsize_h1; 155 | int m_fontsize_h2; 156 | int m_fontsize_h3; 157 | int m_fontsize_h4; 158 | 159 | enum ParagraphItems 160 | { 161 | ParagraphStandard = 0, 162 | ParagraphSansSerif, 163 | ParagraphSystem, 164 | ParagraphHelvetica, 165 | ParagraphCourier, 166 | ParagraphMonospace 167 | }; 168 | 169 | QPointer m_lastBlockList; 170 | private slots: 171 | 172 | void on_actionnew_triggered(); 173 | 174 | void on_actionopen_triggered(); 175 | 176 | void on_actionopen_folder_triggered(); 177 | 178 | void on_actionsave_triggered(); 179 | 180 | void on_actionlatex_triggered(); 181 | 182 | void on_actionpdf_triggered(); 183 | 184 | void on_actionlogin_triggered(); 185 | 186 | void on_actionregister_triggered(); 187 | 188 | void on_actionlogout_triggered(); 189 | 190 | void on_n_refresh_clicked(); 191 | 192 | void on_n_delete_clicked(); 193 | 194 | void on_n_upload_clicked(); 195 | 196 | void local_filesystem_view_doubleclicked(const QModelIndex &modelIndex); 197 | 198 | void remote_file_view_doubleclicked(const QModelIndex &modelIndex); 199 | 200 | void showRemoteFiles(QList *stringList); 201 | 202 | void showFile(QString content){ui->textEdit->setHtml(content);std::cout< remoteFileList; 210 | QString recentFileName; 211 | QLabel *l_username; 212 | QLabel *l_server; 213 | QTimer *fileListTimer; 214 | bool anonymous; 215 | int shotsCount; 216 | 217 | void showLocalFileSystem(); 218 | 219 | 220 | }; 221 | 222 | #endif // EDITOR_H 223 | -------------------------------------------------------------------------------- /src/systemtrayicon.cpp: -------------------------------------------------------------------------------- 1 | #include "systemtrayicon.h" 2 | 3 | #include 4 | #include 5 | 6 | //SystemTrayIcon::SystemTrayIcon(QWidget *parent) : QWidget(parent) 7 | SystemTrayIcon::SystemTrayIcon(QStringList strList, QIcon icon, QWidget *parent) : QWidget(parent) 8 | { 9 | pWidget = parent; 10 | m_strList = strList; 11 | m_icon = icon; 12 | 13 | create_sysTrayMenuAct();//1.创建点击托盘菜单项的act行为 14 | create_sysTrayMenu();//2.创建托盘菜单 15 | create_sysTrayIcon();//3.创建托盘,init 16 | //注意初始化顺序:1.init托盘菜单包含的项 2.init托盘菜单 3.init托盘Button 17 | } 18 | 19 | //创建点击托盘菜单项的act行为 20 | void SystemTrayIcon::create_sysTrayMenuAct() 21 | { 22 | // actFixed = new QAction("锁定位置(&F)",this); 23 | // actFixed->setCheckable(true); 24 | // actFixed->setChecked(true); 25 | 26 | act_sys_tray_min = new QAction(tr("最小化(&M)"), this); 27 | connect(act_sys_tray_min, SIGNAL(triggered()), pWidget, SLOT(hide())); 28 | 29 | act_sys_tray_normal = new QAction(tr("还 原(&R)"), this); 30 | connect(act_sys_tray_normal, SIGNAL(triggered()), pWidget, SLOT(showNormal())); 31 | 32 | act_sys_tray_exit = new QAction(tr("退出(&Q)"), this); 33 | connect(act_sys_tray_exit, SIGNAL(triggered()), qApp, SLOT(quit())); 34 | 35 | act_sys_tray_lang_ch = new QAction(tr("简体中文(&C)"), this); 36 | // connect(act_sys_tray_lang_ch,SIGNAL(triggered()),this,SLOT(set_lang())); 37 | 38 | act_sys_tray_lang_en = new QAction(tr("英语(&E)"), this); 39 | acrLangGrp = new QActionGroup(this); 40 | acrLangGrp->addAction(act_sys_tray_lang_ch); 41 | acrLangGrp->addAction(act_sys_tray_lang_en); 42 | connect(acrLangGrp, SIGNAL(triggered(QAction * )), this, SLOT(set_lang(QAction * ))); 43 | 44 | 45 | } 46 | 47 | 48 | //创建托盘菜单 49 | void SystemTrayIcon::create_sysTrayMenu() 50 | { 51 | mSysTrayMenu = new QMenu(this); 52 | //mSysTrayMenu = new QMenu((QWidget*)QApplication::desktop()); 53 | 54 | mSysTrayMenuLangSetting = new QMenu(tr("语言设置"), this); 55 | // QList act_list; 56 | // act_list << act_sys_tray_lang_ch << act_sys_tray_lang_en; 57 | // mSysTrayMenuLangSetting->addActions(act_list); 58 | 59 | mSysTrayMenuLangSetting->addAction(act_sys_tray_lang_ch); 60 | mSysTrayMenuLangSetting->addAction(act_sys_tray_lang_en); 61 | 62 | mSysTrayMenu->addMenu(mSysTrayMenuLangSetting); 63 | 64 | //新增菜单项---显示主界面 65 | mSysTrayMenu->addAction(act_sys_tray_normal); 66 | //新增菜单项---最小化 67 | mSysTrayMenu->addAction(act_sys_tray_min); 68 | 69 | //增加分隔符 70 | mSysTrayMenu->addSeparator(); 71 | 72 | //新增菜单项---退出程序 73 | mSysTrayMenu->addAction(act_sys_tray_exit); 74 | 75 | 76 | 77 | // mSysTrayMenuLangSetting 78 | 79 | //把QMenu,系统托盘菜单赋给QSystemTrayIcon对象 80 | // mSysTrayIcon->setContextMenu(mSysTrayMenu); //new之后才能使用mSysTrayIcon 81 | } 82 | 83 | 84 | //创建系统托盘按钮 85 | void SystemTrayIcon::create_sysTrayIcon() 86 | { 87 | if (!QSystemTrayIcon::isSystemTrayAvailable()) //判断系统是否支持系统托盘图标 88 | { 89 | return; 90 | } 91 | 92 | mSysTrayIcon = new QSystemTrayIcon(pWidget); 93 | mSysTrayIcon->setIcon(m_icon); //设置图标图片 94 | mSysTrayIcon->setToolTip(m_strList.at(1)); //托盘时,鼠标放上去的提示信息 95 | mSysTrayIcon->showMessage(m_strList.at(0), m_strList.at(1), QSystemTrayIcon::Information, 10000); 96 | 97 | // mSysTrayIcon = new QSystemTrayIcon(this);//新建QSystemTrayIcon对象 98 | // mSysTrayIcon->setIcon(QIcon(":/images/ico/mini.png")); //设置托盘的icon 99 | // mSysTrayIcon->setStyleSheet("background-color:transparent;"); 100 | // mSysTrayIcon->setToolTip(QObject::tr("login_demo"));//当鼠标移动到托盘上的图标时,会显示此处设置的内容 101 | 102 | mSysTrayIcon->setContextMenu(mSysTrayMenu);//设置托盘上下文菜单 103 | 104 | mSysTrayIcon->show();//在系统托盘显示此对象 105 | 106 | //给QSystemTrayIcon对象mSysTrayIcon添加信号为activated(QSystemTrayIcon::ActivationReason)的槽函数 107 | connect(mSysTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), 108 | this, SLOT(slot_sys_tray_iconActivated(QSystemTrayIcon::ActivationReason))); 109 | 110 | } 111 | 112 | 113 | 114 | 115 | 116 | //系统托盘触发槽函数 117 | /********************* 118 | enum QSystemTrayIcon::ActivationReason 表述托盘上图标的触发缘由 119 | 常量 值 描述 120 | QSystemTrayIcon::Unknown 0 未知原因 121 | QSystemTrayIcon::Context 1 请求系统托盘的上下文菜单 122 | QSystemTrayIcon::DoubleClick 2 鼠标双击 123 | QSystemTrayIcon::Trigger 3 鼠标单击 124 | QSystemTrayIcon::MiddleClick 4 鼠标中间按键 125 | **********************/ 126 | void SystemTrayIcon::slot_sys_tray_iconActivated(QSystemTrayIcon::ActivationReason reason) 127 | { 128 | switch (reason) 129 | { 130 | case QSystemTrayIcon::Unknown: //未知原因 131 | break; 132 | case QSystemTrayIcon::Context: //请求系统托盘的上下文菜单 133 | break; 134 | case QSystemTrayIcon::DoubleClick: //鼠标双击 135 | pWidget->setWindowState(Qt::WindowActive); 136 | pWidget->show(); 137 | break; 138 | case QSystemTrayIcon::Trigger: //鼠标单击 139 | 140 | break; 141 | case QSystemTrayIcon::MiddleClick: //鼠标中间按键 142 | break; 143 | default: 144 | break; 145 | } 146 | 147 | } 148 | 149 | void SystemTrayIcon::set_lang(QAction *act) 150 | { 151 | qDebug() << act->text(); 152 | if (act == act_sys_tray_lang_ch) 153 | { 154 | qDebug() << "china "; 155 | translator.load(":/cn.qm"); 156 | qApp->installTranslator(&translator); 157 | 158 | } 159 | if (act == act_sys_tray_lang_en) 160 | { 161 | qDebug() << "english "; 162 | translator.load(":/en.qm"); 163 | qApp->installTranslator(&translator); 164 | } 165 | this->refresh();//刷新托盘相关文字 166 | emit signal_lang_refresh();//发送刷新页面文字的信号 167 | } 168 | 169 | 170 | void SystemTrayIcon::refresh() 171 | { 172 | this->act_sys_tray_exit->setText(tr("退出(&Q)")); 173 | this->act_sys_tray_min->setText(tr("最小化(&M)")); 174 | this->act_sys_tray_lang_ch->setText(tr("简体中文(&C)")); 175 | this->act_sys_tray_lang_en->setText(tr("英语(&E)")); 176 | this->act_sys_tray_normal->setText(tr("还 原(&R)")); 177 | this->mSysTrayMenuLangSetting->setWindowTitle(tr("语言设置")); 178 | qDebug() << "lllllllllllll" << this->mSysTrayMenuLangSetting->windowTitle(); 179 | 180 | } 181 | -------------------------------------------------------------------------------- /src/register.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Register 4 | 5 | 6 | 7 | 0 8 | 0 9 | 244 10 | 314 11 | 12 | 13 | 14 | Dialog 15 | 16 | 17 | 18 | /* === Shared === */ 19 | QLabel, QPushButton, QDialog 20 | { 21 | background-color: #222222; 22 | color: #BBBBBB; 23 | font-family: "Segoe UI"; 24 | } 25 | 26 | /* === QWidget === */ 27 | QWidget:window { 28 | background: #222222; 29 | color: #BBBBBB; 30 | font-family: "Segoe UI"; 31 | } 32 | 33 | /* === QToolTip === */ 34 | QToolTip { 35 | background-color: #000000; 36 | border: 2px solid #333333; 37 | color: yellow; 38 | } 39 | 40 | /* === QPushButton === */ 41 | QPushButton { 42 | border: 1px solid #333333; 43 | padding: 4px; 44 | min-width: 65px; 45 | min-height: 12px; 46 | } 47 | 48 | QPushButton:hover { 49 | background-color: #333333; 50 | border-color: #444444; 51 | } 52 | 53 | QPushButton:pressed { 54 | background-color: #111111; 55 | border-color: #333333; 56 | color: yellow; 57 | } 58 | 59 | QPushButton:disabled { 60 | color: #333333; 61 | } 62 | 63 | /* =================== */ 64 | QLineEdit{ 65 | background-color: black; 66 | color: #BBBBBB; 67 | border: 1px solid #333333; 68 | } 69 | /* Nice Windows-XP-style password character. */ 70 | QLineEdit[echoMode="2"] { 71 | lineedit-password-character: 9679; 72 | } 73 | 74 | /* We provide a min-width and min-height for push buttons 75 | so that they look elegant regardless of the width of the text. */ 76 | QPushButton { 77 | background-color: palegoldenrod; 78 | border-width: 2px; 79 | border-color: darkkhaki; 80 | border-style: solid; 81 | border-radius: 5px; 82 | padding: 3px; 83 | min-width: 9ex; 84 | min-height: 2.5ex; 85 | } 86 | 87 | QPushButton:hover { 88 | background-color: khaki; 89 | } 90 | 91 | /* Increase the padding, so the text is shifted when the button is 92 | pressed. */ 93 | QPushButton:pressed { 94 | padding-left: 5px; 95 | padding-top: 5px; 96 | background-color: #d0d67c; 97 | } 98 | 99 | QLabel, QAbstractButton { 100 | font: bold; 101 | } 102 | 103 | QLineEdit, QFrame { 104 | border-width: 1px; 105 | padding: 1px; 106 | border-style: solid; 107 | border-color: darkkhaki; 108 | border-radius: 5px; 109 | } 110 | 111 | /* As mentioned above, eliminate the padding and increase the border. */ 112 | QLineEdit:focus, QFrame:focus { 113 | border-width: 3px; 114 | padding: 0px; 115 | } 116 | 117 | /* A QLabel is a QFrame */ 118 | QLabel { 119 | border: none; 120 | padding: 0; 121 | background: none; 122 | } 123 | 124 | 125 | 126 | 127 | 128 | 129 | 30 130 | 40 131 | 72 132 | 20 133 | 134 | 135 | 136 | username 137 | 138 | 139 | 140 | 141 | 142 | 30 143 | 80 144 | 72 145 | 20 146 | 147 | 148 | 149 | password 150 | 151 | 152 | 153 | 154 | 155 | 30 156 | 120 157 | 72 158 | 20 159 | 160 | 161 | 162 | confirm 163 | 164 | 165 | 166 | 167 | 168 | 30 169 | 160 170 | 72 171 | 20 172 | 173 | 174 | 175 | email 176 | 177 | 178 | 179 | 180 | 181 | 120 182 | 40 183 | 91 184 | 20 185 | 186 | 187 | 188 | 189 | 190 | 191 | 120 192 | 80 193 | 91 194 | 20 195 | 196 | 197 | 198 | 199 | 200 | 201 | 120 202 | 120 203 | 91 204 | 20 205 | 206 | 207 | 208 | 209 | 210 | 211 | 120 212 | 160 213 | 91 214 | 20 215 | 216 | 217 | 218 | 219 | 220 | 221 | 80 222 | 250 223 | 75 224 | 31 225 | 226 | 227 | 228 | register 229 | 230 | 231 | 232 | 233 | 234 | 30 235 | 200 236 | 72 237 | 20 238 | 239 | 240 | 241 | server 242 | 243 | 244 | 245 | 246 | 247 | 120 248 | 200 249 | 91 250 | 20 251 | 252 | 253 | 254 | 255 | 256 | lineEditName 257 | lineEditPassword 258 | lineEditPasswordCheck 259 | lineEditEmail 260 | lineEditServer 261 | registerCheckButton 262 | 263 | 264 | 265 | 266 | -------------------------------------------------------------------------------- /src/login.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Login 4 | 5 | 6 | 7 | 0 8 | 0 9 | 427 10 | 330 11 | 12 | 13 | 14 | 15 | 427 16 | 330 17 | 18 | 19 | 20 | 21 | 427 22 | 330 23 | 24 | 25 | 26 | Login 27 | 28 | 29 | true 30 | 31 | 32 | 33 | 34 | 330 35 | 200 36 | 91 37 | 23 38 | 39 | 40 | 41 | 42 | 9 43 | 44 | 45 | 46 | color: rgb(11, 163, 219); 47 | 48 | 49 | Register 50 | 51 | 52 | true 53 | 54 | 55 | 56 | 57 | 58 | 130 59 | 227 60 | 193 61 | 26 62 | 63 | 64 | 65 | 66 | 170 67 | 22 68 | 69 | 70 | 71 | 72 | 12 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 130 83 | 196 84 | 193 85 | 29 86 | 87 | 88 | 89 | 90 | 12 91 | 92 | 93 | 94 | true 95 | 96 | 97 | 98 | 99 | 100 | 0 101 | 0 102 | 427 103 | 185 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 30 114 | 195 115 | 80 116 | 80 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 170 127 | 290 128 | 100 129 | 26 130 | 131 | 132 | 133 | login 134 | 135 | 136 | Return 137 | 138 | 139 | 140 | 141 | 142 | 259 143 | 261 144 | 16 145 | 16 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 278 156 | 261 157 | 81 158 | 16 159 | 160 | 161 | 162 | Auto Login 163 | 164 | 165 | 166 | 167 | 168 | 133 169 | 261 170 | 16 171 | 16 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 152 182 | 261 183 | 91 184 | 16 185 | 186 | 187 | 188 | Remember Me 189 | 190 | 191 | 192 | 193 | 194 | 20 195 | 290 196 | 121 197 | 29 198 | 199 | 200 | 201 | 202 | 12 203 | 204 | 205 | 206 | true 207 | 208 | 209 | 210 | 211 | 212 | 40 213 | 270 214 | 62 215 | 20 216 | 217 | 218 | 219 | color: rgb(46, 52, 54); 220 | 221 | 222 | Server 223 | 224 | 225 | Qt::AutoText 226 | 227 | 228 | Qt::AlignCenter 229 | 230 | 231 | 232 | 233 | 234 | 310 235 | 290 236 | 100 237 | 26 238 | 239 | 240 | 241 | anonymous 242 | 243 | 244 | 245 | 246 | 247 | cBox_server 248 | cBox_account 249 | lineEdit_passwd 250 | checkBox_rPasswd 251 | btn_login 252 | btn_annonymous 253 | checkBox_autoLogin 254 | btn_regist 255 | 256 | 257 | 258 | 259 | -------------------------------------------------------------------------------- /resources/qss.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/qss/black.qss 4 | images/qss/Black/arrowBottom.png 5 | images/qss/Black/arrowLeft.png 6 | images/qss/Black/arrowRight.png 7 | images/qss/Black/arrowTop.png 8 | images/qss/Black/bottomArrow.png 9 | images/qss/Black/bottomArrowHover.png 10 | images/qss/Black/checkBox.png 11 | images/qss/Black/checkBoxChecked.png 12 | images/qss/Black/checkBoxCheckedHover.png 13 | images/qss/Black/checkBoxCheckedPressed.png 14 | images/qss/Black/checkBoxHover.png 15 | images/qss/Black/checkBoxIndeterminate.png 16 | images/qss/Black/checkBoxIndeterminateHover.png 17 | images/qss/Black/checkBoxIndeterminatePressed.png 18 | images/qss/Black/checkBoxPressed.png 19 | images/qss/Black/close.png 20 | images/qss/Black/closeHover.png 21 | images/qss/Black/closePressed.png 22 | images/qss/Black/delete.png 23 | images/qss/Black/deleteHover.png 24 | images/qss/Black/deletePressed.png 25 | images/qss/Black/downButton.png 26 | images/qss/Black/error.png 27 | images/qss/Black/feedback.png 28 | images/qss/Black/feedbackHover.png 29 | images/qss/Black/feedbackPressed.png 30 | images/qss/Black/information.png 31 | images/qss/Black/left.png 32 | images/qss/Black/maximize.png 33 | images/qss/Black/maximizeHover.png 34 | images/qss/Black/maximizePressed.png 35 | images/qss/Black/minimize.png 36 | images/qss/Black/minimizeHover.png 37 | images/qss/Black/minimizePressed.png 38 | images/qss/Black/nscc.png 39 | images/qss/Black/open.png 40 | images/qss/Black/openHover.png 41 | images/qss/Black/openPressed.png 42 | images/qss/Black/progressBar.png 43 | images/qss/Black/progressBarChunk.png 44 | images/qss/Black/question.png 45 | images/qss/Black/radioButton.png 46 | images/qss/Black/radioButtonChecked.png 47 | images/qss/Black/radioButtonCheckedHover.png 48 | images/qss/Black/radioButtonCheckedPressed.png 49 | images/qss/Black/radioButtonHover.png 50 | images/qss/Black/radioButtonPressed.png 51 | images/qss/Black/restore.png 52 | images/qss/Black/restoreHover.png 53 | images/qss/Black/restorePressed.png 54 | images/qss/Black/right.png 55 | images/qss/Black/scan.png 56 | images/qss/Black/skin.png 57 | images/qss/Black/skinHover.png 58 | images/qss/Black/skinPressed.png 59 | images/qss/Black/success.png 60 | images/qss/Black/topArrow.png 61 | images/qss/Black/topArrowHover.png 62 | images/qss/Black/transfer.png 63 | images/qss/Black/upButton.png 64 | images/qss/Black/warning.png 65 | images/qss/White/arrowBottom.png 66 | images/qss/White/arrowLeft.png 67 | images/qss/White/arrowRight.png 68 | images/qss/White/arrowTop.png 69 | images/qss/White/bottomArrow.png 70 | images/qss/White/bottomArrowHover.png 71 | images/qss/White/checkBox.png 72 | images/qss/White/checkBoxChecked.png 73 | images/qss/White/checkBoxCheckedHover.png 74 | images/qss/White/checkBoxCheckedPressed.png 75 | images/qss/White/checkBoxHover.png 76 | images/qss/White/checkBoxIndeterminate.png 77 | images/qss/White/checkBoxIndeterminateHover.png 78 | images/qss/White/checkBoxIndeterminatePressed.png 79 | images/qss/White/checkBoxPressed.png 80 | images/qss/White/close.png 81 | images/qss/White/closeHover.png 82 | images/qss/White/closePressed.png 83 | images/qss/White/delete.png 84 | images/qss/White/deleteHover.png 85 | images/qss/White/deletePressed.png 86 | images/qss/White/downButton.png 87 | images/qss/White/error.png 88 | images/qss/White/feedback.png 89 | images/qss/White/feedbackHover.png 90 | images/qss/White/feedbackPressed.png 91 | images/qss/White/information.png 92 | images/qss/White/left.png 93 | images/qss/White/maximize.png 94 | images/qss/White/maximizeHover.png 95 | images/qss/White/maximizePressed.png 96 | images/qss/White/minimize.png 97 | images/qss/White/minimizeHover.png 98 | images/qss/White/minimizePressed.png 99 | images/qss/White/nscc.png 100 | images/qss/White/open.png 101 | images/qss/White/openHover.png 102 | images/qss/White/openPressed.png 103 | images/qss/White/progressBar.png 104 | images/qss/White/progressBarChunk.png 105 | images/qss/White/question.png 106 | images/qss/White/radioButton.png 107 | images/qss/White/radioButtonChecked.png 108 | images/qss/White/radioButtonCheckedHover.png 109 | images/qss/White/radioButtonCheckedPressed.png 110 | images/qss/White/radioButtonHover.png 111 | images/qss/White/radioButtonPressed.png 112 | images/qss/White/restore.png 113 | images/qss/White/restoreHover.png 114 | images/qss/White/restorePressed.png 115 | images/qss/White/right.png 116 | images/qss/White/scan.png 117 | images/qss/White/skin.png 118 | images/qss/White/skinHover.png 119 | images/qss/White/skinPressed.png 120 | images/qss/White/success.png 121 | images/qss/White/topArrow.png 122 | images/qss/White/topArrowHover.png 123 | images/qss/White/transfer.png 124 | images/qss/White/upButton.png 125 | images/qss/White/warning.png 126 | images/qss/white.qss 127 | 128 | 129 | -------------------------------------------------------------------------------- /resources/cn.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Exam 6 | 7 | 8 | MainWindow 9 | 在线考试 10 | 11 | 12 | 13 | 测试 to do 14 | 测试 to do 15 | 16 | 17 | 18 | 在线考试 19 | 在线考试 20 | 21 | 22 | 23 | Login 24 | 25 | 26 | Login 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 | 74 | 75 | 76 | 虚拟键盘 77 | 虚拟键盘 78 | 79 | 80 | 81 | 简体中文 82 | 简体中文 83 | 84 | 85 | 86 | English 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 | 119 | 120 | 121 | 请输入用户名和密码! 122 | 请输入用户名和密码! 123 | 124 | 125 | 126 | 127 | 128 | 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 | 155 | 156 | 157 | 注册用户 158 | 注册用户 159 | 160 | 161 | 162 | Register 163 | 164 | 165 | Dialog 166 | 注册信息 167 | 168 | 169 | 170 | 用户名 171 | 用户名 172 | 173 | 174 | 175 | 密码 176 | 密码 177 | 178 | 179 | 180 | 确认密码 181 | 确认密码 182 | 183 | 184 | 185 | 邮箱 186 | 邮箱 187 | 188 | 189 | 190 | 191 | 注册 192 | 注册 193 | 194 | 195 | 196 | SystemTrayIcon 197 | 198 | 199 | 200 | 最小化(&M) 201 | 最小化(&M) 202 | 203 | 204 | 205 | 206 | 还 原(&R) 207 | 还 原(&R) 208 | 209 | 210 | 211 | 212 | 退出(&Q) 213 | 退出(&Q) 214 | 215 | 216 | 217 | 218 | 简体中文(&C) 219 | 简体中文(&C) 220 | 221 | 222 | 223 | 224 | 英语(&E) 225 | 英语(&E) 226 | 227 | 228 | 229 | 230 | 语言设置 231 | 语言 232 | 语言设置 233 | 234 | 235 | 236 | passwdEdit 237 | 238 | 239 | Dialog 240 | 注册信息 241 | 242 | 243 | 244 | 旧 密 码: 245 | 旧密码: 246 | 247 | 248 | 249 | 新 密 码: 250 | 新密码: 251 | 252 | 253 | 254 | 确认密码: 255 | 确认密码: 256 | 257 | 258 | 259 | 确定 260 | 确定 261 | 262 | 263 | 264 | 取消 265 | 取消 266 | 267 | 268 | 269 | 修改密码 270 | 修改密码 271 | 272 | 273 | 274 | 275 | 276 | 警告 277 | 警告 278 | 279 | 280 | 281 | 密码为空! 282 | 密码为空! 283 | 284 | 285 | 286 | 新密码与旧密码一样! 287 | 新密码与旧密码一样! 288 | 289 | 290 | 291 | 292 | 提示 293 | 提示 294 | 295 | 296 | 297 | 密码修改失败! 298 | 密码修改失败! 299 | 300 | 301 | 302 | 密码修改成功! 303 | 密码修改成功! 304 | 305 | 306 | 307 | 旧密码输入错误! 308 | 旧密码输入错误! 309 | 310 | 311 | 312 | -------------------------------------------------------------------------------- /resources/en.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Exam 6 | 7 | 8 | MainWindow 9 | online 10 | 11 | 12 | 13 | 测试 to do 14 | test to do 15 | 16 | 17 | 18 | 在线考试 19 | online 20 | 21 | 22 | 23 | Login 24 | 25 | 26 | Login 27 | Login 28 | 29 | 30 | 31 | 注册帐号 32 | Register user 33 | 34 | 35 | 36 | 37 | 找回密码 38 | Find Password 39 | 40 | 41 | 42 | 43 | 44 | 登录 45 | Login 46 | 47 | 48 | 49 | 50 | 记住密码 51 | Remember Psw 52 | 53 | 54 | 55 | 56 | 自动登录 57 | Auto Login 58 | 59 | 60 | 61 | 最小化 62 | min 63 | 64 | 65 | 66 | 关闭 67 | close 68 | 69 | 70 | 71 | 设置 72 | setting 73 | 74 | 75 | 76 | 虚拟键盘 77 | Virtual KeyWord 78 | 79 | 80 | 81 | 简体中文 82 | Simp Chinese 83 | 84 | 85 | 86 | English 87 | English 88 | 89 | 90 | 91 | 在线 92 | online 93 | 94 | 95 | 96 | 隐身 97 | hiding 98 | 99 | 100 | 101 | 离线 102 | out online 103 | 104 | 105 | 106 | 忙碌 107 | busy 108 | 109 | 110 | 111 | 112 | 113 | 114 | 警告 115 | Warnning 116 | 117 | 118 | 119 | 120 | 121 | 请输入用户名和密码! 122 | Please input user name and psw! 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 提示 131 | Info 132 | 133 | 134 | 135 | 136 | 用户不存在! 137 | user is not exist! 138 | 139 | 140 | 141 | 142 | 用户密码错误! 143 | User psw error! 144 | 145 | 146 | 147 | 注册成功! 148 | Register OK! 149 | 150 | 151 | 152 | 用户已存在! 153 | User is exist! 154 | 155 | 156 | 157 | 注册用户 158 | Register USer 159 | 160 | 161 | 162 | Register 163 | 164 | 165 | Dialog 166 | Register Info 167 | 168 | 169 | 170 | 用户名 171 | User Name 172 | 173 | 174 | 175 | 密码 176 | User Password 177 | 178 | 179 | 180 | 确认密码 181 | Re Password 182 | 183 | 184 | 185 | 邮箱 186 | Email 187 | 188 | 189 | 190 | 191 | 注册 192 | Register 193 | 194 | 195 | 196 | SystemTrayIcon 197 | 198 | 199 | 200 | 最小化(&M) 201 | Min(&M) 202 | 203 | 204 | 205 | 206 | 还 原(&R) 207 | Restore(&R) 208 | 209 | 210 | 211 | 212 | 退出(&Q) 213 | Exit(&Q) 214 | 215 | 216 | 217 | 218 | 简体中文(&C) 219 | China(&C) 220 | 221 | 222 | 223 | 224 | 英语(&E) 225 | English(&E) 226 | 227 | 228 | 229 | 230 | 语言设置 231 | 语言 232 | Language 233 | 234 | 235 | 236 | passwdEdit 237 | 238 | 239 | Dialog 240 | Register 241 | 242 | 243 | 244 | 旧 密 码: 245 | Old Psw: 246 | 247 | 248 | 249 | 新 密 码: 250 | New Psw: 251 | 252 | 253 | 254 | 确认密码: 255 | Reput Psw: 256 | 257 | 258 | 259 | 确定 260 | OK 261 | 262 | 263 | 264 | 取消 265 | Cannel 266 | 267 | 268 | 269 | 修改密码 270 | edit psw 271 | 272 | 273 | 274 | 275 | 276 | 警告 277 | Warnning 278 | 279 | 280 | 281 | 密码为空! 282 | Psw is NULL! 283 | 284 | 285 | 286 | 新密码与旧密码一样! 287 | Old psw as same as new psw! 288 | 289 | 290 | 291 | 292 | 提示 293 | Info 294 | 295 | 296 | 297 | 密码修改失败! 298 | Psw edit error! 299 | 300 | 301 | 302 | 密码修改成功! 303 | Psw chang ok! 304 | 305 | 306 | 307 | 旧密码输入错误! 308 | Old psw input error! 309 | 310 | 311 | 312 | -------------------------------------------------------------------------------- /src/AccountManager.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by peter on 19-5-27. 3 | // 4 | 5 | #include "AccountManager.h" 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | void AccountManager::registerUser(const QString &email) 12 | { 13 | //TODO QNetworkReply不会自动释放空间,一定要主动处理内存释放,可以调用QObject::deleteLater令其自动释放空间 14 | //TODO utf转码 15 | QUrl url("http://"+server+"/register"); 16 | QUrlQuery query; 17 | query.addQueryItem("username", username); 18 | //MD5 加密 19 | QCryptographicHash md5(QCryptographicHash::Md5); 20 | md5.addData(QByteArray(password.toStdString().c_str())); 21 | query.addQueryItem("password", md5.result().toHex()); 22 | query.addQueryItem("email", email); 23 | url.setQuery(query); 24 | QNetworkReply *reply = manager.get(QNetworkRequest(url)); 25 | connect(reply, SIGNAL(finished()), this, SLOT(on_register_finished())); 26 | } 27 | 28 | void AccountManager::login() 29 | { 30 | QUrl url("http://"+server+"/login"); 31 | QUrlQuery query; 32 | query.addQueryItem("username", username); 33 | //MD5 加密 34 | QCryptographicHash md5(QCryptographicHash::Md5); 35 | md5.addData(QByteArray(password.toStdString().c_str())); 36 | query.addQueryItem("password", md5.result().toHex()); 37 | url.setQuery(query); 38 | QNetworkReply *reply = manager.get(QNetworkRequest(url)); 39 | connect(reply, SIGNAL(finished()), this, SLOT(on_login_finished())); 40 | } 41 | 42 | void AccountManager::uploadFile(QString filename, QString content) 43 | { 44 | QUrl url("http://"+server+"/uploadFile"); 45 | // QUrlQuery query; 46 | // query.addQueryItem("token", token); 47 | // query.addQueryItem("filename", filename); 48 | // query.addQueryItem("content", content); 49 | // url.setQuery(query); 50 | QByteArray postData(QString("token=%1&filename=%2&content=%3").arg(token).arg(filename).arg(urlEncode(content)).toUtf8()); 51 | QNetworkRequest request(url); 52 | request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); 53 | QNetworkReply *reply = manager.post(request,postData); 54 | connect(reply, SIGNAL(finished()), this, SLOT(on_uploadFile_finished())); 55 | } 56 | 57 | //void AccountManager::updateFile(QString filename, QString content) 58 | //{ 59 | // QUrl url("http://"+server+"/updateFile"); 60 | // QByteArray postData(QString("{token:\"%1\", filename:\"%2\", content: \"%3\"}").arg(token).arg(filename).arg(content).toUtf8()); 61 | // QNetworkRequest request(url); 62 | // request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); 63 | // QNetworkReply *reply = manager.post(request,postData); 64 | // connect(reply, SIGNAL(finished()), this, SLOT(on_updateFile_finished())); 65 | //} 66 | 67 | void AccountManager::getContent(QString filename) 68 | { 69 | QUrl url("http://"+server+"/getContent"); 70 | QUrlQuery query; 71 | query.addQueryItem("token", token); 72 | query.addQueryItem("filename", filename); 73 | url.setQuery(query); 74 | QNetworkReply *reply = manager.get(QNetworkRequest(url)); 75 | connect(reply, SIGNAL(finished()), this, SLOT(on_getContent_finished())); 76 | } 77 | 78 | void AccountManager::getFiles() 79 | { 80 | QUrl url("http://"+server+"/getFiles"); 81 | QUrlQuery query; 82 | query.addQueryItem("token", token); 83 | url.setQuery(query); 84 | QNetworkReply *reply = manager.get(QNetworkRequest(url)); 85 | connect(reply, SIGNAL(finished()), this, SLOT(on_getFiles_finished())); 86 | } 87 | 88 | void AccountManager::deleteFile(QString filename) 89 | { 90 | QUrl url("http://"+server+"/deleteFile"); 91 | QUrlQuery query; 92 | query.addQueryItem("token", token); 93 | query.addQueryItem("filename", filename); 94 | url.setQuery(query); 95 | QNetworkReply *reply = manager.get(QNetworkRequest(url)); 96 | connect(reply, SIGNAL(finished()), this, SLOT(on_deleteFile_finished())); 97 | } 98 | 99 | void AccountManager::on_register_finished() 100 | { 101 | // QString buffer = QString::fromStdString(((QNetworkReply *)sender())->readAll().toStdString()).toUtf8(); 102 | // QJsonDocument document = QJsonDocument::fromJson(buffer.toUtf8()); 103 | QByteArray buffer = ((QNetworkReply *)sender())->readAll(); 104 | QJsonDocument document = QJsonDocument::fromJson(buffer); 105 | if(document.isObject()) 106 | { 107 | QJsonObject object = document.object(); 108 | if(object.contains("error")) 109 | { 110 | QMessageBox::warning((QWidget *)parent(), "error", object.value("error").toString()); 111 | } else if(object.contains("message")) 112 | { 113 | QMessageBox::information((QWidget *)parent(), "message", object.value("message").toString()); 114 | } else 115 | { 116 | QMessageBox::warning((QWidget *)parent(), "error", "invalid server!"); 117 | } 118 | } 119 | ((QNetworkReply *)sender())->deleteLater(); 120 | } 121 | 122 | void AccountManager::on_login_finished() 123 | { 124 | QByteArray buffer = ((QNetworkReply *)sender())->readAll(); 125 | QJsonDocument document = QJsonDocument::fromJson(buffer); 126 | if(document.isObject()) 127 | { 128 | QJsonObject object = document.object(); 129 | if(object.contains("error")) 130 | { 131 | QMessageBox::warning((QWidget *)parent(), "error", object.value("error").toString()); 132 | } else if(object.contains("message")&&object.contains("token")) 133 | { 134 | token = object.value("token").toString(); 135 | emit login_success();//成功 136 | // QMessageBox::information((QWidget *)parent(), "message", object.value("message").toString()+"!"); 137 | } else 138 | { 139 | QMessageBox::warning((QWidget *)parent(), "error", "invalid server!"); 140 | } 141 | } 142 | ((QNetworkReply *)sender())->deleteLater(); 143 | } 144 | 145 | void AccountManager::on_uploadFile_finished() 146 | { 147 | QByteArray buffer = ((QNetworkReply *)sender())->readAll(); 148 | QJsonDocument document = QJsonDocument::fromJson(buffer); 149 | if(document.isObject()) 150 | { 151 | QJsonObject object = document.object(); 152 | if(object.contains("error")) 153 | { 154 | QMessageBox::warning((QWidget *)parent(), "error", object.value("error").toString()); 155 | } else if(object.contains("message")) 156 | { 157 | QMessageBox::information((QWidget *)parent(), "message", object.value("message").toString()); 158 | } else 159 | { 160 | QMessageBox::warning((QWidget *)parent(), "error", "invalid server!"); 161 | } 162 | } 163 | ((QNetworkReply *)sender())->deleteLater(); 164 | } 165 | 166 | //void AccountManager::on_updateFile_finished() 167 | //{ 168 | // QByteArray buffer = ((QNetworkReply *)sender())->readAll(); 169 | // QJsonDocument document = QJsonDocument::fromJson(buffer); 170 | // if(document.isObject()) 171 | // { 172 | // QJsonObject object = document.object(); 173 | // if(object.contains("error")) 174 | // { 175 | // QMessageBox::warning((QWidget *)parent(), "error", object.value("error").toString()); 176 | // } else if(object.contains("message")) 177 | // { 178 | // QMessageBox::information((QWidget *)parent(), "message", object.value("message").toString()); 179 | // } else 180 | // { 181 | // QMessageBox::warning((QWidget *)parent(), "error", "invalid server!"); 182 | // } 183 | // } 184 | // ((QNetworkReply *)sender())->deleteLater(); 185 | //} 186 | 187 | void AccountManager::on_getContent_finished() 188 | { 189 | QByteArray buffer = ((QNetworkReply *)sender())->readAll(); 190 | QJsonDocument document = QJsonDocument::fromJson(buffer); 191 | if(document.isObject()) 192 | { 193 | QJsonObject object = document.object(); 194 | if(object.contains("error")) 195 | { 196 | QMessageBox::warning((QWidget *)parent(), "error", object.value("error").toString()); 197 | } else if(object.contains("message")&&object.contains("content")) 198 | { 199 | emit return_content(object.value("content").toString()); 200 | // QMessageBox::information((QWidget *)parent(), "message", object.value("message").toString()); 201 | } else 202 | { 203 | QMessageBox::warning((QWidget *)parent(), "error", "invalid server!"); 204 | } 205 | } 206 | ((QNetworkReply *)sender())->deleteLater(); 207 | } 208 | 209 | void AccountManager::on_getFiles_finished() 210 | { 211 | QByteArray buffer = ((QNetworkReply *)sender())->readAll(); 212 | QJsonDocument document = QJsonDocument::fromJson(buffer); 213 | if(document.isObject()) 214 | { 215 | QJsonObject object = document.object(); 216 | if(object.contains("error")) 217 | { 218 | QMessageBox::warning((QWidget *)parent(), "error", object.value("error").toString()); 219 | } else if(object.contains("message")&&object.contains("files")&&object.value("files").isArray()) 220 | { 221 | QJsonArray fileArray = object.value("files").toArray(); 222 | QList *fileList = new QList(); 223 | //TODO 记得释放fileList 224 | foreach(QJsonValue entry, fileArray) 225 | { 226 | fileList->append(entry.toObject().value("fileName").toString().split("-").value(1)); 227 | } 228 | emit return_files_list(fileList); 229 | // QMessageBox::information((QWidget *)parent(), "message", object.value("message").toString()); 230 | } else 231 | { 232 | QMessageBox::warning((QWidget *)parent(), "error", "invalid server!"); 233 | } 234 | } 235 | ((QNetworkReply *)sender())->deleteLater(); 236 | } 237 | 238 | void AccountManager::on_deleteFile_finished() 239 | { 240 | QByteArray buffer = ((QNetworkReply *)sender())->readAll(); 241 | QJsonDocument document = QJsonDocument::fromJson(buffer); 242 | if(document.isObject()) 243 | { 244 | QJsonObject object = document.object(); 245 | if(object.contains("error")) 246 | { 247 | QMessageBox::warning((QWidget *)parent(), "error", object.value("error").toString()); 248 | } else if(object.contains("message")) 249 | { 250 | QMessageBox::information((QWidget *)parent(), "message", object.value("message").toString()); 251 | } else 252 | { 253 | QMessageBox::warning((QWidget *)parent(), "error", "invalid server!"); 254 | } 255 | } 256 | ((QNetworkReply *)sender())->deleteLater(); 257 | } 258 | 259 | AccountManager::AccountManager(QWidget *parent):manager(parent) 260 | { 261 | 262 | } 263 | 264 | QString AccountManager::urlEncode(QString string) 265 | { 266 | return string 267 | .replace("%", "%25") 268 | .replace(" ","%20") 269 | .replace("\"", "%22") 270 | .replace("#", "%23") 271 | .replace("&", "%26") 272 | .replace("(", "%28") 273 | .replace(")", "%29") 274 | .replace("+", "%2B") 275 | .replace(",", "%2C") 276 | .replace("/", "%2F") 277 | .replace(":", "%3A") 278 | .replace(";", "%3B") 279 | .replace("<", "%3C") 280 | .replace("=", "%3D") 281 | .replace(">", "%3E") 282 | .replace("?", "%3F") 283 | .replace("@", "%40") 284 | .replace("\\", "%5C") 285 | .replace("|", "%7C"); 286 | ; 287 | } 288 | 289 | const QString &AccountManager::getUsername() const 290 | { 291 | return username; 292 | } 293 | 294 | const QString &AccountManager::getServer() const 295 | { 296 | return server; 297 | } 298 | 299 | AccountManager::~AccountManager() 300 | = default; -------------------------------------------------------------------------------- /src/login.cpp: -------------------------------------------------------------------------------- 1 | #include "login.h" 2 | #include "ui_login.h" 3 | 4 | #include "register.h" 5 | #include "systemtrayicon.h" 6 | #include "editor.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | float opacity1 = 0.0, opacity2 = 1.0; 17 | 18 | Login::Login(QWidget *parent) : 19 | QWidget(parent), 20 | ui(new Ui::Login) 21 | { 22 | ui->setupUi(this); 23 | manager = new AccountManager(); 24 | 25 | init(); 26 | connect(this, SIGNAL(close()), this, SLOT(close())); 27 | connect(manager, SIGNAL(login_success()), this, SLOT(login_success())); 28 | } 29 | 30 | Login::Login(QWidget *parent, AccountManager *manager_ptr, Editor* editor) : 31 | QWidget(parent), 32 | ui(new Ui::Login) 33 | { 34 | ui->setupUi(this); 35 | parentEditor=editor; 36 | manager = manager_ptr; 37 | init(); 38 | } 39 | 40 | Login::~Login() 41 | { 42 | delete ui; 43 | } 44 | 45 | void Login::showAgain() 46 | { 47 | ui->btn_regist->hide(); 48 | ui->btn_annonymous->hide(); 49 | connect(this, SIGNAL(close()), this, SLOT(close())); 50 | connect(manager, SIGNAL(login_success()), this, SLOT(login_success_without_entering())); 51 | show(); 52 | } 53 | 54 | void Login::init() 55 | { 56 | setWindowTitle(tr("login")); 57 | 58 | // ui->btn_edit_pwd->setStyleSheet("background-color:transparent;"); 59 | // ui->btn_regist->setStyleSheet("background-color:transparent;"); 60 | // ui->btn_login->setStyleSheet("background-color:transparent;"); 61 | 62 | m_Drag = false; 63 | 64 | timer1 = new QTimer; 65 | timer1->start(5); 66 | timer2 = new QTimer; 67 | connect(timer1, SIGNAL(timeout()), this, SLOT(slot_timer1())); 68 | connect(timer2, SIGNAL(timeout()), this, SLOT(slot_timer2())); 69 | 70 | configWindow();//UI界面设置 去边框,最小化,最大化button 71 | init_sql();//初始化界面密码,帐号的初值 72 | 73 | //init记住密码 74 | ui->lineEdit_passwd->setEchoMode(QLineEdit::Password); 75 | } 76 | 77 | void Login::get_user_info() 78 | { 79 | user_info_stu.userName.clear(); 80 | user_info_stu.userName = ui->cBox_account->currentText(); 81 | user_info_stu.passwd.clear(); 82 | user_info_stu.passwd = ui->lineEdit_passwd->text(); 83 | user_info_stu.server.clear(); 84 | user_info_stu.server = ui->cBox_server->currentText(); 85 | } 86 | 87 | void Login::configWindow() 88 | { 89 | 90 | // 填充背景图片 91 | QPalette palette; 92 | palette.setBrush(/*QPalette::Background*/this->backgroundRole(), 93 | QBrush(QPixmap(":/images/background.png"))); 94 | this->setPalette(palette); 95 | 96 | 97 | //去掉窗口边框 98 | setWindowFlags(Qt::FramelessWindowHint); 99 | 100 | //程序init时,设置top ,user img 101 | set_top_img(true, -1);//设置图片显示为随机显示 102 | set_user_img(true, -1);//设置user图片为随机显示 103 | 104 | //设置UI的按钮button 105 | set_button(); 106 | 107 | 108 | //设置任务栏系统托盘 start 109 | QStringList strList; 110 | strList << "Rose" << "Login";//login 为设置trayico的显示提示 111 | QIcon icon(":/images/ico/Qt-TextEditor.png"); 112 | SystemTrayIcon *trayIcon = new SystemTrayIcon(strList, icon, this); 113 | 114 | connect(trayIcon, SIGNAL(signal_lang_refresh()), this, SLOT(refresh()));//关联语言设置函数,刷新界面 115 | //设置任务栏系统托盘 end 116 | 117 | } 118 | 119 | 120 | void Login::init_sql() 121 | { 122 | db = QSqlDatabase::addDatabase("QSQLITE"); 123 | db.setDatabaseName("database.db"); 124 | if (!db.open()) 125 | { 126 | qDebug() << "database open fail!"; 127 | } else 128 | { 129 | qDebug() << "database open success!"; 130 | QSqlQuery query; 131 | 132 | //创建一个名为userInfo的表 顺序为: 用户名 密码 email 133 | QString sql_create_user_table = "CREATE TABLE if not exists userInfo (name VARCHAR PRIMARY KEY,passwd VARCHAR, email VARCHAR, rememberPasswd boolean);"; 134 | QString sql_create_server_table("CREATE TABLE if not exists serverList (address VARCHAR PRIMARY KEY);"); 135 | // query.prepare(sql_create_user_table); 136 | if (!query.exec(sql_create_user_table)) 137 | { 138 | qDebug() << "creater user table error"; 139 | } 140 | if (!query.exec(sql_create_server_table)) 141 | { 142 | qDebug() << "creater server table error"; 143 | } 144 | query.exec("INSERT INTO serverList VALUES ('www.peter-sia.top:2333')"); 145 | 146 | query.exec("select * from userInfo"); 147 | 148 | while (query.next()) 149 | { 150 | QString userName = query.value("name").toString(); 151 | ui->cBox_account->addItem(userName); 152 | QString passwd = query.value("passwd").toString(); 153 | userPasswd.append(passwd); 154 | is_remembered.append(query.value("rememberPasswd").toBool()); 155 | qDebug() << "userName:::" << userName << "passwd:::" << passwd; 156 | } 157 | 158 | if (!is_remembered.empty()&&is_remembered.at(0)) 159 | { 160 | ui->checkBox_rPasswd->setChecked(true); 161 | ui->lineEdit_passwd->setText(userPasswd.at(0)); 162 | } 163 | 164 | query.exec("select address from serverList"); 165 | while (query.next()) 166 | { 167 | ui->cBox_server->addItem(query.value("address").toString()); 168 | qDebug() << "address:" << query.value("address"); 169 | } 170 | 171 | ui->cBox_account->setCurrentIndex(0); 172 | ui->cBox_server->setCurrentIndex(0); 173 | } 174 | db.close(); 175 | qDebug() << "database closed!"; 176 | } 177 | 178 | void Login::set_top_img(bool isSandom, int index_img) 179 | { 180 | //427 185 181 | int set_index_img = 1; 182 | if (isSandom == true)//随机显示topimg 183 | { 184 | 185 | QTime time_sand; 186 | time_sand = QTime::currentTime();//获取当前时间 187 | qsrand(time_sand.msec() + time_sand.second() * 1000); 188 | 189 | //index_img = qrand()%5 ;//在0-4中选出随机数 190 | set_index_img = qrand() % 5 + 1;//在1-5中选出随机数 191 | 192 | } 193 | if (isSandom == false) //不随机显示,按index_img显示图片s 194 | { 195 | set_index_img = index_img; 196 | } 197 | 198 | QString top_img_path = ":/images/top_img1.png"; 199 | qDebug() << " [leo]" << top_img_path; 200 | QImage top_img; 201 | top_img_path = ":/images/top_img" + QString::number(set_index_img, 10) + ".png"; 202 | qDebug() << " [leo]" << top_img_path; 203 | top_img.load(top_img_path); 204 | QPixmap top_pic = QPixmap::fromImage(top_img.scaled(ui->label_top_img->width(), ui->label_top_img->height())); 205 | ui->label_top_img->setPixmap(top_pic); 206 | qDebug() << " [leo]top_img width heigh:" << ui->label_top_img->width() 207 | << " " << ui->label_top_img->height(); 208 | } 209 | 210 | void Login::set_button() 211 | { 212 | //构建最小化、关闭按钮,设置按钮,键盘ico 213 | minBtn = new QToolButton(this); 214 | closeBbtn = new QToolButton(this); 215 | setBtn = new QToolButton(this); 216 | 217 | // //获取最小化、关闭按钮图标 218 | // QPixmap minPix = style()->standardPixmap(QStyle::SP_TitleBarMinButton); 219 | // QPixmap closePix = style()->standardPixmap(QStyle::SP_TitleBarCloseButton); 220 | // //设置最小化、关闭按钮图标 221 | // minBtn->setIcon(minPix); 222 | // closeBbtn->setIcon(closePix); 223 | 224 | //获取界面的宽度 225 | int width = this->width(); 226 | //设置最小化、关闭按钮在界面的位置 227 | minBtn->setGeometry(width - 55, 5, 20, 20); 228 | closeBbtn->setGeometry(width - 25, 5, 20, 20); 229 | setBtn->setGeometry(width - 80, 7, 15, 15); 230 | //设置键盘ico坐标 231 | int x = ui->lineEdit_passwd->x(); 232 | int y = ui->lineEdit_passwd->y(); 233 | int widthkey = ui->lineEdit_passwd->width(); 234 | 235 | qDebug() << "[leo]width:" << width; 236 | qDebug() << "[leo]minBtn" << minBtn->geometry(); 237 | qDebug() << "[leo]closeBbtn" << closeBbtn->geometry(); 238 | 239 | //设置鼠标移至按钮上的提示信息 240 | minBtn->setToolTip(tr("最小化")); 241 | closeBbtn->setToolTip(tr("关闭")); 242 | setBtn->setToolTip(tr("设置")); 243 | 244 | //设置最小化、关闭按钮的样式图标 245 | minBtn->setIcon(QIcon(":/images/ico/mini.png")); 246 | minBtn->setStyleSheet("background-color:transparent;"); 247 | closeBbtn->setIcon(QIcon(":/images/ico/close.png")); 248 | closeBbtn->setStyleSheet("background-color:transparent;"); 249 | setBtn->setIcon(QIcon(":/images/ico/setting.png")); 250 | setBtn->setStyleSheet("background-color:transparent;"); 251 | 252 | //关联最小化、关闭按钮的槽函数,键盘exe 253 | connect(minBtn, SIGNAL(clicked()), this, SLOT(slot_minWindow())); 254 | connect(closeBbtn, SIGNAL(clicked()), this, SLOT(slot_closeWindow())); 255 | connect(setBtn, SIGNAL(clicked()), this, SLOT(slot_setLanguage())); 256 | 257 | create_menuLanguage(); //创建语言菜单 258 | } 259 | 260 | void Login::set_user_img(bool isSandom, int index_img) 261 | { 262 | //40,182 85 85 263 | int set_index_img = 1; 264 | if (isSandom == true)//随机显示userimg 265 | { 266 | 267 | QTime time_sand; 268 | time_sand = QTime::currentTime();//获取当前时间 269 | qsrand(time_sand.msec() + time_sand.second() * 1000); 270 | set_index_img = qrand() % 5 + 1;//在1-5中选出随机数 271 | 272 | } 273 | if (isSandom == false) //不随机显示,按index_img显示图片s 274 | { 275 | set_index_img = index_img; 276 | } 277 | 278 | QString user_img_path = ":/images/ico/user1.png"; 279 | qDebug() << " [leo]user" << user_img_path; 280 | QImage user_img; 281 | user_img_path = ":/images/ico/user" + QString::number(set_index_img, 10) + ".png"; 282 | qDebug() << " [leo]user" << user_img_path; 283 | user_img.load(user_img_path); 284 | QPixmap img_pic = QPixmap::fromImage(user_img.scaled(ui->label_user_img->width(), 285 | ui->label_user_img->height())); 286 | ui->label_user_img->setPixmap(img_pic); 287 | qDebug() << " [leo]user_img width height:" << ui->label_user_img->width() 288 | << " " << ui->label_user_img->height(); 289 | } 290 | 291 | void Login::create_menuLanguage() 292 | { 293 | //语言 294 | act_chinese = new QAction(tr("简体中文"), this); 295 | act_english = new QAction(tr("English"), this); 296 | menu1 = new QMenu; 297 | menu1->addAction(act_chinese); 298 | menu1->addAction(act_english); 299 | 300 | //在线状态 301 | act0 = new QAction(tr("在线"), this); 302 | act1 = new QAction(tr("隐身"), this); 303 | act2 = new QAction(tr("离线"), this); 304 | act3 = new QAction(tr("忙碌"), this); 305 | 306 | actGrp = new QActionGroup(this); 307 | actGrp->addAction(act0); 308 | actGrp->addAction(act1); 309 | actGrp->addAction(act2); 310 | actGrp->addAction(act3); 311 | connect(actGrp, SIGNAL(triggered(QAction * )), this, SLOT(slot_actGrp(QAction * ))); 312 | 313 | menu2 = new QMenu; 314 | menu2->addAction(act0); 315 | menu2->addAction(act1); 316 | menu2->addAction(act2); 317 | menu2->addAction(act3); 318 | 319 | menu1->addAction(act0); 320 | menu1->addAction(act1); 321 | menu1->addAction(act2); 322 | menu1->addAction(act3); 323 | } 324 | 325 | void Login::setStyle(const QString &style) 326 | { 327 | QFile qss(":/images/qss/" + style);//black.qss 328 | qDebug() << "qss :"; 329 | qss.open(QIODevice::ReadOnly | QIODevice::Text); 330 | qApp->setStyleSheet(qss.readAll()); 331 | qss.close(); 332 | } 333 | 334 | 335 | void Login::mousePressEvent(QMouseEvent *e) 336 | { 337 | if (e->button() == Qt::LeftButton) 338 | { 339 | m_Drag = true; 340 | m_point = e->globalPos() - this->pos(); 341 | e->accept(); 342 | // qDebug()<<"leo"; 343 | } 344 | } 345 | 346 | void Login::mouseMoveEvent(QMouseEvent *e) 347 | { 348 | if (m_Drag && (e->buttons() && Qt::LeftButton)) 349 | { 350 | move(e->globalPos() - m_point); 351 | e->accept(); 352 | // qDebug()<<"leomove"; 353 | } 354 | } 355 | 356 | void Login::mouseReleaseEvent(QMouseEvent *e) 357 | { 358 | m_Drag = false; 359 | } 360 | 361 | void Login::on_btn_login_clicked() 362 | { 363 | qDebug() << "login:" << user_info_stu.userName << user_info_stu.passwd; 364 | if (ui->cBox_account->currentText().isEmpty() || 365 | ui->lineEdit_passwd->text().isEmpty() || 366 | ui->cBox_server->currentText().isEmpty()) 367 | { 368 | QMessageBox::warning(this, tr("error"), tr("Username, Password And Server Are Needed!")); 369 | } else 370 | { 371 | //TODO 372 | get_user_info(); 373 | manager->setUsername(user_info_stu.userName); 374 | manager->setPassword(user_info_stu.passwd); 375 | manager->setServer(user_info_stu.server); 376 | manager->login(); 377 | // manager.setUsername("lalal"); 378 | // manager.setPassword("peter123"); 379 | // manager.setServer("www.peter-sia.top:2333"); 380 | // manager.login(); 381 | } 382 | } 383 | 384 | void Login::on_btn_annonymous_clicked() 385 | { 386 | manager->setUsername(nullptr); 387 | manager->setPassword(nullptr); 388 | manager->setServer(nullptr); 389 | Editor *e = new Editor(*manager, nullptr, true); 390 | e->show(); 391 | emit close(); 392 | } 393 | 394 | void Login::login_success() 395 | { 396 | if (!db.open()) 397 | { 398 | qDebug() << "database open fail login!"; 399 | } else 400 | { 401 | QSqlQuery query; 402 | qDebug() << "database open success login!"; 403 | QString sql_insert_server_address = "INSERT INTO serverList VALUES (:address);"; 404 | query.prepare(sql_insert_server_address); 405 | query.bindValue(":address", ui->cBox_server->currentText()); 406 | query.exec(); 407 | QString sql_insert_user = "INSERT INTO userInfo (name, passwd, email) VALUES (:username, :password, :email)"; 408 | query.prepare(sql_insert_user); 409 | query.bindValue(":username", user_info_stu.userName); 410 | query.bindValue(":password", user_info_stu.passwd); 411 | query.bindValue(":email", user_info_stu.email); 412 | query.exec(); 413 | if (ui->checkBox_rPasswd->isChecked()) 414 | { 415 | query.prepare("update userInfo set rememberPasswd = 1 where name = :user;"); 416 | query.bindValue(":user", user_info_stu.userName); 417 | query.exec(); 418 | } else 419 | { 420 | query.prepare("update userInfo set rememberPasswd = 0 where name = :user;"); 421 | query.bindValue(":user", user_info_stu.userName); 422 | query.exec(); 423 | } 424 | Editor *e = new Editor(*manager, nullptr, false); 425 | e->setUser(user_info_stu.userName); 426 | e->setServer(ui->cBox_server->currentText()); 427 | e->show(); 428 | emit close(); 429 | } 430 | 431 | db.close(); 432 | } 433 | 434 | void Login::login_success_without_entering() 435 | { 436 | if (!db.open()) 437 | { 438 | qDebug() << "database open fail login!"; 439 | } else 440 | { 441 | QSqlQuery query; 442 | qDebug() << "database open success login!"; 443 | QString sql_insert_server_address = "INSERT INTO serverList VALUES (:address);"; 444 | query.prepare(sql_insert_server_address); 445 | query.bindValue(":address", ui->cBox_server->currentText()); 446 | query.exec(); 447 | QString sql_insert_user = "INSERT INTO userInfo (name, passwd, email) VALUES (:username, :password, :email)"; 448 | query.prepare(sql_insert_user); 449 | query.bindValue(":username", user_info_stu.userName); 450 | query.bindValue(":password", user_info_stu.passwd); 451 | query.bindValue(":email", user_info_stu.email); 452 | query.exec(); 453 | if (ui->checkBox_rPasswd->isChecked()) 454 | { 455 | query.prepare("update userInfo set rememberPasswd = 1 where name = :user;"); 456 | query.bindValue(":user", user_info_stu.userName); 457 | query.exec(); 458 | } else 459 | { 460 | query.prepare("update userInfo set rememberPasswd = 0 where name = :user;"); 461 | query.bindValue(":user", user_info_stu.userName); 462 | query.exec(); 463 | } 464 | QMessageBox::information(this, "success", "login successfully!"); 465 | parentEditor->setUser(manager->getUsername()); 466 | parentEditor->setServer(manager->getServer()); 467 | parentEditor->setAnonymous(false); 468 | parentEditor->updateFileListTimer(); 469 | emit close(); 470 | } 471 | 472 | db.close(); 473 | } 474 | 475 | ////注册button 476 | //void Login::on_btn_regist_clicked() 477 | //{ 478 | // Register r(this); 479 | // this->hide(); 480 | // r.show(); 481 | // //transmitdb(database); 482 | // r.exec(); 483 | // this->show(); 484 | //} 485 | 486 | //注册button 487 | void Login::on_btn_regist_clicked() 488 | { 489 | //TODO 490 | Register r(manager, this); 491 | //transmitdb(database); 492 | r.exec(); //注册页面r,仅仅获取信息. 493 | 494 | // get_user_info(); 495 | // if (user_info_stu.userName.isEmpty() || user_info_stu.passwd.isEmpty() || user_info_stu.server.isEmpty()) 496 | // { 497 | // QMessageBox::warning(this, tr("提示"), tr("请同时输入服务器地址和用户名密码!")); 498 | // } else 499 | // { 500 | //// bool existFlag = false; //判断用户是否存在 501 | // manager.setUsername(user_info_stu.userName); 502 | // manager.setPassword(user_info_stu.passwd); 503 | // manager.setServer(user_info_stu.server); 504 | // manager.registerUser(user_info_stu.email); 505 | // if (!db.open()) 506 | // { 507 | // qDebug() << "database open fail regist!"; 508 | // } else 509 | // { 510 | // QSqlQuery query; 511 | // qDebug() << "database open success regist!"; 512 | // query.prepare("select * from userInfo where name = :username;"); 513 | // query.bindValue(":username", user_info_stu.userName); 514 | // query.exec(); 515 | // qDebug() << query.lastQuery(); 516 | // if (query.first()) 517 | // { 518 | // QString userName = query.value("name").toString(); 519 | // QString passwd = query.value("passwd").toString(); 520 | // if (userName == user_info_stu.userName) 521 | // { 522 | // existFlag = true; //用户存在 523 | // } 524 | // } 525 | //// while (query.next()) 526 | //// { 527 | //// QString userName = query.value(0).toString(); 528 | //// QString passwd = query.value(1).toString(); 529 | //// qDebug() << "regist userName:::" << userName << "passwd:::" << passwd; 530 | //// 531 | //// if (userName == user_info_stu.userName) 532 | //// { 533 | //// existFlag = true; //用户存在 534 | //// } 535 | //// } 536 | // 537 | // if (!existFlag) 538 | // { 539 | // if (query.exec(QString("insert into userInfo values ('%1','%2','%3', false)") 540 | // .arg(user_info_stu.userName).arg(user_info_stu.passwd) 541 | // .arg(user_info_stu.email))) 542 | // { 543 | // qDebug() << "ddd:" << user_info_stu.userName << user_info_stu.passwd << user_info_stu.email; 544 | // qDebug() << "regist:::" << query.lastQuery(); 545 | // ui->cBox_account->addItem(user_info_stu.userName); 546 | // userPasswd.append(user_info_stu.passwd); 547 | // QMessageBox::information(this, tr("提示"), tr("注册成功!")); 548 | // } 549 | // 550 | // } else 551 | // { 552 | // QMessageBox::warning(this, tr("警告"), tr("用户已存在!")); 553 | // } 554 | // } 555 | // db.close(); 556 | // } 557 | } 558 | 559 | ////修改密码button 560 | //void Login::on_btn_edit_pwd_clicked() 561 | //{ 562 | // if (ui->cBox_account->currentText().isEmpty() || 563 | // ui->lineEdit_passwd->text().isEmpty()) 564 | // { 565 | // QMessageBox::information(this, tr("提示"), tr("请输入用户名和密码!")); 566 | // } else 567 | // { 568 | // bool is_use_exist_flag = false; //判断用户是否存在 569 | // bool is_use_nampwd_check_flag = false; //判断用户名和密码是否匹配 570 | // get_user_info(); 571 | // 572 | // if (!db.open()) 573 | // { 574 | // qDebug() << "database open fail login!"; 575 | // } else 576 | // { 577 | // QSqlQuery query; 578 | // qDebug() << "database open success login!"; 579 | // query.exec("select * from userInfo"); 580 | // while (query.next()) 581 | // { 582 | // QString userName = query.value(0).toString(); 583 | // QString passwd = query.value(1).toString(); 584 | // qDebug() << "edit userName:::" << userName << "passwd:::" << passwd; 585 | // 586 | // if (userName == user_info_stu.userName) 587 | // { 588 | // is_use_exist_flag = true; //用户存在 589 | // if (passwd == user_info_stu.passwd) 590 | // { 591 | // is_use_nampwd_check_flag = true; //用户名和密码匹配 592 | // passwdEdit passwd; 593 | // passwd.setLogin(this); 594 | // //this->hide(); 595 | // passwd.exec(); 596 | // } 597 | // } 598 | // } 599 | // 600 | // if (is_use_exist_flag == false) 601 | // { 602 | // QMessageBox::information(this, tr("提示"), tr("用户不存在!")); 603 | // } else 604 | // { 605 | // if (is_use_nampwd_check_flag == 0) 606 | // { 607 | // QMessageBox::warning(this, tr("警告"), tr("用户密码错误!")); 608 | // } 609 | // } 610 | // } 611 | // db.close(); 612 | // } 613 | //} 614 | 615 | //最小化button 616 | void Login::slot_minWindow() 617 | { 618 | this->showMinimized(); 619 | } 620 | 621 | void Login::slot_closeWindow() 622 | { 623 | timer2->start(5); 624 | } 625 | 626 | void Login::slot_setLanguage() 627 | { 628 | menu1->exec(QCursor::pos()); 629 | } 630 | 631 | void Login::slot_actGrp(QAction *act) 632 | { 633 | if (act == act0) 634 | { 635 | qDebug() << "act0"; 636 | } else if (act == act1) 637 | { 638 | qDebug() << "act1"; 639 | } else if (act == act2) 640 | { 641 | qDebug() << "act2"; 642 | } else if (act == act3) 643 | { 644 | qDebug() << "act3"; 645 | } 646 | } 647 | 648 | void Login::slot_timer1() 649 | { 650 | if (opacity1 >= 1.0) 651 | { 652 | timer1->stop(); 653 | } else 654 | { 655 | opacity1 += 0.01; 656 | } 657 | setWindowOpacity(opacity1);//设置窗口透明度 658 | } 659 | 660 | void Login::slot_timer2() 661 | { 662 | if (opacity2 <= 0.0) 663 | { 664 | timer2->stop(); 665 | 666 | this->close(); 667 | } else 668 | { 669 | opacity2 -= 0.01; 670 | } 671 | setWindowOpacity(opacity2);//设置窗口透明度 672 | } 673 | 674 | void Login::on_cBox_account_activated(int index) 675 | { 676 | if (is_remembered.at(index)) 677 | { 678 | ui->lineEdit_passwd->setText(userPasswd.at(index)); 679 | ui->checkBox_rPasswd->setChecked(true); 680 | } else 681 | { 682 | ui->lineEdit_passwd->setText(""); 683 | ui->checkBox_rPasswd->setChecked(false); 684 | } 685 | qDebug() << "change cBox:" << ui->cBox_account->currentText() 686 | << userPasswd.at(index); 687 | } 688 | 689 | 690 | //下拉框选里面的项时,会切换top_img的图片和头像图片 691 | void Login::on_cBox_account_currentIndexChanged(int index) 692 | { 693 | set_top_img(true, index); 694 | set_user_img(true, index); 695 | } 696 | 697 | void Login::refresh()//刷新login页面当前的字符串。其它页面无需刷新,因为打开时候,会自动刷新相关字符串。而主窗口不会。 698 | { 699 | qDebug() << "xxxxxxxxxxxxxxxxxxx"; 700 | ui->btn_login->setText(tr("login")); 701 | ui->btn_regist->setText(tr("register")); 702 | //ui->checkBox_autoLogin->setText(tr("自动登录")); 703 | ui->label->setText(tr("remember me")); 704 | ui->label_2->setText(tr("auto login")); 705 | 706 | } 707 | 708 | 709 | -------------------------------------------------------------------------------- /resources/images/qss/white.qss: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright : http://blog.csdn.net/liang19890820 5 | * 6 | * Author : 一去丶二三里 7 | * 8 | * Date : 2016/07/22 9 | * 10 | * Description : 白色靓丽 11 | * 12 | */ 13 | 14 | /**********子界面背景**********/ 15 | QWidget#customWidget { 16 | background: rgb(173, 202, 232); 17 | } 18 | 19 | /**********子界面中央背景**********/ 20 | QWidget#centerWidget { 21 | background: rgb(232, 241, 252); 22 | } 23 | 24 | /**********主界面样式**********/ 25 | QWidget#mainWindow { 26 | border: 1px solid rgb(111, 156, 207); 27 | background: rgb(232, 241, 252); 28 | } 29 | 30 | QWidget#messageWidget { 31 | background: rgba(173, 202, 232, 50%); 32 | } 33 | 34 | QWidget#loadingWidget { 35 | border: none; 36 | border-radius: 5px; 37 | background: rgb(187, 212, 238); 38 | } 39 | 40 | QWidget#remoteWidget { 41 | border-top-right-radius: 10px; 42 | border-bottom-right-radius: 10px; 43 | border: 1px solid rgb(111, 156, 207); 44 | border-left: none; 45 | background: transparent; 46 | } 47 | 48 | StyledWidget { 49 | qproperty-normalColor: rgb(65, 65, 65); 50 | qproperty-disableColor: rgb(180, 180, 180); 51 | qproperty-highlightColor: rgb(0, 160, 230); 52 | qproperty-errorColor: red; 53 | } 54 | 55 | QProgressIndicator { 56 | qproperty-color: rgb(2, 65, 132); 57 | } 58 | 59 | /**********提示**********/ 60 | QToolTip{ 61 | border: 1px solid rgb(111, 156, 207); 62 | background: white; 63 | color: rgb(51, 51, 51); 64 | } 65 | 66 | /**********菜单栏**********/ 67 | QMenuBar { 68 | background: rgb(187, 212, 238); 69 | border: 1px solid rgb(111, 156, 207); 70 | border-left: none; 71 | border-right: none; 72 | } 73 | QMenuBar::item { 74 | border: 1px solid transparent; 75 | padding: 5px 10px 5px 10px; 76 | background: transparent; 77 | } 78 | QMenuBar::item:enabled { 79 | color: rgb(2, 65, 132); 80 | } 81 | QMenuBar::item:!enabled { 82 | color: rgb(155, 155, 155); 83 | } 84 | QMenuBar::item:enabled:selected { 85 | border-top-color: rgb(111, 156, 207); 86 | border-bottom-color: rgb(111, 156, 207); 87 | background: rgb(198, 224, 252); 88 | } 89 | 90 | /**********菜单**********/ 91 | QMenu { 92 | border: 1px solid rgb(111, 156, 207); 93 | background: rgb(232, 241, 250); 94 | } 95 | QMenu::item { 96 | height: 22px; 97 | padding: 0px 25px 0px 20px; 98 | } 99 | QMenu::item:enabled { 100 | color: rgb(84, 84, 84); 101 | } 102 | QMenu::item:!enabled { 103 | color: rgb(155, 155, 155); 104 | } 105 | QMenu::item:enabled:selected { 106 | color: rgb(2, 65, 132); 107 | background: rgba(255, 255, 255, 200); 108 | } 109 | QMenu::separator { 110 | height: 1px; 111 | background: rgb(111, 156, 207); 112 | } 113 | QMenu::indicator { 114 | width: 13px; 115 | height: 13px; 116 | } 117 | QMenu::icon { 118 | padding-left: 2px; 119 | padding-right: 2px; 120 | } 121 | 122 | /**********状态栏**********/ 123 | QStatusBar { 124 | background: rgb(187, 212, 238); 125 | border: 1px solid rgb(111, 156, 207); 126 | border-left: none; 127 | border-right: none; 128 | border-bottom: none; 129 | } 130 | QStatusBar::item { 131 | border: none; 132 | border-right: 1px solid rgb(111, 156, 207); 133 | } 134 | 135 | /**********分组框**********/ 136 | QGroupBox { 137 | font-size: 15px; 138 | border: 1px solid rgb(111, 156, 207); 139 | border-radius: 4px; 140 | margin-top: 10px; 141 | } 142 | QGroupBox::title { 143 | color: rgb(56, 99, 154); 144 | top: -12px; 145 | left: 10px; 146 | } 147 | 148 | /**********页签项**********/ 149 | QTabWidget::pane { 150 | border: none; 151 | border-top: 3px solid rgb(0, 78, 161); 152 | background: rgb(187, 212, 238); 153 | } 154 | QTabWidget::tab-bar { 155 | border: none; 156 | } 157 | QTabBar::tab { 158 | border: none; 159 | border-top-left-radius: 4px; 160 | border-top-right-radius: 4px; 161 | color: white; 162 | background: rgb(120, 170, 220); 163 | height: 28px; 164 | min-width: 85px; 165 | margin-right: 5px; 166 | padding-left: 5px; 167 | padding-right: 5px; 168 | } 169 | QTabBar::tab:hover { 170 | background: rgb(0, 78, 161); 171 | } 172 | QTabBar::tab:selected { 173 | color: white; 174 | background: rgb(0, 78, 161); 175 | } 176 | 177 | QTabWidget#tabWidget::pane { 178 | border: 1px solid rgb(111, 156, 207); 179 | background: rgb(232, 241, 252); 180 | margin-top: -1px; 181 | } 182 | 183 | QTabBar#tabBar::tab { 184 | border: 1px solid rgb(111, 156, 207); 185 | border-bottom: none; 186 | color: rgb(70, 71, 73); 187 | background: transparent; 188 | } 189 | QTabBar#tabBar::tab:hover { 190 | color: rgb(2, 65, 132); 191 | } 192 | QTabBar#tabBar::tab:selected { 193 | color: rgb(2, 65, 132); 194 | background: rgb(232, 241, 252); 195 | } 196 | 197 | /**********表头**********/ 198 | QHeaderView{ 199 | border: none; 200 | border-bottom: 3px solid rgb(0, 78, 161); 201 | background: transparent; 202 | min-height: 30px; 203 | } 204 | QHeaderView::section:horizontal { 205 | border: none; 206 | color: rgb(2, 65, 132); 207 | background: transparent; 208 | padding-left: 5px; 209 | } 210 | QHeaderView::section:horizontal:hover { 211 | color: white; 212 | background: rgb(0, 78, 161); 213 | } 214 | QHeaderView::section:horizontal:pressed { 215 | color: white; 216 | background: rgb(6, 94, 187); 217 | } 218 | QHeaderView::up-arrow { 219 | width: 13px; 220 | height: 11px; 221 | padding-right: 5px; 222 | image: url(:/images/qss/White/topArrow); 223 | subcontrol-position: center right; 224 | } 225 | QHeaderView::up-arrow:hover, QHeaderView::up-arrow:pressed { 226 | image: url(:/images/qss/White/topArrowHover); 227 | } 228 | QHeaderView::down-arrow { 229 | width: 13px; 230 | height: 11px; 231 | padding-right: 5px; 232 | image: url(:/images/qss/White/bottomArrow); 233 | subcontrol-position: center right; 234 | } 235 | QHeaderView::down-arrow:hover, QHeaderView::down-arrow:pressed { 236 | image: url(:/images/qss/White/bottomArrowHover); 237 | } 238 | 239 | /**********表格**********/ 240 | QTableView { 241 | border: 1px solid rgb(111, 156, 207); 242 | background: rgb(224, 238, 255); 243 | gridline-color: rgb(111, 156, 207); 244 | } 245 | QTableView::item { 246 | padding-left: 5px; 247 | padding-right: 5px; 248 | border: none; 249 | background: white; 250 | border-right: 1px solid rgb(111, 156, 207); 251 | border-bottom: 1px solid rgb(111, 156, 207); 252 | } 253 | QTableView::item:selected { 254 | background: rgba(255, 255, 255, 100); 255 | } 256 | QTableView::item:selected:!active { 257 | color: rgb(65, 65, 65); 258 | } 259 | QTableView::indicator { 260 | width: 20px; 261 | height: 20px; 262 | } 263 | QTableView::indicator:enabled:unchecked { 264 | image: url(:/images/qss/White/checkBox); 265 | } 266 | QTableView::indicator:enabled:unchecked:hover { 267 | image: url(:/images/qss/White/checkBoxHover); 268 | } 269 | QTableView::indicator:enabled:unchecked:pressed { 270 | image: url(:/images/qss/White/checkBoxPressed); 271 | } 272 | QTableView::indicator:enabled:checked { 273 | image: url(:/images/qss/White/checkBoxChecked); 274 | } 275 | QTableView::indicator:enabled:checked:hover { 276 | image: url(:/images/qss/White/checkBoxCheckedHover); 277 | } 278 | QTableView::indicator:enabled:checked:pressed { 279 | image: url(:/images/qss/White/checkBoxCheckedPressed); 280 | } 281 | QTableView::indicator:enabled:indeterminate { 282 | image: url(:/images/qss/White/checkBoxIndeterminate); 283 | } 284 | QTableView::indicator:enabled:indeterminate:hover { 285 | image: url(:/images/qss/White/checkBoxIndeterminateHover); 286 | } 287 | QTableView::indicator:enabled:indeterminate:pressed { 288 | image: url(:/images/qss/White/checkBoxIndeterminatePressed); 289 | } 290 | 291 | /**********滚动条-水平**********/ 292 | QScrollBar:horizontal { 293 | height: 20px; 294 | background: transparent; 295 | margin-top: 3px; 296 | margin-bottom: 3px; 297 | } 298 | QScrollBar::handle:horizontal { 299 | height: 20px; 300 | min-width: 30px; 301 | background: rgb(170, 200, 230); 302 | margin-left: 15px; 303 | margin-right: 15px; 304 | } 305 | QScrollBar::handle:horizontal:hover { 306 | background: rgb(165, 195, 225); 307 | } 308 | QScrollBar::sub-line:horizontal { 309 | width: 15px; 310 | background: transparent; 311 | image: url(:/images/qss/White/arrowLeft); 312 | subcontrol-position: left; 313 | } 314 | QScrollBar::add-line:horizontal { 315 | width: 15px; 316 | background: transparent; 317 | image: url(:/images/qss/White/arrowRight); 318 | subcontrol-position: right; 319 | } 320 | QScrollBar::sub-line:horizontal:hover { 321 | background: rgb(170, 200, 230); 322 | } 323 | QScrollBar::add-line:horizontal:hover { 324 | background: rgb(170, 200, 230); 325 | } 326 | QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal { 327 | background: transparent; 328 | } 329 | 330 | /**********滚动条-垂直**********/ 331 | QScrollBar:vertical { 332 | width: 20px; 333 | background: transparent; 334 | margin-left: 3px; 335 | margin-right: 3px; 336 | } 337 | QScrollBar::handle:vertical { 338 | width: 20px; 339 | min-height: 30px; 340 | background: rgb(170, 200, 230); 341 | margin-top: 15px; 342 | margin-bottom: 15px; 343 | } 344 | QScrollBar::handle:vertical:hover { 345 | background: rgb(165, 195, 225); 346 | } 347 | QScrollBar::sub-line:vertical { 348 | height: 15px; 349 | background: transparent; 350 | image: url(:/images/qss/White/topArrow); 351 | subcontrol-position: top; 352 | } 353 | QScrollBar::add-line:vertical { 354 | height: 15px; 355 | background: transparent; 356 | image: url(:/images/qss/White/bottomArrow); 357 | subcontrol-position: bottom; 358 | } 359 | QScrollBar::sub-line:vertical:hover { 360 | background: rgb(170, 200, 230); 361 | } 362 | QScrollBar::add-line:vertical:hover { 363 | background: rgb(170, 200, 230); 364 | } 365 | QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { 366 | background: transparent; 367 | } 368 | 369 | QScrollBar#verticalScrollBar:vertical { 370 | margin-top: 30px; 371 | } 372 | 373 | /**********下拉列表**********/ 374 | QComboBox { 375 | height: 25px; 376 | border-radius: 4px; 377 | border: 1px solid rgb(111, 156, 207); 378 | background: white; 379 | } 380 | QComboBox:enabled { 381 | color: rgb(84, 84, 84); 382 | } 383 | QComboBox:!enabled { 384 | color: rgb(80, 80, 80); 385 | } 386 | QComboBox:enabled:hover, QComboBox:enabled:focus { 387 | color: rgb(51, 51, 51); 388 | } 389 | QComboBox::drop-down { 390 | width: 20px; 391 | border: none; 392 | background: transparent; 393 | } 394 | QComboBox::drop-down:hover { 395 | background: rgba(255, 255, 255, 30); 396 | } 397 | QComboBox::down-arrow { 398 | image: url(:/images/qss/White/arrowBottom); 399 | } 400 | QComboBox::down-arrow:on { 401 | /**top: 1px;**/ 402 | } 403 | QComboBox QAbstractItemView { 404 | border: 1px solid rgb(111, 156, 207); 405 | background: white; 406 | outline: none; 407 | } 408 | QComboBox QAbstractItemView::item { 409 | height: 25px; 410 | color: rgb(73, 73, 73); 411 | } 412 | QComboBox QAbstractItemView::item:selected { 413 | background: rgb(232, 241, 250); 414 | color: rgb(2, 65, 132); 415 | } 416 | 417 | /**********进度条**********/ 418 | QProgressBar{ 419 | border: none; 420 | text-align: center; 421 | color: white; 422 | background: rgb(173, 202, 232); 423 | } 424 | QProgressBar::chunk { 425 | background: rgb(16, 135, 209); 426 | } 427 | 428 | QProgressBar#progressBar { 429 | border: none; 430 | text-align: center; 431 | color: white; 432 | background-color: transparent; 433 | background-image: url(":/images/qss/White/progressBar"); 434 | background-repeat: repeat-x; 435 | } 436 | QProgressBar#progressBar::chunk { 437 | border: none; 438 | background-color: transparent; 439 | background-image: url(":/images/qss/White/progressBarChunk"); 440 | background-repeat: repeat-x; 441 | } 442 | 443 | /**********复选框**********/ 444 | QCheckBox{ 445 | spacing: 5px; 446 | } 447 | QCheckBox:enabled:checked{ 448 | color: rgb(2, 65, 132); 449 | } 450 | QCheckBox:enabled:!checked{ 451 | color: rgb(70, 71, 73); 452 | } 453 | QCheckBox:enabled:hover{ 454 | color: rgb(0, 78, 161); 455 | } 456 | QCheckBox:!enabled{ 457 | color: rgb(80, 80, 80); 458 | } 459 | QCheckBox::indicator { 460 | width: 20px; 461 | height: 20px; 462 | } 463 | QCheckBox::indicator:unchecked { 464 | image: url(:/images/qss/White/checkBox); 465 | } 466 | QCheckBox::indicator:unchecked:hover { 467 | image: url(:/images/qss/White/checkBoxHover); 468 | } 469 | QCheckBox::indicator:unchecked:pressed { 470 | image: url(:/images/qss/White/checkBoxPressed); 471 | } 472 | QCheckBox::indicator:checked { 473 | image: url(:/images/qss/White/checkBoxChecked); 474 | } 475 | QCheckBox::indicator:checked:hover { 476 | image: url(:/images/qss/White/checkBoxCheckedHover); 477 | } 478 | QCheckBox::indicator:checked:pressed { 479 | image: url(:/images/qss/White/checkBoxCheckedPressed); 480 | } 481 | QCheckBox::indicator:indeterminate { 482 | image: url(:/images/qss/White/checkBoxIndeterminate); 483 | } 484 | QCheckBox::indicator:indeterminate:hover { 485 | image: url(:/images/qss/White/checkBoxIndeterminateHover); 486 | } 487 | QCheckBox::indicator:indeterminate:pressed { 488 | image: url(:/images/qss/White/checkBoxIndeterminatePressed); 489 | } 490 | 491 | /**********单选框**********/ 492 | QRadioButton{ 493 | spacing: 5px; 494 | } 495 | QRadioButton:enabled:checked{ 496 | color: rgb(2, 65, 132); 497 | } 498 | QRadioButton:enabled:!checked{ 499 | color: rgb(70, 71, 73); 500 | } 501 | QRadioButton:enabled:hover{ 502 | color: rgb(0, 78, 161); 503 | } 504 | QRadioButton:!enabled{ 505 | color: rgb(80, 80, 80); 506 | } 507 | QRadioButton::indicator { 508 | width: 20px; 509 | height: 20px; 510 | } 511 | QRadioButton::indicator:unchecked { 512 | image: url(:/images/qss/White/radioButton); 513 | } 514 | QRadioButton::indicator:unchecked:hover { 515 | image: url(:/images/qss/White/radioButtonHover); 516 | } 517 | QRadioButton::indicator:unchecked:pressed { 518 | image: url(:/images/qss/White/radioButtonPressed); 519 | } 520 | QRadioButton::indicator:checked { 521 | image: url(:/images/qss/White/radioButtonChecked); 522 | } 523 | QRadioButton::indicator:checked:hover { 524 | image: url(:/images/qss/White/radioButtonCheckedHover); 525 | } 526 | QRadioButton::indicator:checked:pressed { 527 | image: url(:/images/qss/White/radioButtonCheckedPressed); 528 | } 529 | 530 | /**********输入框**********/ 531 | QLineEdit { 532 | border-radius: 4px; 533 | height: 25px; 534 | border: 1px solid rgb(111, 156, 207); 535 | background: white; 536 | } 537 | QLineEdit:enabled { 538 | color: rgb(84, 84, 84); 539 | } 540 | QLineEdit:enabled:hover, QLineEdit:enabled:focus { 541 | color: rgb(51, 51, 51); 542 | } 543 | QLineEdit:!enabled { 544 | color: rgb(80, 80, 80); 545 | } 546 | 547 | /**********文本编辑框**********/ 548 | QTextEdit { 549 | border: 1px solid rgb(111, 156, 207); 550 | color: rgb(70, 71, 73); 551 | background: rgb(187, 212, 238); 552 | } 553 | 554 | /**********滚动区域**********/ 555 | QScrollArea { 556 | border: 1px solid rgb(111, 156, 207); 557 | background: rgb(187, 212, 238); 558 | } 559 | 560 | /**********滚动区域**********/ 561 | QWidget#transparentWidget { 562 | background: transparent; 563 | } 564 | 565 | /**********微调器**********/ 566 | QSpinBox { 567 | border-radius: 4px; 568 | height: 24px; 569 | min-width: 40px; 570 | border: 1px solid rgb(111, 156, 207); 571 | background: white; 572 | } 573 | QSpinBox:enabled { 574 | color: rgb(60, 60, 60); 575 | } 576 | QSpinBox:enabled:hover, QSpinBox:enabled:focus { 577 | color: rgb(51, 51, 51); 578 | } 579 | QSpinBox:!enabled { 580 | color: rgb(210, 210, 210); 581 | background: transparent; 582 | } 583 | QSpinBox::up-button { 584 | border-left: 1px solid rgb(111, 156, 207); 585 | width: 18px; 586 | height: 12px; 587 | border-top-right-radius: 4px; 588 | image: url(:/images/qss/White/upButton); 589 | } 590 | QSpinBox::up-button:!enabled { 591 | background: transparent; 592 | } 593 | QSpinBox::up-button:enabled:hover { 594 | background: rgb(255, 255, 255, 30); 595 | } 596 | QSpinBox::down-button { 597 | border-left: 1px solid rgb(111, 156, 207); 598 | width: 18px; 599 | height: 12px; 600 | border-bottom-right-radius: 4px; 601 | image: url(:/images/qss/White/downButton); 602 | } 603 | QSpinBox::down-button:!enabled { 604 | background: transparent; 605 | } 606 | QSpinBox::down-button:hover { 607 | background: rgb(255, 255, 255, 30); 608 | } 609 | 610 | /**********标签**********/ 611 | QLabel#grayLabel { 612 | color: rgb(70, 71, 73); 613 | } 614 | 615 | QLabel#highlightLabel { 616 | color: rgb(2, 65, 132); 617 | } 618 | 619 | QLabel#redLabel { 620 | color: red; 621 | } 622 | 623 | QLabel#grayYaHeiLabel { 624 | color: rgb(175, 175, 175); 625 | font-size: 16px; 626 | } 627 | 628 | QLabel#blueLabel { 629 | color: rgb(0, 160, 230); 630 | } 631 | 632 | QLabel#listLabel { 633 | color: rgb(51, 51, 51); 634 | } 635 | 636 | QLabel#lineBlueLabel { 637 | background: rgb(0, 78, 161); 638 | } 639 | 640 | QLabel#graySeperateLabel { 641 | background: rgb(200, 220, 230); 642 | } 643 | 644 | QLabel#seperateLabel { 645 | background: rgb(112, 153, 194); 646 | } 647 | 648 | QLabel#radiusBlueLabel { 649 | border-radius: 15px; 650 | color: white; 651 | font-size: 16px; 652 | background: rgb(0, 78, 161); 653 | } 654 | 655 | QLabel#skinLabel[colorProperty="normal"] { 656 | color: rgb(56, 99, 154); 657 | } 658 | QLabel#skinLabel[colorProperty="highlight"] { 659 | color: rgb(0, 160, 230); 660 | } 661 | 662 | QLabel#informationLabel { 663 | qproperty-pixmap: url(:/images/qss/White/information); 664 | } 665 | 666 | QLabel#errorLabel { 667 | qproperty-pixmap: url(:/images/qss/White/error); 668 | } 669 | 670 | QLabel#successLabel { 671 | qproperty-pixmap: url(:/images/qss/White/success); 672 | } 673 | 674 | QLabel#questionLabel { 675 | qproperty-pixmap: url(:/images/qss/White/question); 676 | } 677 | 678 | QLabel#warningLabel { 679 | qproperty-pixmap: url(:/images/qss/White/warning); 680 | } 681 | 682 | QLabel#groupLabel { 683 | color: rgb(56, 99, 154); 684 | border: 1px solid rgb(111, 156, 207); 685 | font-size: 15px; 686 | border-top-color: transparent; 687 | border-right-color: transparent; 688 | border-left-color: transparent; 689 | } 690 | 691 | /**********按钮**********/ 692 | QToolButton#nsccButton { 693 | border: none; 694 | color: rgb(2, 65, 132); 695 | background: transparent; 696 | padding: 10px; 697 | qproperty-icon: url(:/images/qss/White/nscc); 698 | qproperty-iconSize: 32px 32px; 699 | qproperty-toolButtonStyle: ToolButtonTextUnderIcon; 700 | } 701 | QToolButton#nsccButton:hover { 702 | background: rgb(187, 212, 238); 703 | } 704 | 705 | QToolButton#transferButton { 706 | border: none; 707 | color: rgb(2, 65, 132); 708 | background: transparent; 709 | padding: 10px; 710 | qproperty-icon: url(:/images/qss/White/transfer); 711 | qproperty-iconSize: 32px 32px; 712 | qproperty-toolButtonStyle: ToolButtonTextUnderIcon; 713 | } 714 | QToolButton#transferButton:hover { 715 | background: rgb(187, 212, 238); 716 | } 717 | 718 | /**********按钮**********/ 719 | QPushButton{ 720 | border-radius: 4px; 721 | border: none; 722 | width: 75px; 723 | height: 25px; 724 | } 725 | QPushButton:enabled { 726 | background: rgb(120, 170, 220); 727 | color: white; 728 | } 729 | QPushButton:!enabled { 730 | background: rgb(180, 180, 180); 731 | color: white; 732 | } 733 | QPushButton:enabled:hover{ 734 | background: rgb(100, 160, 220); 735 | } 736 | QPushButton:enabled:pressed{ 737 | background: rgb(0, 78, 161); 738 | } 739 | 740 | QPushButton#blueButton { 741 | color: white; 742 | } 743 | QPushButton#blueButton:enabled { 744 | background: rgb(0, 78, 161); 745 | color: white; 746 | } 747 | QPushButton:!enabled { 748 | background: rgb(180, 180, 180); 749 | color: white; 750 | } 751 | QPushButton#blueButton:enabled:hover { 752 | background: rgb(2, 65, 132); 753 | } 754 | QPushButton#blueButton:enabled:pressed { 755 | background: rgb(6, 94, 187); 756 | } 757 | 758 | QPushButton#selectButton { 759 | border: none; 760 | border-radius: none; 761 | border-left: 1px solid rgb(111, 156, 207); 762 | background: transparent; 763 | image: url(:/images/qss/White/scan); 764 | color: rgb(51, 51, 51); 765 | } 766 | QPushButton#selectButton:enabled:hover{ 767 | background: rgb(187, 212, 238); 768 | } 769 | QPushButton#selectButton:enabled:pressed{ 770 | background: rgb(120, 170, 220); 771 | } 772 | 773 | QPushButton#linkButton { 774 | background: transparent; 775 | color: rgb(0, 160, 230); 776 | text-align:left; 777 | } 778 | QPushButton#linkButton:hover { 779 | color: rgb(20, 185, 255); 780 | text-decoration: underline; 781 | } 782 | QPushButton#linkButton:pressed { 783 | color: rgb(0, 160, 230); 784 | } 785 | 786 | QPushButton#transparentButton { 787 | background: transparent; 788 | } 789 | 790 | /*****************标题栏按钮*******************/ 791 | QPushButton#minimizeButton { 792 | border-radius: none; 793 | border-bottom-left-radius: 4px; 794 | border-bottom-right-radius: 4px; 795 | background: rgb(120, 170, 220); 796 | image: url(:/images/qss/White/minimizeHover); 797 | } 798 | QPushButton#minimizeButton:hover { 799 | image: url(:/images/qss/White/minimize); 800 | } 801 | QPushButton#minimizeButton:pressed { 802 | image: url(:/images/qss/White/minimizePressed); 803 | } 804 | 805 | QPushButton#maximizeButton[maximizeProperty="maximize"] { 806 | border-radius: none; 807 | border-bottom-left-radius: 4px; 808 | border-bottom-right-radius: 4px; 809 | background: rgb(120, 170, 220); 810 | image: url(:/images/qss/White/maximizeHover); 811 | } 812 | QPushButton#maximizeButton[maximizeProperty="maximize"]:hover { 813 | image: url(:/images/qss/White/maximize); 814 | } 815 | QPushButton#maximizeButton[maximizeProperty="maximize"]:pressed { 816 | image: url(:/images/qss/White/maximizePressed); 817 | } 818 | 819 | QPushButton#maximizeButton[maximizeProperty="restore"] { 820 | border-radius: none; 821 | border-bottom-left-radius: 4px; 822 | border-bottom-right-radius: 4px; 823 | background: rgb(120, 170, 220); 824 | image: url(:/images/qss/White/restoreHover); 825 | } 826 | QPushButton#maximizeButton[maximizeProperty="restore"]:hover { 827 | image: url(:/images/qss/White/restore); 828 | } 829 | QPushButton#maximizeButton[maximizeProperty="restore"]:pressed { 830 | image: url(:/images/qss/White/restorePressed); 831 | } 832 | 833 | QPushButton#closeButton { 834 | border-radius: none; 835 | border-bottom-left-radius: 4px; 836 | border-bottom-right-radius: 4px; 837 | background: rgb(120, 170, 220); 838 | image: url(:/images/qss/White/closeHover); 839 | } 840 | QPushButton#closeButton:hover { 841 | image: url(:/images/qss/White/close); 842 | } 843 | QPushButton#closeButton:pressed { 844 | image: url(:/images/qss/White/closePressed); 845 | } 846 | 847 | QPushButton#skinButton { 848 | border-radius: none; 849 | border-bottom-left-radius: 4px; 850 | border-bottom-right-radius: 4px; 851 | background: rgb(120, 170, 220); 852 | image: url(:/images/qss/White/skinHover); 853 | } 854 | QPushButton#skinButton:hover { 855 | image: url(:/images/qss/White/skin); 856 | } 857 | QPushButton#skinButton:pressed { 858 | image: url(:/images/qss/White/skinPressed); 859 | } 860 | 861 | QPushButton#feedbackButton { 862 | border-radius: none; 863 | border-bottom-left-radius: 4px; 864 | border-bottom-right-radius: 4px; 865 | background: rgb(120, 170, 220); 866 | image: url(:/images/qss/White/feedbackHover); 867 | } 868 | QPushButton#feedbackButton:hover { 869 | image: url(:/images/qss/White/feedback); 870 | } 871 | QPushButton#feedbackButton:pressed { 872 | image: url(:/images/qss/White/feedbackPressed); 873 | } 874 | 875 | QPushButton#closeTipButton { 876 | border-radius: none; 877 | border-image: url(:/images/qss/White/close); 878 | background: transparent; 879 | } 880 | QPushButton#closeTipButton:hover { 881 | border-image: url(:/images/qss/White/closeHover); 882 | } 883 | QPushButton#closeTipButton:pressed { 884 | border-image: url(:/images/qss/White/closePressed); 885 | } 886 | 887 | QPushButton#changeSkinButton{ 888 | border-radius: 4px; 889 | border: 2px solid rgb(111, 156, 207); 890 | background: rgb(204, 227, 252); 891 | } 892 | QPushButton#changeSkinButton:hover{ 893 | border-color: rgb(60, 150, 200); 894 | } 895 | QPushButton#changeSkinButton:pressed, QPushButton#changeSkinButton:checked{ 896 | border-color: rgb(0, 160, 230); 897 | } 898 | 899 | QPushButton#transferButton { 900 | padding-left: 5px; 901 | padding-right: 5px; 902 | color: white; 903 | background: rgb(0, 78, 161); 904 | } 905 | QPushButton#transferButton:hover { 906 | background: rgb(2, 65, 132); 907 | } 908 | QPushButton#transferButton:pressed { 909 | background: rgb(6, 94, 187); 910 | } 911 | QPushButton#transferButton[iconProperty="left"] { 912 | qproperty-icon: url(:/images/qss/White/left); 913 | } 914 | QPushButton#transferButton[iconProperty="right"] { 915 | qproperty-icon: url(:/images/qss/White/right); 916 | } 917 | 918 | QPushButton#openButton { 919 | border-radius: none; 920 | image: url(:/images/qss/White/open); 921 | background: transparent; 922 | } 923 | QPushButton#openButton:hover { 924 | image: url(:/images/qss/White/openHover); 925 | } 926 | QPushButton#openButton:pressed { 927 | image: url(:/images/qss/White/openPressed); 928 | } 929 | 930 | QPushButton#deleteButton { 931 | border-radius: none; 932 | image: url(:/images/qss/White/delete); 933 | background: transparent; 934 | } 935 | QPushButton#deleteButton:hover { 936 | image: url(:/images/qss/White/deleteHover); 937 | } 938 | QPushButton#deleteButton:pressed { 939 | image: url(:/images/qss/White/deletePressed); 940 | } 941 | 942 | QPushButton#menuButton { 943 | text-align: left center; 944 | padding-left: 3px; 945 | color: rgb(84, 84, 84); 946 | border: 1px solid rgb(111, 156, 207); 947 | background: white; 948 | } 949 | QPushButton#menuButton::menu-indicator{ 950 | subcontrol-position: right center; 951 | subcontrol-origin: padding; 952 | image: url(:/images/qss/White/arrowBottom); 953 | padding-right: 3px; 954 | } 955 | --------------------------------------------------------------------------------