├── .DS_Store ├── .gitignore ├── 001 - Qt 简介 ├── .DS_Store └── 001_Qt_First │ ├── .gitignore │ ├── 001_Qt_First.pro │ ├── main.cpp │ ├── mybutton.cpp │ ├── mybutton.h │ ├── widget.cpp │ └── widget.h ├── 002 - 自定义信号和槽 └── 002_Signals_and_Slot │ ├── .gitignore │ ├── 002_Signals_and_Slot.pro │ ├── main.cpp │ ├── student.cpp │ ├── student.h │ ├── teacher.cpp │ ├── teacher.h │ ├── widget.cpp │ └── widget.h ├── 005 - lambda 表达式 └── 005_lambda │ ├── .gitignore │ ├── 005_lambda.pro │ ├── main.cpp │ ├── student.cpp │ ├── student.h │ ├── teacher.cpp │ ├── teacher.h │ ├── widget.cpp │ └── widget.h ├── 006_QMainWindow ├── .gitignore ├── 006_QMainWindow.pro ├── main.cpp ├── mainwindow.cpp └── mainwindow.h ├── 007_Qt_Source_File ├── .gitignore ├── 007_Qt_Source_File.pro ├── Picture │ ├── nekosilverfox.png │ └── nekosilverfox_bk.jpg ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui └── resource.qrc ├── 008_QDialog ├── .gitignore ├── 008_QDialog.pro ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h └── mainwindow.ui ├── 010_Layout ├── .gitignore ├── 010_Layout.pro ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── 011_Control_Buttons ├── .gitignore ├── 011_Control_Buttons.pro ├── lava.jpg ├── main.cpp ├── nekosilverfox.png ├── res.qrc ├── widget.cpp ├── widget.h └── widget.ui ├── 013_Control_Item_Widgets ├── .gitignore ├── 013_Control_Item_Widgets.pro ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── 014_Control_Other ├── .gitignore ├── 014_Control_Other.pro ├── main.cpp ├── nekosilverfox.png ├── res.qrc ├── widget.cpp ├── widget.h ├── widget.ui └── 舔屏.gif ├── 020_MyWidget ├── .gitignore ├── 020_MyWidget.pro ├── main.cpp ├── mywidget.cpp ├── mywidget.h ├── mywidget.ui ├── widget.cpp ├── widget.h └── widget.ui ├── 025_Qt_Event ├── .gitignore ├── 025_Qt_Event.pro ├── main.cpp ├── mylabel.cpp ├── mylabel.h ├── widget.cpp ├── widget.h └── widget.ui ├── 030_QPainter ├── .gitignore ├── 030_QPainter.pro ├── main.cpp ├── nekosilverfox.png ├── res.qrc ├── widget.cpp ├── widget.h └── widget.ui ├── 031_QPainterDevice ├── .gitignore ├── 031_QPainterDevice.pro ├── main.cpp ├── nekosilverfox.png ├── pic.command ├── res.qrc ├── res_pix.png ├── widget.cpp ├── widget.h └── widget.ui ├── 032_Change_SVG_Color ├── .gitignore ├── 032_Change_SVG_Color.pro ├── main.cpp ├── resource.qrc ├── unlock.svg ├── widget.cpp ├── widget.h └── widget.ui ├── 040_QFile ├── .gitignore ├── 040_QFile.pro ├── main.cpp ├── widget.cpp ├── widget.h ├── widget.ui ├── 长恨歌_gbk.txt └── 长恨歌_utf-8.txt ├── 042_Json_read_write ├── .gitignore ├── 042_Json_read_write.pro ├── input.json ├── main.cpp ├── output.json ├── widget.cpp ├── widget.h └── widget.ui ├── 045_UDP_Demo ├── .gitignore ├── 045_UDP_Demo.pro ├── main.cpp ├── udp_2.cpp ├── udp_2.h ├── udp_2.ui ├── upd_1.cpp ├── upd_1.h └── upd_1.ui ├── 047_QTcpFile ├── .DS_Store ├── QTcpFile.pro ├── main.cpp ├── tcpclientwidget.cpp ├── tcpclientwidget.h ├── tcpclientwidget.ui ├── tcpserverwidget.cpp ├── tcpserverwidget.h ├── tcpserverwidget.ui └── test.cpp ├── 050_MySelfQQ ├── .gitignore ├── 050_MySelfQQ.pro ├── dialoglist.cpp ├── dialoglist.h ├── dialoglist.ui ├── main.cpp ├── nekosilverfox.png ├── res.qrc ├── user-group.png ├── widget.cpp ├── widget.h └── widget.ui ├── 055_Http ├── .gitignore ├── 055_Http.pro ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── 060_QTestlib ├── 060_QTestlib.pro ├── App │ ├── App.pro │ ├── main.cpp │ ├── widget.cpp │ ├── widget.h │ └── widget.ui └── Tester │ ├── Tester.pro │ └── tst_widgettester.cpp ├── 061_Use_Java_jar_in_Qt ├── .gitignore ├── 061_Use_Java_jar_in_Qt.pro ├── main.cpp ├── openstego.jar ├── secret.txt ├── widget.cpp ├── widget.h └── widget.ui ├── 062_Use_Python_in_Qt ├── .gitignore ├── 062_Use_Python_in_Qt.pro ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h └── mainwindow.ui ├── 070_QChartView_2D_Plot ├── .gitignore ├── 070_QChartView_2D_Plot.pro ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── 080_QThread ├── .gitignore ├── 080_QThread.pro ├── main.cpp ├── widget.cpp ├── widget.h ├── widget.ui ├── work.cpp └── work.h ├── 65_QtLogging ├── .gitignore ├── 65_QtLogging.pro ├── log ├── logger.cpp ├── logger.h ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── LICENSE ├── README.md └── doc ├── .$json.drawio.bkp ├── .DS_Store ├── QMainWindow.drawio ├── img ├── .DS_Store ├── 09784656-31f1-4aba-ac38-30ec71d92381.png ├── 24e43539-b0f8-4f91-b5c3-c8aa3d37d739.png ├── 34dfc396-25d4-4aa6-b3fc-86b3cc1dbe5a.png ├── 3f2ff1ec-225f-482f-8382-324c193748a7-1311573.png ├── 8ed42c6f-df0f-459f-a29d-692cd7a0cd04-1311573.png ├── d3f1e4f8-b7c8-4c9a-8f54-43b435d9bc13.png ├── d98f4e88-7fdd-470a-89d5-4f7efac2936a.png ├── e51742a2-963d-43e8-af70-6629c893ad24.png ├── f6fdb606-c539-4b68-8da2-9c6ba6d3c615.png ├── iShot_2024-04-03_11.45.14.jpg ├── iShot_2024-11-24_20.20.56.jpg ├── image-20221203140013717.png ├── image-20221203140151611.png ├── image-20221203140946678.png ├── image-20221203141237375.png ├── image-20221203141501241.png ├── image-20221203141508675.png ├── image-20221203144419409.png ├── image-20221203150537882.png ├── image-20240325000503738.png ├── image-20240325002753950.png ├── image-20240325003017933.png ├── image-20240325003038151.png ├── image-20240325003522709.png ├── image-20240325183354563.png ├── image-20240325183411935.png ├── image-20240325235139974.png ├── image-20240326001341260.png ├── image-20240326001614035.png ├── image-20240326195248614.png ├── image-20240326195253843.png ├── image-20240326195259488.png ├── image-20240326195309350.png ├── image-20240326195926664.png ├── image-20240326195931201.png ├── image-20240326202432553.png ├── image-20240326203518643.png ├── image-20240326204108957.png ├── image-20240326211851885.png ├── image-20240326213453534.png ├── image-20240329131140453.png ├── image-20240329145518924.png ├── image-20240329145624474.png ├── image-20240329150735713.png ├── image-20240329151740284.png ├── image-20240329151946808.png ├── image-20240329152032547.png ├── image-20240329152148484.png ├── image-20240329153805644.png ├── image-20240329154136420.png ├── image-20240329154244880.png ├── image-20240329154450058.png ├── image-20240329154656762.png ├── image-20240329154757499.png ├── image-20240329154940810.png ├── image-20240401001433537.png ├── image-20240401001602055.png ├── image-20240401001808089.png ├── image-20240401003902104.png ├── image-20240401004435488.png ├── image-20240401230524193.png ├── image-20240405152509022.png ├── image-20240405165500501.png ├── image-20240405213532227.png ├── image-20240405214901715.png ├── image-20240405221205641.png ├── image-20240405221338549.png ├── image-20240405222211747.png ├── image-20240405222533302.png ├── image-20240405224122531.png ├── image-20240405232202230.png ├── image-20240409172336330.png ├── image-20240409172608576.png ├── image-20240409173503236.png ├── image-20240409221830554.png ├── image-20240409231412665.png ├── image-20240426150510970.png ├── image-20240426154344765.png ├── image-20240428183403225.png ├── image-20240925125502545.png ├── image-20241124190143627.png ├── image-20250608131126360.png ├── image-20250609133027146.png ├── image-20250609133222368.png └── image-20250609133435501.png ├── json.drawio └── pic ├── .DS_Store └── README ├── image-20221018121725084.png ├── image-20221018125125119.png ├── image-20221018130933834.png ├── image-20221018160534346.png ├── image-20221018162054408.png ├── image-20221018170737986.png ├── image-20221018170902491.png ├── image-20221018171003019.png ├── image-20221018171522579.png ├── image-20221018171651888.png ├── image-20221018171743063.png ├── image-20221018172146656.png ├── image-20221018172310863.png ├── image-20221018172452507.png ├── image-20221018173232309.png ├── image-20221018173318599.png ├── image-20221128225157690.png ├── image-20221128225354793.png ├── image-20221128225405311.png ├── image-20221128225428076.png ├── image-20221128225434576.png ├── image-20221130145334893.png ├── image-20221130161212231.png ├── image-20221130161456003.png ├── image-20221130161827092.png ├── image-20221130162043745.png ├── image-20221130162353685.png ├── image-20221130163634192.png ├── image-20221130164311887.png ├── image-20221130164629710.png ├── image-20221130164712179.png ├── image-20221130165040902.png ├── image-20221130165149890.png ├── image-20221130165204798.png ├── image-20221130165733293.png ├── image-20221130165745758.png ├── image-20221130230942923.png ├── image-20221130233207709.png ├── image-20221201110928964.png ├── image-20221201111710072.png ├── image-20221201111917031.png ├── image-20221201181634343.png ├── image-20221201181640740.png ├── image-20221201182133168.png ├── image-20221201203516994.png ├── image-20221203135812710.png ├── image-20221203140013717.png ├── image-20221203140110110.png ├── image-20221203140151611.png ├── image-20221203140743369.png ├── image-20221203140946678.png ├── image-20221203141237375.png ├── image-20221203141501241.png ├── image-20221203141508675.png ├── image-20221203141650280.png ├── image-20221203142009053.png ├── image-20221203144032185.png ├── image-20221203144419409.png ├── image-20221203144554453.png ├── image-20221203145348848.png ├── image-20221203145456249.png ├── image-20221203145525829.png ├── image-20221203145607802.png ├── image-20221203145609404.png ├── image-20221203145713706.png ├── image-20221203145826876.png ├── image-20221203145938500.png ├── image-20221203145956363.png ├── image-20221203150006693.png ├── image-20221203150113188.png ├── image-20221203150537882.png ├── image-20221203150611547.png ├── image-20221203150842960.png ├── image-20221203150856557.png ├── image-20221203155115323.png ├── image-20221203155432229.png ├── image-20221203155956762.png ├── image-20221203161108507.png ├── image-20221203162325641.png ├── image-20221203163133452.png ├── image-20221203163227138.png ├── image-20221203163338502.png ├── image-20221203163942809.png ├── image-20221203164759843.png ├── image-20221203164845827.png ├── image-20221203165138558.png ├── image-20221203171535255.png ├── image-20221203234539079.png ├── image-20221204164809839.png ├── image-20221204171416935.png └── image-20221204182815217.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Qt-es 2 | object_script.*.Release 3 | object_script.*.Debug 4 | *_plugin_import.cpp 5 | /.qmake.cache 6 | /.qmake.stash 7 | *.pro.user 8 | *.pro.user.* 9 | *.qbs.user 10 | *.qbs.user.* 11 | *.moc 12 | moc_*.cpp 13 | moc_*.h 14 | qrc_*.cpp 15 | ui_*.h 16 | *.qmlc 17 | *.jsc 18 | *build-* 19 | *.qm 20 | *.prl 21 | *build* 22 | -------------------------------------------------------------------------------- /001 - Qt 简介/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/001 - Qt 简介/.DS_Store -------------------------------------------------------------------------------- /001 - Qt 简介/001_Qt_First/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /001 - Qt 简介/001_Qt_First/001_Qt_First.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | mybutton.cpp \ 14 | widget.cpp 15 | 16 | HEADERS += \ 17 | mybutton.h \ 18 | widget.h 19 | 20 | # Default rules for deployment. 21 | qnx: target.path = /tmp/$${TARGET}/bin 22 | else: unix:!android: target.path = /opt/$${TARGET}/bin 23 | !isEmpty(target.path): INSTALLS += target 24 | -------------------------------------------------------------------------------- /001 - Qt 简介/001_Qt_First/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include // 包含头文件 - 应用程序 4 | 5 | /** 程序入口 6 | * @brief main 7 | * @param argc 命令行变量数量 8 | * @param argv 命令行变量数组 9 | * @return 10 | */ 11 | int main(int argc, char *argv[]) 12 | { 13 | QApplication a(argc, argv); // 应用程序对象 a,在 Qt 中有且仅有一个 14 | Widget w; // 窗口对象 15 | w.show(); // 弹出窗口,以新窗口的的方式弹出(窗口默认不会弹出) 16 | 17 | return a.exec(); // a.exec() 进入消息循环机制,避免程序一闪而过,类似死循环 18 | } 19 | -------------------------------------------------------------------------------- /001 - Qt 简介/001_Qt_First/mybutton.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "mybutton.h" 3 | 4 | MyButton::MyButton(QPushButton *parent) 5 | : QPushButton{parent} 6 | { 7 | 8 | } 9 | 10 | MyButton::~MyButton() 11 | { 12 | qDebug() << "MyButton 析构了"; 13 | } 14 | -------------------------------------------------------------------------------- /001 - Qt 简介/001_Qt_First/mybutton.h: -------------------------------------------------------------------------------- 1 | #ifndef MYBUTTON_H 2 | #define MYBUTTON_H 3 | 4 | #include 5 | #include 6 | 7 | class MyButton : public QPushButton 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit MyButton(QPushButton *parent = nullptr); 12 | ~MyButton(); 13 | 14 | signals: 15 | 16 | }; 17 | 18 | #endif // MYBUTTON_H 19 | -------------------------------------------------------------------------------- /001 - Qt 简介/001_Qt_First/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "mybutton.h" 3 | #include 4 | #include 5 | 6 | Widget::Widget(QWidget *parent) 7 | : QWidget(parent) // 将参数传给父类,让父类进行一个初始化 8 | { 9 | /*按钮*/ 10 | QPushButton* btn = new QPushButton; 11 | // btn->show(); // show 是顶层方式弹出,如果想在 Widget 窗口中显示,就需要依赖 Widget 窗口 12 | btn->setParent(this); // 设置按钮他爹 13 | btn->setText("冰糖雪狸"); // 设置文字,将 char* 隐式转换为 QString 14 | 15 | 16 | /*创建按钮的第 2 种方式*/ 17 | QPushButton* btn2 = new QPushButton("按钮 2", this); 18 | this->resize(600, 400); // 重置窗口大小 19 | btn2->move(50, 50); // 移动按钮 20 | btn2->resize(50, 50); // 改变按钮大小 21 | 22 | 23 | /*窗口*/ 24 | this->setWindowTitle("Qt第一个窗口"); // 窗口的标题 25 | this->setFixedSize(600, 400); // 设置固定窗口大小 26 | 27 | /* Qt 在一定程度上简化了内内存的回收机制(对象树),也就是有时候不需要手动 Delete */ 28 | MyButton* btn3 = new MyButton; 29 | btn3->setParent(this); 30 | btn3->setText("关闭窗口"); 31 | btn3->move(100, 50); 32 | 33 | /*使用信号和槽机制通过点击按钮关闭窗口 34 | 信号和槽: 35 | connect(信号的发送方, 信号的地址, 信号接收方, 动作-槽的地址) 36 | */ 37 | connect(btn3, &MyButton::clicked, // 其实是调用的父类的 QPushButton::clicked 38 | this, &Widget::close); 39 | 40 | 41 | } 42 | 43 | Widget::~Widget() 44 | { 45 | qDebug() << "Widget 析构了"; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /001 - Qt 简介/001_Qt_First/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class Widget : public QWidget // Widget窗口对象,继承于 QWidget 7 | { 8 | Q_OBJECT // Q_OBJECT 宏,写了这个宏就支持了 Qt 中的信号和槽机制 9 | 10 | public: 11 | Widget(QWidget *parent = nullptr); // 构造函数,默认参数 12 | ~Widget(); 13 | }; 14 | #endif // WIDGET_H 15 | -------------------------------------------------------------------------------- /002 - 自定义信号和槽/002_Signals_and_Slot/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /002 - 自定义信号和槽/002_Signals_and_Slot/002_Signals_and_Slot.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | student.cpp \ 14 | teacher.cpp \ 15 | widget.cpp 16 | 17 | HEADERS += \ 18 | student.h \ 19 | teacher.h \ 20 | widget.h 21 | 22 | # Default rules for deployment. 23 | qnx: target.path = /tmp/$${TARGET}/bin 24 | else: unix:!android: target.path = /opt/$${TARGET}/bin 25 | !isEmpty(target.path): INSTALLS += target 26 | -------------------------------------------------------------------------------- /002 - 自定义信号和槽/002_Signals_and_Slot/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /002 - 自定义信号和槽/002_Signals_and_Slot/student.cpp: -------------------------------------------------------------------------------- 1 | #include "student.h" 2 | #include 3 | 4 | Student::Student(QObject *parent) 5 | : QObject{parent} 6 | { 7 | 8 | } 9 | 10 | void Student::treat() 11 | { 12 | qDebug() << "学生请老师吃饭了"; 13 | } 14 | 15 | void Student::treat(QString food_name) 16 | { 17 | // 【重点】将 QString 先转 utf8 (QByteArray),再转成 char* 18 | qDebug() << "学生请老师吃" << food_name.toUtf8().data(); 19 | } 20 | -------------------------------------------------------------------------------- /002 - 自定义信号和槽/002_Signals_and_Slot/student.h: -------------------------------------------------------------------------------- 1 | #ifndef STUDENT_H 2 | #define STUDENT_H 3 | 4 | #include 5 | 6 | class Student : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit Student(QObject *parent = nullptr); 11 | 12 | signals: 13 | 14 | public slots: 15 | /** 【重点】 16 | * 槽函数可以写在 `public slots` 之下,也可以写在 `public` 之下(仅限于高版本) 17 | * 槽函数的返回值类型为 void 18 | * 槽函数必须声明 + 实现 19 | * 参函数可以有参数,可以重载 20 | * 21 | */ 22 | void treat(); // 请客 23 | 24 | /* 重载 */ 25 | void treat(QString food_name); 26 | 27 | }; 28 | 29 | #endif // STUDENT_H 30 | -------------------------------------------------------------------------------- /002 - 自定义信号和槽/002_Signals_and_Slot/teacher.cpp: -------------------------------------------------------------------------------- 1 | #include "teacher.h" 2 | 3 | Teacher::Teacher(QObject *parent) 4 | : QObject{parent} 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /002 - 自定义信号和槽/002_Signals_and_Slot/teacher.h: -------------------------------------------------------------------------------- 1 | #ifndef TEACHER_H 2 | #define TEACHER_H 3 | 4 | #include 5 | 6 | class Teacher : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit Teacher(QObject *parent = nullptr); 11 | 12 | signals: 13 | /** 【重点】 14 | * 自定义的信号必须写在 signals 之下 15 | * 返回值的类型必须为 void 16 | * 信号只需要声明,不需要实现 17 | * 信号可以有参数,可以重载 18 | */ 19 | void hungry(); 20 | 21 | /* 重载 */ 22 | void hungry(QString food_name); 23 | 24 | 25 | }; 26 | 27 | #endif // TEACHER_H 28 | -------------------------------------------------------------------------------- /002 - 自定义信号和槽/002_Signals_and_Slot/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include "student.h" 6 | #include "teacher.h" 7 | 8 | class Widget : public QWidget 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Widget(QWidget *parent = nullptr); 14 | void classOver(); // 下课 —— 用于触发信号和槽 15 | ~Widget(); 16 | 17 | /* 之所以将对象在这里创建,是为了让 Widget 全局都可以访问到(作用域) */ 18 | Student* student; 19 | Teacher* teacher; 20 | 21 | 22 | /* 测试键盘响应事件 */ 23 | void keyPressEvent(QKeyEvent* event); 24 | }; 25 | #endif // WIDGET_H 26 | -------------------------------------------------------------------------------- /005 - lambda 表达式/005_lambda/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /005 - lambda 表达式/005_lambda/005_lambda.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | student.cpp \ 14 | teacher.cpp \ 15 | widget.cpp 16 | 17 | HEADERS += \ 18 | student.h \ 19 | teacher.h \ 20 | widget.h 21 | 22 | # Default rules for deployment. 23 | qnx: target.path = /tmp/$${TARGET}/bin 24 | else: unix:!android: target.path = /opt/$${TARGET}/bin 25 | !isEmpty(target.path): INSTALLS += target 26 | -------------------------------------------------------------------------------- /005 - lambda 表达式/005_lambda/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /005 - lambda 表达式/005_lambda/student.cpp: -------------------------------------------------------------------------------- 1 | #include "student.h" 2 | #include 3 | 4 | Student::Student(QObject *parent) 5 | : QObject{parent} 6 | { 7 | 8 | } 9 | 10 | void Student::treat() 11 | { 12 | qDebug() << "学生请老师吃饭了"; 13 | } 14 | 15 | void Student::treat(QString food_name) 16 | { 17 | // 【重点】将 QString 先转 utf8 (QByteArray),再转成 char* 18 | qDebug() << "学生请老师吃" << food_name.toUtf8().data(); 19 | } 20 | -------------------------------------------------------------------------------- /005 - lambda 表达式/005_lambda/student.h: -------------------------------------------------------------------------------- 1 | #ifndef STUDENT_H 2 | #define STUDENT_H 3 | 4 | #include 5 | 6 | class Student : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit Student(QObject *parent = nullptr); 11 | 12 | signals: 13 | 14 | public slots: 15 | /** 【重点】 16 | * 槽函数可以写在 `public slots` 之下,也可以写在 `public` 之下(仅限于高版本) 17 | * 槽函数的返回值类型为 void 18 | * 槽函数必须声明 + 实现 19 | * 参函数可以有参数,可以重载 20 | * 21 | */ 22 | void treat(); // 请客 23 | 24 | /* 重载 */ 25 | void treat(QString food_name); 26 | 27 | }; 28 | 29 | #endif // STUDENT_H 30 | -------------------------------------------------------------------------------- /005 - lambda 表达式/005_lambda/teacher.cpp: -------------------------------------------------------------------------------- 1 | #include "teacher.h" 2 | 3 | Teacher::Teacher(QObject *parent) 4 | : QObject{parent} 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /005 - lambda 表达式/005_lambda/teacher.h: -------------------------------------------------------------------------------- 1 | #ifndef TEACHER_H 2 | #define TEACHER_H 3 | 4 | #include 5 | 6 | class Teacher : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit Teacher(QObject *parent = nullptr); 11 | 12 | signals: 13 | /** 【重点】 14 | * 自定义的信号必须写在 signals 之下 15 | * 返回值的类型必须为 void 16 | * 信号只需要声明,不需要实现 17 | * 信号可以有参数,可以重载 18 | */ 19 | void hungry(); 20 | 21 | /* 重载 */ 22 | void hungry(QString food_name); 23 | 24 | 25 | }; 26 | 27 | #endif // TEACHER_H 28 | -------------------------------------------------------------------------------- /005 - lambda 表达式/005_lambda/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include "student.h" 6 | #include "teacher.h" 7 | 8 | 9 | class Widget : public QWidget 10 | { 11 | Q_OBJECT 12 | 13 | public: 14 | Widget(QWidget *parent = nullptr); 15 | void classOver(); // 下课 —— 用于触发信号和槽 16 | ~Widget(); 17 | 18 | /* 之所以将对象在这里创建,是为了让 Widght 全局都可以访问到(作用域) */ 19 | Student* student; 20 | Teacher* teacher; 21 | }; 22 | #endif // WIDGET_H 23 | -------------------------------------------------------------------------------- /006_QMainWindow/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /006_QMainWindow/006_QMainWindow.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | mainwindow.cpp 14 | 15 | HEADERS += \ 16 | mainwindow.h 17 | 18 | # Default rules for deployment. 19 | qnx: target.path = /tmp/$${TARGET}/bin 20 | else: unix:!android: target.path = /opt/$${TARGET}/bin 21 | !isEmpty(target.path): INSTALLS += target 22 | -------------------------------------------------------------------------------- /006_QMainWindow/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | MainWindow w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /006_QMainWindow/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | MainWindow::MainWindow(QWidget *parent) 11 | : QMainWindow(parent) 12 | { 13 | this->resize(600, 400); 14 | 15 | /* 菜单栏 */ 16 | QMenuBar* menuBar = this->menuBar(); // 菜单栏只能有一个 17 | this->setMenuBar(menuBar); // 将菜单栏放入到窗口中 18 | 19 | /* 菜单 */ 20 | QMenu* menuFile = menuBar->addMenu("文件"); // 创建菜单 21 | QMenu* menuEdit = menuBar->addMenu("编辑"); 22 | 23 | /* 菜单项 */ 24 | QAction* actionNewFile = menuFile->addAction("新建文件"); // 添加菜单项 25 | menuFile->addSeparator(); // 添加分隔线 26 | QAction* actionOpenFile = menuFile->addAction("打开文件"); 27 | 28 | 29 | 30 | 31 | /* 工具栏 - 可以有多个 */ 32 | QToolBar* toolBar = new QToolBar(this); // 1. 创建一个工具栏 33 | this->addToolBar(Qt::LeftToolBarArea, toolBar); // 2. 添加工具栏到当前窗口,并且设置默认停靠位置为左侧 34 | 35 | toolBar->addAction(actionNewFile); // 3. 为工具栏添加项 36 | toolBar->addSeparator(); // 添加分隔线 37 | toolBar->addAction(actionOpenFile); 38 | 39 | toolBar->setAllowedAreas(Qt::LeftToolBarArea | Qt::BottomToolBarArea); // (可选)设置工具栏允许的停靠位置 40 | toolBar->setMovable(true); // 【总开关】开启或者关闭工具栏的可【移动性】 41 | toolBar->setFloatable(false); // 设置可【浮动性】为否 42 | 43 | 44 | 45 | 46 | /* 状态栏 - 只能有一个 */ 47 | QStatusBar* statusBar = this->statusBar(); 48 | this->setStatusBar(statusBar); 49 | 50 | QLabel* label_1 = new QLabel("左侧 Label", this); // 创建一个 Label,【复习】后面的 this 表示将这个 label 添加到对象树中 51 | statusBar->addWidget(label_1); // 添加在状态栏左侧 52 | 53 | QLabel* label_2 = new QLabel("右侧 Label", this); 54 | statusBar->addPermanentWidget(label_2); // 添加在状态栏右侧; 55 | 56 | 57 | 58 | 59 | /* 铆接部件 - 可以有多个 */ 60 | QDockWidget* dock = new QDockWidget(this); 61 | this->addDockWidget(Qt::RightDockWidgetArea, dock); // 添加到窗口,并设置默认停靠位置,【重点】这个位置是相对于核心部件的 62 | dock->setAllowedAreas(Qt::RightDockWidgetArea); 63 | 64 | 65 | 66 | 67 | /* 核心部件 - 只能有一个, 这里的 QTextEdit 控件作为举例使用 */ 68 | QTextEdit* textEdit = new QTextEdit(this); 69 | this->setCentralWidget(textEdit); // 【重点】将 TextEdit 设置为核心部件 70 | 71 | 72 | } 73 | 74 | 75 | 76 | 77 | MainWindow::~MainWindow() 78 | { 79 | } 80 | 81 | -------------------------------------------------------------------------------- /006_QMainWindow/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | class MainWindow : public QMainWindow 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | MainWindow(QWidget *parent = nullptr); 12 | ~MainWindow(); 13 | }; 14 | #endif // MAINWINDOW_H 15 | -------------------------------------------------------------------------------- /007_Qt_Source_File/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /007_Qt_Source_File/007_Qt_Source_File.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | mainwindow.cpp 14 | 15 | HEADERS += \ 16 | mainwindow.h 17 | 18 | FORMS += \ 19 | mainwindow.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | 26 | RESOURCES += \ 27 | resource.qrc 28 | -------------------------------------------------------------------------------- /007_Qt_Source_File/Picture/nekosilverfox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/007_Qt_Source_File/Picture/nekosilverfox.png -------------------------------------------------------------------------------- /007_Qt_Source_File/Picture/nekosilverfox_bk.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/007_Qt_Source_File/Picture/nekosilverfox_bk.jpg -------------------------------------------------------------------------------- /007_Qt_Source_File/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | MainWindow w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /007_Qt_Source_File/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | MainWindow::MainWindow(QWidget *parent) 5 | : QMainWindow(parent) 6 | , ui(new Ui::MainWindow) 7 | { 8 | ui->setupUi(this); 9 | 10 | ui->actionNewFile->setIcon(QIcon(":/fox_black_ground")); 11 | ui->actionEditFile->setIcon(QIcon(":/Picture/nekosilverfox.png")); 12 | } 13 | 14 | MainWindow::~MainWindow() 15 | { 16 | delete ui; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /007_Qt_Source_File/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class MainWindow; } 8 | QT_END_NAMESPACE 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | MainWindow(QWidget *parent = nullptr); 16 | ~MainWindow(); 17 | 18 | private: 19 | Ui::MainWindow *ui; 20 | }; 21 | #endif // MAINWINDOW_H 22 | -------------------------------------------------------------------------------- /007_Qt_Source_File/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 0 22 | 800 23 | 24 24 | 25 | 26 | 27 | 28 | 文件 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | toolBar 39 | 40 | 41 | TopToolBarArea 42 | 43 | 44 | false 45 | 46 | 47 | 48 | 49 | 50 | 51 | 新建文件 52 | 53 | 54 | 55 | 56 | 修改文件 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /007_Qt_Source_File/resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | Picture/nekosilverfox_bk.jpg 4 | Picture/nekosilverfox.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /008_QDialog/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /008_QDialog/008_QDialog.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | mainwindow.cpp 14 | 15 | HEADERS += \ 16 | mainwindow.h 17 | 18 | FORMS += \ 19 | mainwindow.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /008_QDialog/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | MainWindow w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /008_QDialog/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class MainWindow; } 8 | QT_END_NAMESPACE 9 | 10 | class MainWindow : public QMainWindow 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | MainWindow(QWidget *parent = nullptr); 16 | ~MainWindow(); 17 | 18 | private: 19 | Ui::MainWindow *ui; 20 | }; 21 | #endif // MAINWINDOW_H 22 | -------------------------------------------------------------------------------- /008_QDialog/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 665 10 | 446 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 0 22 | 665 23 | 24 24 | 25 | 26 | 27 | 28 | 29 | 30 | toolBar 31 | 32 | 33 | TopToolBarArea 34 | 35 | 36 | false 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 打开对话框 46 | 47 | 48 | 49 | 50 | Qt提供的消息框 51 | 52 | 53 | 54 | 55 | 选择颜色 56 | 57 | 58 | 59 | 60 | 打开文件 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /010_Layout/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /010_Layout/010_Layout.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /010_Layout/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /010_Layout/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | Widget::Widget(QWidget *parent) 5 | : QWidget(parent) 6 | , ui(new Ui::Widget) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | Widget::~Widget() 12 | { 13 | delete ui; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /010_Layout/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | #endif // WIDGET_H 22 | -------------------------------------------------------------------------------- /011_Control_Buttons/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /011_Control_Buttons/011_Control_Buttons.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | 26 | RESOURCES += \ 27 | res.qrc 28 | -------------------------------------------------------------------------------- /011_Control_Buttons/lava.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/011_Control_Buttons/lava.jpg -------------------------------------------------------------------------------- /011_Control_Buttons/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /011_Control_Buttons/nekosilverfox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/011_Control_Buttons/nekosilverfox.png -------------------------------------------------------------------------------- /011_Control_Buttons/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | lava.jpg 4 | nekosilverfox.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /011_Control_Buttons/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include 4 | 5 | Widget::Widget(QWidget *parent) 6 | : QWidget(parent) 7 | , ui(new Ui::Widget) 8 | { 9 | ui->setupUi(this); 10 | 11 | connect(ui->checkBox, &QCheckBox::stateChanged, 12 | this, [=](int state) {qDebug() << "QCheckBox state: " << state;}); 13 | } 14 | 15 | Widget::~Widget() 16 | { 17 | delete ui; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /011_Control_Buttons/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | #endif // WIDGET_H 22 | -------------------------------------------------------------------------------- /013_Control_Item_Widgets/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /013_Control_Item_Widgets/013_Control_Item_Widgets.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /013_Control_Item_Widgets/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /013_Control_Item_Widgets/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | #endif // WIDGET_H 22 | -------------------------------------------------------------------------------- /013_Control_Item_Widgets/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 817 10 | 493 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 30 20 | 30 21 | 256 22 | 192 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 30 | 280 31 | 256 32 | 192 33 | 34 | 35 | 36 | 37 | 1 38 | 39 | 40 | 41 | 42 | 43 | 44 | 330 45 | 30 46 | 291 47 | 441 48 | 49 | 50 | 51 | 52 | 53 | 54 | 650 55 | 140 56 | 124 57 | 192 58 | 59 | 60 | 61 | 62 | 63 | 64 | 添加霍金 65 | 66 | 67 | 68 | 69 | 70 | 71 | Qt::Vertical 72 | 73 | 74 | 75 | 100 76 | 100 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 删除霍金 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /014_Control_Other/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /014_Control_Other/014_Control_Other.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | 26 | RESOURCES += \ 27 | res.qrc 28 | -------------------------------------------------------------------------------- /014_Control_Other/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /014_Control_Other/nekosilverfox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/014_Control_Other/nekosilverfox.png -------------------------------------------------------------------------------- /014_Control_Other/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 舔屏.gif 4 | nekosilverfox.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /014_Control_Other/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include 4 | 5 | Widget::Widget(QWidget *parent) 6 | : QWidget(parent) 7 | , ui(new Ui::Widget) 8 | { 9 | ui->setupUi(this); 10 | 11 | /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Stacked Widget @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */ 12 | // 点击按钮 Stacked Widget 切换页 13 | connect(ui->btnScrollArea, &QPushButton::clicked, 14 | this, [=](){ui->stackedWidget->setCurrentIndex(0);}); // Scroll Area 15 | 16 | connect(ui->btnToolBox, &QPushButton::clicked, 17 | this, [=](){ui->stackedWidget->setCurrentIndex(1);}); // Tool Widget 18 | 19 | connect(ui->btnTabWidget, &QPushButton::clicked, 20 | this, [=](){ui->stackedWidget->setCurrentIndex(2);}); // Tab Widget 21 | 22 | // 设置默认选中第 0 项 23 | ui->stackedWidget->setCurrentIndex(0); 24 | 25 | 26 | /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Combo Box - 下拉框 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */ 27 | ui->comboBox->addItem("狐狸"); // 添加值 28 | ui->comboBox->addItem("狗子"); 29 | ui->comboBox->addItem("猫子"); 30 | 31 | // connect(ui->btnSelectCat, &QPushButton::clicked, 32 | // this, [=](){ui->comboBox->setCurrentIndex(2);}); // 通过按钮选择 33 | 34 | connect(ui->btnSelectCat, &QPushButton::clicked, 35 | this, [=](){ui->comboBox->setCurrentText("猫子");}); // 通过按钮选择 36 | 37 | 38 | /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Dial - 滚轮 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */ 39 | ui->dial->setMaximum(0); // 设置最小最大值 40 | ui->dial->setMaximum(365); 41 | connect(ui->dial, &QDial::valueChanged, 42 | this, [=](int value){ qDebug() << "Dial value: " << value;}); // 如果指针位置变化就输出数值 43 | 44 | /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Label - 显示图片 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ */ 45 | ui->labelPic->setPixmap(QPixmap(":/pic/nekosilverfox.png")); // 显示图片 46 | ui->labelPic->setScaledContents(true); // 设置自动缩放到可用空间 47 | 48 | // 显示动图 49 | QMovie* movie = new QMovie(":/pic/舔屏.gif"); 50 | ui->labelGif->setMovie(movie); 51 | ui->labelGif->setScaledContents(true); 52 | movie->start(); // 播放 53 | 54 | 55 | 56 | } 57 | 58 | Widget::~Widget() 59 | { 60 | delete ui; 61 | } 62 | 63 | -------------------------------------------------------------------------------- /014_Control_Other/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | #endif // WIDGET_H 22 | -------------------------------------------------------------------------------- /014_Control_Other/舔屏.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/014_Control_Other/舔屏.gif -------------------------------------------------------------------------------- /020_MyWidget/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /020_MyWidget/020_MyWidget.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | mywidget.cpp \ 14 | widget.cpp 15 | 16 | HEADERS += \ 17 | mywidget.h \ 18 | widget.h 19 | 20 | FORMS += \ 21 | mywidget.ui \ 22 | widget.ui 23 | 24 | # Default rules for deployment. 25 | qnx: target.path = /tmp/$${TARGET}/bin 26 | else: unix:!android: target.path = /opt/$${TARGET}/bin 27 | !isEmpty(target.path): INSTALLS += target 28 | -------------------------------------------------------------------------------- /020_MyWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /020_MyWidget/mywidget.cpp: -------------------------------------------------------------------------------- 1 | #include "mywidget.h" 2 | #include "ui_mywidget.h" 3 | 4 | MyWidget::MyWidget(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::MyWidget) 7 | { 8 | ui->setupUi(this); 9 | 10 | /* QSpinBox变化, Silder 移动 */ 11 | void(QSpinBox:: * mySpinBoxSignal)(int) = &QSpinBox::valueChanged; // 由于存在重载,所以要使用函数指针,避免调用不明确 12 | connect(ui->spinBox, mySpinBoxSignal, 13 | ui->horizontalSlider, &QSlider::setValue); 14 | 15 | /* Silder 移动,QSpinBox变化 */ 16 | connect(ui->horizontalSlider, &QSlider::valueChanged, 17 | ui->spinBox, &QSpinBox::setValue); 18 | 19 | } 20 | 21 | 22 | // 自定义接口 23 | void MyWidget::setValue(const int value) 24 | { 25 | ui->spinBox->setValue(value); 26 | } 27 | 28 | 29 | int MyWidget::getValue() 30 | { 31 | return ui->spinBox->value(); 32 | } 33 | 34 | MyWidget::~MyWidget() 35 | { 36 | delete ui; 37 | } 38 | -------------------------------------------------------------------------------- /020_MyWidget/mywidget.h: -------------------------------------------------------------------------------- 1 | #ifndef MYWIDGET_H 2 | #define MYWIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class MyWidget; 8 | } 9 | 10 | class MyWidget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit MyWidget(QWidget *parent = nullptr); 16 | ~MyWidget(); 17 | 18 | // 自定义接口 19 | void setValue(const int value); 20 | int getValue(); 21 | 22 | private: 23 | Ui::MyWidget *ui; 24 | }; 25 | 26 | #endif // MYWIDGET_H 27 | -------------------------------------------------------------------------------- /020_MyWidget/mywidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MyWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 230 10 | 49 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Qt::Horizontal 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /020_MyWidget/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | Widget::Widget(QWidget *parent) 5 | : QWidget(parent) 6 | , ui(new Ui::Widget) 7 | { 8 | ui->setupUi(this); 9 | 10 | // 调用自定义控件的自定义接口 11 | connect(ui->btnGetValue, &QPushButton::clicked, 12 | [=](){qDebug() << "值:" << ui->widget->getValue();}); //【重点】这里的 ui->widget 就是我们的自定义控件 13 | 14 | connect(ui->btnSetHalf, &QPushButton::clicked, 15 | [=](){ui->widget->setValue(50);}); 16 | } 17 | 18 | Widget::~Widget() 19 | { 20 | delete ui; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /020_MyWidget/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | #endif // WIDGET_H 22 | -------------------------------------------------------------------------------- /020_MyWidget/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 210 20 | 150 21 | 211 22 | 51 23 | 24 | 25 | 26 | 27 | 28 | 29 | 460 30 | 150 31 | 100 32 | 32 33 | 34 | 35 | 36 | 获取值 37 | 38 | 39 | 40 | 41 | 42 | 460 43 | 180 44 | 100 45 | 32 46 | 47 | 48 | 49 | 设置到一半 50 | 51 | 52 | 53 | 54 | 55 | MyWidget 56 | QWidget 57 |
mywidget.h
58 | 1 59 |
60 |
61 | 62 | 63 |
64 | -------------------------------------------------------------------------------- /025_Qt_Event/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /025_Qt_Event/025_Qt_Event.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | mylabel.cpp \ 14 | widget.cpp 15 | 16 | HEADERS += \ 17 | mylabel.h \ 18 | widget.h 19 | 20 | FORMS += \ 21 | widget.ui 22 | 23 | # Default rules for deployment. 24 | qnx: target.path = /tmp/$${TARGET}/bin 25 | else: unix:!android: target.path = /opt/$${TARGET}/bin 26 | !isEmpty(target.path): INSTALLS += target 27 | -------------------------------------------------------------------------------- /025_Qt_Event/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /025_Qt_Event/mylabel.cpp: -------------------------------------------------------------------------------- 1 | #include "mylabel.h" 2 | # include 3 | 4 | MyLabel::MyLabel(QWidget *parent) 5 | : QLabel{parent} 6 | { 7 | this->setMouseTracking(true); // 因为鼠标移动是一个连续的事件,而点击和释放是一个【瞬间】所以要实现鼠标不点击就跟踪,要开启这句 8 | } 9 | 10 | /* 重写虚函数:鼠标进入 */ 11 | void MyLabel::enterEvent(QEnterEvent*) 12 | { 13 | qDebug() << "鼠标进入"; 14 | } 15 | 16 | /* 重写虚函数:鼠标离开 */ 17 | void MyLabel::leaveEvent(QEvent*) 18 | { 19 | qDebug() << "鼠标离开"; 20 | } 21 | 22 | /* 重写虚函数:鼠标移动 */ 23 | void MyLabel::mouseMoveEvent(QMouseEvent *event) 24 | { 25 | if (event->buttons() & Qt::LeftButton) // 【重点】因为鼠标移动是一个连续事件,左移要用 buttonS 而不是 button 并且要用 `&` 进行判断 26 | qDebug() << "鼠标[按住左键]移动了 - " << QString("鼠标当前位置 x: %1, y: %2").arg(event->x()).arg(event->y()); 27 | 28 | qDebug() << "鼠标移动了 - " << QString("鼠标当前位置 x: %1, y: %2").arg(event->x()).arg(event->y()); 29 | } 30 | 31 | /* 重写虚函数:鼠标点击 */ 32 | void MyLabel::mousePressEvent(QMouseEvent *event) 33 | { 34 | if (event->button() == Qt::LeftButton) 35 | qDebug() << "鼠标[左键]点击了 - " << QString("鼠标当前位置 x: %1, y: %2").arg(event->x()).arg(event->y()); 36 | } 37 | 38 | /* 重写虚函数:鼠标释放 */ 39 | void MyLabel::mouseReleaseEvent(QMouseEvent *event) 40 | { 41 | qDebug() << "鼠标释放了 - " << QString("鼠标当前位置 x: %1, y: %2").arg(event->x()).arg(event->y()); 42 | } 43 | 44 | 45 | /* 事件拦截 (鼠标点击) */ 46 | bool MyLabel::event(QEvent* event) 47 | { 48 | /* 拦截鼠标[按下]事件,也就是不会调用上面写的函数了 */ 49 | if (event->type() == QEvent::MouseButtonPress) 50 | { 51 | QMouseEvent* mouseEv = static_cast(event); // 【复习】将父类转换为子类 52 | qDebug() << "Event::鼠标[按下]了 - " << QString("鼠标当前位置 x: %1, y: %2").arg(mouseEv->x()).arg(mouseEv->y()); 53 | return true; // 返回 true 代表拦截 54 | } 55 | 56 | return QLabel::event(event); // 其他事件,让父亲做默认处理 57 | } 58 | 59 | -------------------------------------------------------------------------------- /025_Qt_Event/mylabel.h: -------------------------------------------------------------------------------- 1 | #ifndef MYLABEL_H 2 | #define MYLABEL_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | class MyLabel : public QLabel 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit MyLabel(QWidget *parent = nullptr); 13 | 14 | /* 重写虚函数:鼠标进入 */ 15 | void enterEvent(QEnterEvent*); 16 | 17 | /* 重写虚函数:鼠标离开 */ 18 | void leaveEvent(QEvent*); 19 | 20 | /* 重写虚函数:鼠标移动 */ 21 | virtual void mouseMoveEvent(QMouseEvent *event); 22 | 23 | /* 重写虚函数:鼠标点击 */ 24 | virtual void mousePressEvent(QMouseEvent *event); 25 | 26 | /* 重写虚函数:鼠标释放 */ 27 | virtual void mouseReleaseEvent(QMouseEvent *event); 28 | 29 | /* 事件拦截 */ 30 | virtual bool event(QEvent* event); 31 | 32 | 33 | signals: 34 | 35 | 36 | 37 | }; 38 | 39 | #endif // MYLABEL_H 40 | -------------------------------------------------------------------------------- /025_Qt_Event/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include 4 | #include 5 | #include 6 | 7 | Widget::Widget(QWidget *parent) 8 | : QWidget(parent) 9 | , ui(new Ui::Widget) 10 | { 11 | ui->setupUi(this); 12 | 13 | /* 启动定时器 */ 14 | timer_id1 = this->startTimer(1000); // 每 1000ms(1s),调用一次 timeEvent 事件 15 | timer_id2 = this->startTimer(2000); 16 | 17 | /* 定时器第二种方式(推荐) */ 18 | QTimer* timer3 = new QTimer(this); 19 | timer3->start(500); // 启动定时器 20 | connect(timer3, &QTimer::timeout, 21 | this, [=](){ 22 | static int num3 = 0; 23 | ui->label_4->setText(QString::number(num3++)); 24 | }); 25 | 26 | /* 点击按钮暂停 */ 27 | connect(ui->btnStop, &QPushButton::clicked, 28 | this, [=](){timer3->stop();}); 29 | 30 | /* 对 label 安装事件过滤器*/ 31 | ui->label->installEventFilter(this); 32 | 33 | 34 | } 35 | 36 | Widget::~Widget() 37 | { 38 | delete ui; 39 | } 40 | 41 | /* 定时器事件 */ 42 | void Widget::timerEvent(QTimerEvent* event) 43 | { 44 | if (event->timerId() == timer_id1) 45 | { 46 | static int num1 = 0; 47 | ui->label_2->setText(QString::number(num1++)); 48 | } 49 | 50 | if (event->timerId() == timer_id2) 51 | { 52 | static int num2 = 0; 53 | ui->label_3->setText(QString::number(num2++)); 54 | } 55 | } 56 | 57 | 58 | /* 事件过滤器 */ 59 | bool Widget::eventFilter(QObject *object, QEvent *event) 60 | { 61 | /* 过滤在 `label` 上的`点击`事件 */ 62 | if (object == ui->label) 63 | { 64 | if (event->type() == QEvent::MouseButtonPress) 65 | { 66 | QMouseEvent* mouseEv = static_cast(event); // 【复习】将父类转换为子类 67 | qDebug() << "事件过滤器::鼠标[按下]了 - " << QString("鼠标当前位置 x: %1, y: %2").arg(mouseEv->x()).arg(mouseEv->y()); 68 | return true; // 返回 true 代表拦截 69 | } 70 | } 71 | 72 | return QWidget::eventFilter(object, event); // 其他的事件,交给父类处理 73 | } 74 | -------------------------------------------------------------------------------- /025_Qt_Event/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | 19 | /* 定时器事件 */ 20 | void timerEvent(QTimerEvent* event); 21 | 22 | 23 | /* 事件过滤器 */ 24 | virtual bool eventFilter(QObject *object, QEvent *event); 25 | 26 | private: 27 | Ui::Widget *ui; 28 | 29 | /* 定时器 id 编号 */ 30 | int timer_id1; 31 | int timer_id2; 32 | }; 33 | #endif // WIDGET_H 34 | -------------------------------------------------------------------------------- /025_Qt_Event/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 507 10 | 339 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | QFrame::Box 21 | 22 | 23 | 测试鼠标事件 24 | 25 | 26 | 27 | 28 | 29 | 30 | QFrame::Panel 31 | 32 | 33 | 每隔 1 秒加1 34 | 35 | 36 | 37 | 38 | 39 | 40 | QFrame::WinPanel 41 | 42 | 43 | 每隔 2 秒加1 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | QFrame::Box 54 | 55 | 56 | QFrame::Sunken 57 | 58 | 59 | 每隔 0.5 秒加1 60 | 61 | 62 | 63 | 64 | 65 | 66 | 暂停 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | MyLabel 78 | QLabel 79 |
mylabel.h
80 |
81 |
82 | 83 | 84 |
85 | -------------------------------------------------------------------------------- /030_QPainter/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /030_QPainter/030_QPainter.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | 26 | RESOURCES += \ 27 | res.qrc 28 | -------------------------------------------------------------------------------- /030_QPainter/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /030_QPainter/nekosilverfox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/030_QPainter/nekosilverfox.png -------------------------------------------------------------------------------- /030_QPainter/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | nekosilverfox.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /030_QPainter/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include 4 | #include 5 | 6 | 7 | Widget::Widget(QWidget *parent) 8 | : QWidget(parent) 9 | , ui(new Ui::Widget) 10 | { 11 | ui->setupUi(this); 12 | 13 | posX = 0; 14 | 15 | /* 随着时间往右移动图片 */ 16 | QTimer* timerMovePic = new QTimer(this); 17 | timerMovePic->start(100); 18 | connect(timerMovePic, &QTimer::timeout, 19 | [=](){ 20 | posX += 10; 21 | update(); // 记得使用 update 重新绘制,就像 OpenGL 22 | }); 23 | 24 | } 25 | 26 | Widget::~Widget() 27 | { 28 | delete ui; 29 | } 30 | 31 | 32 | /* QPainter,不需要手动调用。系统自己会调用。并且我们的 Widget 也可以充当绘图窗口(画纸) */ 33 | void Widget::paintEvent(QPaintEvent *) 34 | { 35 | /* 1.创建画家,并且指定绘图设备 */ 36 | QPainter painter(this); 37 | 38 | /* 2.设置笔的风格(设置风格一定要在使用笔之前) */ 39 | QPen pen(QColor(255, 0, 255)); 40 | pen.setWidth(3); // 笔的宽度 41 | pen.setStyle(Qt::DotLine); // 笔的风格 42 | 43 | /* 设置画刷(对于封闭图形的填充) */ 44 | QBrush brush(Qt::cyan); 45 | brush.setStyle(Qt::Dense3Pattern); 46 | 47 | /* 3.让画家用这个笔 */ 48 | painter.setPen(pen); 49 | painter.setBrush(brush); 50 | 51 | /* 4.让画家画画 */ 52 | painter.drawLine(QPoint(0, 0), QPoint(100, 100)); // 线 53 | painter.drawEllipse(QPoint(100, 100), 100, 50); // 椭圆 54 | painter.drawRect(QRect(QPoint(10, 10), QPoint(50, 50))); // 矩形 55 | painter.drawText(QRect(10, 200, 150, 50), "我是文本框中的一段文字"); // 字体 56 | 57 | /* 绘制图片 */ 58 | if (posX > 300) posX = 0; // 超出边界移回来 59 | painter.drawPixmap(posX, 150, QPixmap(":/pic/nekosilverfox.png")); 60 | } 61 | -------------------------------------------------------------------------------- /030_QPainter/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | /* QPainter */ 19 | void paintEvent(QPaintEvent *); 20 | 21 | int posX; 22 | 23 | private: 24 | Ui::Widget *ui; 25 | }; 26 | #endif // WIDGET_H 27 | -------------------------------------------------------------------------------- /030_QPainter/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /031_QPainterDevice/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /031_QPainterDevice/031_QPainterDevice.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | 26 | RESOURCES += \ 27 | res.qrc 28 | -------------------------------------------------------------------------------- /031_QPainterDevice/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /031_QPainterDevice/nekosilverfox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/031_QPainterDevice/nekosilverfox.png -------------------------------------------------------------------------------- /031_QPainterDevice/pic.command: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/031_QPainterDevice/pic.command -------------------------------------------------------------------------------- /031_QPainterDevice/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | nekosilverfox.png 4 | 5 | 6 | -------------------------------------------------------------------------------- /031_QPainterDevice/res_pix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/031_QPainterDevice/res_pix.png -------------------------------------------------------------------------------- /031_QPainterDevice/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include 4 | #include 5 | 6 | 7 | Widget::Widget(QWidget *parent) 8 | : QWidget(parent) 9 | , ui(new Ui::Widget) 10 | { 11 | ui->setupUi(this); 12 | 13 | /// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ QPixmap @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 14 | /* QPixmap 不仅仅可以作为显示图片,也可以作为绘图设备(画纸),对不同平台做优化 */ 15 | QPixmap pix(300, 300); // 画纸大小 16 | pix.fill(Qt::white); // 设置默认填充色 17 | 18 | QPainter painter(&pix); // 添加画家,并给他画纸 19 | painter.setPen(QPen(QColor(0, 255, 0))); 20 | painter.drawEllipse(QPoint(150, 150), 100, 100); 21 | 22 | pix.save("/Users/fox/雪狸的文件/Programma/Qt/031_QPainterDevice/res_pix.png"); // 保存到磁盘 23 | 24 | 25 | /// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ QImage @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 26 | /* QImage 作为绘图设备,对不同像素级做优化。可以修改像素点 */ 27 | QImage image(300, 300, QImage::Format_RGB32); 28 | image.fill(Qt::white); 29 | 30 | QPainter painter2(&image); 31 | painter2.setPen(QPen(QColor(255, 255, 0))); 32 | painter2.drawRect(20, 20, 250, 250); 33 | image.save("/Users/fox/雪狸的文件/Programma/Qt/031_QPainterDevice/res_pix.png"); 34 | 35 | 36 | /// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ QPicture @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 37 | /* QPicture 作为绘图设备,用于记录、重现绘图【指令】 */ 38 | QPicture pic; 39 | QPainter painter3; 40 | 41 | painter3.begin(&pic); // 开始记录绘图指令 42 | 43 | painter.setPen(QPen(QColor(255, 0, 0))); 44 | painter.drawEllipse(QPoint(150, 150), 50, 50); 45 | 46 | painter3.end(); // 结束记录绘图指令 47 | pic.save("/Users/fox/雪狸的文件/Programma/Qt/031_QPainterDevice/pic.command"); // 保存绘图指令,后缀名随意写 48 | } 49 | 50 | Widget::~Widget() 51 | { 52 | delete ui; 53 | } 54 | 55 | // 绘图事件 56 | void Widget::paintEvent(QPaintEvent* event) 57 | { 58 | QImage img; 59 | img.load(":/nekosilverfox.png"); 60 | 61 | /* 对像素做修改 */ 62 | for (int i = 100; i < 200; i++) 63 | { 64 | for (int j = 100; j < 200; j++) 65 | { 66 | // QRgb value = qRgb(255, 0, 0); 67 | img.setPixel(QPoint(i, j), Qt::red); 68 | } 69 | } 70 | 71 | QPainter painter(this); 72 | painter.drawImage(QPoint(0, 0), img); 73 | 74 | /// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ QPicture @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 75 | /// 重现绘图指令 76 | QPicture pic; 77 | bool isSucc = pic.load("/Users/fox/雪狸的文件/Programma/Qt/031_QPainterDevice/pic.command"); 78 | qDebug() << isSucc; 79 | painter.drawPicture(QPoint(0, 0), pic); 80 | } 81 | -------------------------------------------------------------------------------- /031_QPainterDevice/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | virtual void paintEvent(QPaintEvent* event); // 绘图事件 19 | 20 | private: 21 | Ui::Widget *ui; 22 | }; 23 | #endif // WIDGET_H 24 | -------------------------------------------------------------------------------- /031_QPainterDevice/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /032_Change_SVG_Color/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | *.qbs.user* 41 | CMakeLists.txt.user* 42 | 43 | # xemacs temporary files 44 | *.flc 45 | 46 | # Vim temporary files 47 | .*.swp 48 | 49 | # Visual Studio generated files 50 | *.ib_pdb_index 51 | *.idb 52 | *.ilk 53 | *.pdb 54 | *.sln 55 | *.suo 56 | *.vcproj 57 | *vcproj.*.*.user 58 | *.ncb 59 | *.sdf 60 | *.opensdf 61 | *.vcxproj 62 | *vcxproj.* 63 | 64 | # MinGW generated files 65 | *.Debug 66 | *.Release 67 | 68 | # Python byte code 69 | *.pyc 70 | 71 | # Binaries 72 | # -------- 73 | *.dll 74 | *.exe 75 | 76 | # Directories with generated files 77 | .moc/ 78 | .obj/ 79 | .pch/ 80 | .rcc/ 81 | .uic/ 82 | /build*/ 83 | -------------------------------------------------------------------------------- /032_Change_SVG_Color/032_Change_SVG_Color.pro: -------------------------------------------------------------------------------- 1 | QT += core gui svg 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | 26 | RESOURCES += \ 27 | resource.qrc 28 | -------------------------------------------------------------------------------- /032_Change_SVG_Color/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | 9 | Widget w; 10 | w.show(); 11 | 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /032_Change_SVG_Color/resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | unlock.svg 4 | 5 | 6 | -------------------------------------------------------------------------------- /032_Change_SVG_Color/unlock.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /032_Change_SVG_Color/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include // .pro 中 QT += svg 9 | 10 | Widget::Widget(QWidget *parent) 11 | : QWidget(parent) 12 | , ui(new Ui::Widget) 13 | { 14 | ui->setupUi(this); 15 | 16 | // ui->label->setPixmap(recolorSVG(":/unlock.svg", Qt::red)); // OK 17 | // ui->label->setPixmap(recolorSVG(":/unlock.svg", QColor("#ECBC1D"))); // OK 18 | ui->label->setPixmap(recolorSVG(":/unlock.svg", QColor(245, 136, 56))); // OK 19 | } 20 | 21 | Widget::~Widget() 22 | { 23 | delete ui; 24 | } 25 | 26 | /** 27 | * @brief Widget::recolorSVG 重新绘制 svg 图像的颜色 28 | * @param path 29 | * @param color 30 | * @return 31 | */ 32 | QPixmap Widget::recolorSVG(const QString& path, const QColor& color) 33 | { 34 | QSvgRenderer renderer(path, this); 35 | if (!renderer.isValid()) 36 | { 37 | qDebug() << "Failed to load SVG!"; 38 | return QPixmap(); 39 | } 40 | 41 | // 创建透明图像 42 | QImage image(renderer.defaultSize(), QImage::Format_ARGB32_Premultiplied); 43 | image.fill(Qt::transparent); 44 | 45 | // 绘制SVG并应用颜色 46 | QPainter painter(&image); 47 | renderer.render(&painter); // 渲染SVG的Alpha通道 48 | painter.setCompositionMode(QPainter::CompositionMode_SourceIn); 49 | painter.fillRect(image.rect(), color); // 填充颜色 50 | painter.end(); 51 | 52 | return QPixmap::fromImage(image); 53 | } 54 | -------------------------------------------------------------------------------- /032_Change_SVG_Color/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { 8 | class Widget; 9 | } 10 | QT_END_NAMESPACE 11 | 12 | class Widget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | Widget(QWidget *parent = nullptr); 18 | ~Widget(); 19 | 20 | QPixmap recolorSVG(const QString& path, const QColor& color); 21 | 22 | 23 | private: 24 | Ui::Widget *ui; 25 | }; 26 | #endif // WIDGET_H 27 | -------------------------------------------------------------------------------- /032_Change_SVG_Color/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | TextLabel 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /040_QFile/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /040_QFile/040_QFile.pro: -------------------------------------------------------------------------------- 1 | QT += core gui core5compat 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /040_QFile/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /040_QFile/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | #endif // WIDGET_H 22 | -------------------------------------------------------------------------------- /040_QFile/长恨歌_gbk.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/040_QFile/长恨歌_gbk.txt -------------------------------------------------------------------------------- /040_QFile/长恨歌_utf-8.txt: -------------------------------------------------------------------------------- 1 | 长恨歌 2 | 朝代:唐代 3 | 作者:白居易 4 | 5 | 原文: 6 | 汉皇重色思倾国,御宇多年求不得。杨家有女初长成,养在深闺人未识。 7 | 天生丽质难自弃,一朝选在君王侧。回眸一笑百媚生,六宫粉黛无颜色。 8 | 春寒赐浴华清池,温泉水滑洗凝脂。侍儿扶起娇无力,始是新承恩泽时。 9 | 云鬓花颜金步摇,芙蓉帐暖度春宵。春宵苦短日高起,从此君王不早朝。 10 | 11 | 承欢侍宴无闲暇,春从春游夜专夜。后宫佳丽三千人,三千宠爱在一身。 12 | 金屋妆成娇侍夜,玉楼宴罢醉和春。姊妹弟兄皆列土,可怜光彩生门户。 13 | 遂令天下父母心,不重生男重生女。骊宫高处入青云,仙乐风飘处处闻。 14 | 缓歌慢舞凝丝竹,尽日君王看不足。渔阳鼙鼓动地来,惊破霓裳羽衣曲。 15 | 16 | 九重城阙烟尘生,千乘万骑西南行。翠华摇摇行复止,西出都门百余里。 17 | 六军不发无奈何,宛转蛾眉马前死。花钿委地无人收,翠翘金雀玉搔头。 18 | 君王掩面救不得,回看血泪相和流。黄埃散漫风萧索,云栈萦纡登剑阁。 19 | 峨嵋山下少人行,旌旗无光日色薄。蜀江水碧蜀山青,圣主朝朝暮暮情。 20 | 21 | 行宫见月伤心色,夜雨闻铃肠断声。天旋地转回龙驭,到此踌躇不能去。 22 | 马嵬坡下泥土中,不见玉颜空死处。君臣相顾尽沾衣,东望都门信马归。 23 | 归来池苑皆依旧,太液芙蓉未央柳。芙蓉如面柳如眉,对此如何不泪垂。 24 | 春风桃李花开日,秋雨梧桐叶落时。西宫南内多秋草,落叶满阶红不扫。 25 | 26 | 梨园弟子白发新,椒房阿监青娥老。夕殿萤飞思悄然,孤灯挑尽未成眠。 27 | 迟迟钟鼓初长夜,耿耿星河欲曙天。鸳鸯瓦冷霜华重,翡翠衾寒谁与共。 28 | 悠悠生死别经年,魂魄不曾来入梦。临邛道士鸿都客,能以精诚致魂魄。 29 | 为感君王辗转思,遂教方士殷勤觅。排空驭气奔如电,升天入地求之遍。 30 | 31 | 上穷碧落下黄泉,两处茫茫皆不见。忽闻海上有仙山,山在虚无缥渺间。 32 | 楼阁玲珑五云起,其中绰约多仙子。中有一人字太真,雪肤花貌参差是。 33 | 金阙西厢叩玉扃,转教小玉报双成。闻道汉家天子使,九华帐里梦魂惊。 34 | 揽衣推枕起徘徊,珠箔银屏迤逦开。云鬓半偏新睡觉,花冠不整下堂来。 35 | 36 | 风吹仙袂飘飘举,犹似霓裳羽衣舞。玉容寂寞泪阑干,梨花一枝春带雨。 37 | 含情凝睇谢君王,一别音容两渺茫。昭阳殿里恩爱绝,蓬莱宫中日月长。 38 | 回头下望人寰处,不见长安见尘雾。惟将旧物表深情,钿合金钗寄将去。 39 | 钗留一股合一扇,钗擘黄金合分钿。但教心似金钿坚,天上人间会相见。 40 | 41 | 临别殷勤重寄词,词中有誓两心知。七月七日长生殿,夜半无人私语时。 42 | 在天愿作比翼鸟,在地愿为连理枝。天长地久有时尽,此恨绵绵无绝期。冰糖雪狸!!!冰糖雪狸!!!冰糖雪狸!!! -------------------------------------------------------------------------------- /042_Json_read_write/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | CMakeLists.txt.user* 41 | 42 | # xemacs temporary files 43 | *.flc 44 | 45 | # Vim temporary files 46 | .*.swp 47 | 48 | # Visual Studio generated files 49 | *.ib_pdb_index 50 | *.idb 51 | *.ilk 52 | *.pdb 53 | *.sln 54 | *.suo 55 | *.vcproj 56 | *vcproj.*.*.user 57 | *.ncb 58 | *.sdf 59 | *.opensdf 60 | *.vcxproj 61 | *vcxproj.* 62 | 63 | # MinGW generated files 64 | *.Debug 65 | *.Release 66 | 67 | # Python byte code 68 | *.pyc 69 | 70 | # Binaries 71 | # -------- 72 | *.dll 73 | *.exe 74 | 75 | -------------------------------------------------------------------------------- /042_Json_read_write/042_Json_read_write.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /042_Json_read_write/input.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": { 3 | "ip": "127.0.0.1", 4 | "port": "8080" 5 | }, 6 | "user": { 7 | "age": "1", 8 | "name": "silverfox" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /042_Json_read_write/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /042_Json_read_write/output.json: -------------------------------------------------------------------------------- 1 | { 2 | "server": { 3 | "ip": "127.0.0.1", 4 | "port": "8080" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /042_Json_read_write/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | 7 | QT_BEGIN_NAMESPACE 8 | namespace Ui { 9 | class Widget; 10 | } 11 | QT_END_NAMESPACE 12 | 13 | class Widget : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | Widget(QWidget *parent = nullptr); 19 | ~Widget(); 20 | 21 | void writeJsonFile(); 22 | void readJsonFile(); 23 | void rewriteJsonValueFromFile(); 24 | 25 | 26 | private: 27 | Ui::Widget *ui; 28 | }; 29 | #endif // WIDGET_H 30 | -------------------------------------------------------------------------------- /042_Json_read_write/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /045_UDP_Demo/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /045_UDP_Demo/045_UDP_Demo.pro: -------------------------------------------------------------------------------- 1 | QT += core gui network 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | udp_2.cpp \ 14 | upd_1.cpp 15 | 16 | HEADERS += \ 17 | udp_2.h \ 18 | upd_1.h 19 | 20 | FORMS += \ 21 | udp_2.ui \ 22 | upd_1.ui 23 | 24 | # Default rules for deployment. 25 | qnx: target.path = /tmp/$${TARGET}/bin 26 | else: unix:!android: target.path = /opt/$${TARGET}/bin 27 | !isEmpty(target.path): INSTALLS += target 28 | -------------------------------------------------------------------------------- /045_UDP_Demo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "upd_1.h" 2 | #include "udp_2.h" 3 | 4 | #include 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | 10 | Upd_1 w; 11 | w.show(); 12 | 13 | Udp_2 w2; 14 | w2.show(); 15 | return a.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /045_UDP_Demo/udp_2.cpp: -------------------------------------------------------------------------------- 1 | #include "udp_2.h" 2 | #include "ui_udp_2.h" 3 | 4 | Udp_2::Udp_2(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::Udp_2) 7 | { 8 | ui->setupUi(this); 9 | 10 | /* 初始化属性 */ 11 | ui->lbMyPort->setText("9999"); 12 | ui->lb2Port->setText("8888"); 13 | ui->lb2IP->setText("127.0.0.1"); 14 | 15 | udp = new QUdpSocket(this); // 创建套接字 16 | udp->bind(ui->lbMyPort->text().toInt()); // 绑定自身端口号 17 | 18 | /* 点击发送按钮,发送数据(报文) */ 19 | connect(ui->btnSend, &QPushButton::clicked, 20 | this, [=](){ 21 | // 书写报文:参数1:内容; 参数2:对方IP; 参数3:对方端口 22 | udp->writeDatagram(ui->teInput->toPlainText().toUtf8(), 23 | QHostAddress(ui->lb2IP->text()), 24 | ui->lb2Port->text().toInt()); 25 | ui->teRecord->append("My say: " + ui->teInput->toPlainText()); // 把自己写的内容写到聊天框 26 | ui->teInput->clear(); // 清空输入框 27 | }); 28 | 29 | /* 接收数据 */ 30 | connect(udp, &QUdpSocket::readyRead, 31 | this, [=](){ 32 | qint64 dataSize = udp->pendingDatagramSize(); // 获取报文长度 33 | QByteArray data = QByteArray(dataSize, 0); 34 | udp->readDatagram(data.data(), dataSize); // 读取报文 35 | ui->teRecord->append(data); // 报文同步到聊天记录 36 | }); 37 | } 38 | 39 | Udp_2::~Udp_2() 40 | { 41 | delete ui; 42 | } 43 | -------------------------------------------------------------------------------- /045_UDP_Demo/udp_2.h: -------------------------------------------------------------------------------- 1 | #ifndef UDP_2_H 2 | #define UDP_2_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class Udp_2; 9 | } 10 | 11 | class Udp_2 : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit Udp_2(QWidget *parent = nullptr); 17 | ~Udp_2(); 18 | 19 | private: 20 | Ui::Udp_2 *ui; 21 | 22 | public: 23 | QUdpSocket* udp; // 套接字(一个套接字就是网络上进程通信的一端) 24 | }; 25 | 26 | #endif // UDP_2_H 27 | -------------------------------------------------------------------------------- /045_UDP_Demo/upd_1.cpp: -------------------------------------------------------------------------------- 1 | #include "upd_1.h" 2 | #include "ui_upd_1.h" 3 | #include 4 | 5 | Upd_1::Upd_1(QWidget *parent) 6 | : QWidget(parent) 7 | , ui(new Ui::Upd_1) 8 | { 9 | ui->setupUi(this); 10 | 11 | /* 初始化属性 */ 12 | ui->lbMyPort->setText("8888"); 13 | ui->lb2Port->setText("9999"); 14 | ui->lb2IP->setText("127.0.0.1"); 15 | 16 | udp = new QUdpSocket(this); // 创建套接字 17 | udp->bind(ui->lbMyPort->text().toInt()); // 绑定自身端口号 18 | 19 | /* 点击发送按钮,发送数据(报文) */ 20 | connect(ui->btnSend, &QPushButton::clicked, 21 | this, [=](){ 22 | // 书写报文:参数1:内容; 参数2:对方IP; 参数3:对方端口 23 | udp->writeDatagram(ui->teInput->toPlainText().toUtf8(), 24 | QHostAddress(ui->lb2IP->text()), 25 | ui->lb2Port->text().toInt()); 26 | ui->teRecord->append("My say: " + ui->teInput->toPlainText()); // 把自己写的内容写到聊天框 27 | ui->teInput->clear(); // 清空输入框 28 | }); 29 | 30 | /* 接收数据 */ 31 | connect(udp, &QUdpSocket::readyRead, 32 | this, [=](){ 33 | qint64 dataSize = udp->pendingDatagramSize(); // 获取报文长度 34 | QByteArray data = QByteArray(dataSize, 0); 35 | udp->readDatagram(data.data(), dataSize); // 读取报文 36 | ui->teRecord->append(data); // 报文同步到聊天记录 37 | }); 38 | } 39 | 40 | Upd_1::~Upd_1() 41 | { 42 | delete ui; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /045_UDP_Demo/upd_1.h: -------------------------------------------------------------------------------- 1 | #ifndef UPD_1_H 2 | #define UPD_1_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | namespace Ui { class Upd_1; } 9 | QT_END_NAMESPACE 10 | 11 | class Upd_1 : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | Upd_1(QWidget *parent = nullptr); 17 | ~Upd_1(); 18 | 19 | private: 20 | Ui::Upd_1 *ui; 21 | 22 | 23 | public: 24 | QUdpSocket* udp; // 套接字(一个套接字就是网络上进程通信的一端) 25 | }; 26 | #endif // UPD_1_H 27 | -------------------------------------------------------------------------------- /047_QTcpFile/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/047_QTcpFile/.DS_Store -------------------------------------------------------------------------------- /047_QTcpFile/QTcpFile.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2022-01-14T14:01:42 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = QTcpFile 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | tcpserverwidget.cpp \ 17 | tcpclientwidget.cpp 18 | 19 | HEADERS += tcpserverwidget.h \ 20 | tcpclientwidget.h 21 | 22 | FORMS += tcpserverwidget.ui \ 23 | tcpclientwidget.ui 24 | 25 | CONFIG += C++11 26 | -------------------------------------------------------------------------------- /047_QTcpFile/main.cpp: -------------------------------------------------------------------------------- 1 | #include "tcpserverwidget.h" 2 | #include "tcpclientwidget.h" 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | TcpServerWidget w; 9 | w.show(); 10 | 11 | TcpClientWidget w2; 12 | w2.show(); 13 | 14 | return a.exec(); 15 | } 16 | -------------------------------------------------------------------------------- /047_QTcpFile/tcpclientwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef TCPCLIENTWIDGET_H 2 | #define TCPCLIENTWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui { 9 | class TcpClientWidget; 10 | } 11 | 12 | class TcpClientWidget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit TcpClientWidget(QWidget *parent = 0); 18 | ~TcpClientWidget(); 19 | 20 | private slots: 21 | void on_buttonConnect_clicked(); 22 | 23 | private: 24 | Ui::TcpClientWidget *ui; 25 | 26 | QTcpSocket *tcpSocket; //通信套接字 27 | 28 | QString fileName;//文件名字 29 | qint64 fileSize;//文件大小 30 | qint64 receSize;//已经收了多少数据 31 | 32 | bool startInfo;//判断是否是接收到文件信息了 33 | 34 | //文件对象 35 | QFile file; 36 | }; 37 | 38 | #endif // TCPCLIENTWIDGET_H 39 | -------------------------------------------------------------------------------- /047_QTcpFile/tcpserverwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef TCPSERVERWIDGET_H 2 | #define TCPSERVERWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Ui { 11 | class TcpServerWidget; 12 | } 13 | 14 | class TcpServerWidget : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit TcpServerWidget(QWidget *parent = 0); 20 | ~TcpServerWidget(); 21 | 22 | private slots: 23 | void on_buttonFile_clicked(); 24 | 25 | void on_buttonSend_clicked(); 26 | 27 | private: 28 | Ui::TcpServerWidget *ui; 29 | 30 | QTcpServer *tcpServer; //监听套接字 31 | QTcpSocket *tcpSocket; //通信套接字 32 | 33 | QString fileName;//文件名字 34 | qint64 fileSize;//文件大小 35 | qint64 sendSize;//已经发了多少数据 36 | 37 | //文件对象 38 | QFile file; 39 | 40 | //发送数据的函数 41 | void sendDate(); 42 | 43 | QTimer *myTimer; 44 | }; 45 | 46 | #endif // TCPSERVERWIDGET_H 47 | -------------------------------------------------------------------------------- /047_QTcpFile/test.cpp: -------------------------------------------------------------------------------- 1 | #include "clienttcp.h" 2 | #include "ui_clienttcp.h" 3 | #include 4 | 5 | ClientTCP::ClientTCP(QWidget *parent) : 6 | QWidget(parent), 7 | ui(new Ui::ClientTCP) 8 | { 9 | ui->setupUi(this); 10 | setWindowTitle("客户端"); 11 | 12 | tcpSocket=new QTcpSocket(this); 13 | 14 | connect(tcpSocket,&QTcpSocket::connected, 15 | [=](){ 16 | ui->textEditRead->setText("与服务端已经成功连接!"); 17 | } 18 | 19 | ); 20 | 21 | //从通信套接字里面取内容 22 | connect(tcpSocket,&QTcpSocket::readyRead, 23 | [=](){ 24 | //获取对方发送的内容 25 | QByteArray array = tcpSocket->readAll(); 26 | //追加到编辑区中 27 | ui->textEditRead->append(array); 28 | } 29 | 30 | ); 31 | 32 | } 33 | 34 | ClientTCP::~ClientTCP() 35 | { 36 | delete ui; 37 | } 38 | 39 | void ClientTCP::on_buttonConnect_clicked() 40 | { 41 | //获取服务器ip和端口 42 | QString ip=ui->lineEditIP->text(); 43 | qint16 port=ui->lineEditPort->text().toInt(); 44 | 45 | //主动和服务器建立连接 46 | tcpSocket->connectToHost(QHostAddress(ip),port); 47 | } 48 | 49 | void ClientTCP::on_buttonWrite_clicked() 50 | { 51 | //获取编辑器内容,发送到套接字 52 | //获取编辑区内容 53 | QString str=ui->textEditWrite->toPlainText(); 54 | //给对方发送数据, 使用套接字是tcpSocket 55 | tcpSocket->write(str.toUtf8().data()); 56 | } 57 | 58 | void ClientTCP::on_buttonClose_clicked() 59 | { 60 | //主动和客户端端口连接 61 | tcpSocket->disconnectFromHost(); 62 | tcpSocket->close(); 63 | 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /050_MySelfQQ/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | 41 | # xemacs temporary files 42 | *.flc 43 | 44 | # Vim temporary files 45 | .*.swp 46 | 47 | # Visual Studio generated files 48 | *.ib_pdb_index 49 | *.idb 50 | *.ilk 51 | *.pdb 52 | *.sln 53 | *.suo 54 | *.vcproj 55 | *vcproj.*.*.user 56 | *.ncb 57 | *.sdf 58 | *.opensdf 59 | *.vcxproj 60 | *vcxproj.* 61 | 62 | # MinGW generated files 63 | *.Debug 64 | *.Release 65 | 66 | # Python byte code 67 | *.pyc 68 | 69 | # Binaries 70 | # -------- 71 | *.dll 72 | *.exe 73 | 74 | -------------------------------------------------------------------------------- /050_MySelfQQ/050_MySelfQQ.pro: -------------------------------------------------------------------------------- 1 | QT += core gui network 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | dialoglist.cpp \ 13 | main.cpp \ 14 | widget.cpp 15 | 16 | HEADERS += \ 17 | dialoglist.h \ 18 | widget.h 19 | 20 | FORMS += \ 21 | dialoglist.ui \ 22 | widget.ui 23 | 24 | # Default rules for deployment. 25 | qnx: target.path = /tmp/$${TARGET}/bin 26 | else: unix:!android: target.path = /opt/$${TARGET}/bin 27 | !isEmpty(target.path): INSTALLS += target 28 | 29 | RESOURCES += \ 30 | res.qrc 31 | -------------------------------------------------------------------------------- /050_MySelfQQ/dialoglist.cpp: -------------------------------------------------------------------------------- 1 | #include "dialoglist.h" 2 | #include "ui_dialoglist.h" 3 | #include "widget.h" 4 | 5 | #include 6 | #include 7 | 8 | DialogList::DialogList(QWidget *parent) : 9 | QWidget(parent), 10 | ui(new Ui::DialogList) 11 | { 12 | ui->setupUi(this); 13 | 14 | /* 窗口操作 */ 15 | setWindowTitle("MySelfQQ-Silverfox"); // 设置标题 16 | setWindowIcon(QIcon(":/nekosilverfox.png")); // 设置图标 17 | 18 | /* 测试数据 */ 19 | QStringList nameList; 20 | nameList << "冰糖雪狸" << "奇迹" << "玄狸" << "诺瓦" << "小虎" << "书齐" << "张三" << "罗翔" << "罗永浩" << "罗振宇"; 21 | for (auto i : nameList) 22 | { 23 | /* 设置头像 */ 24 | QToolButton* btn = new QToolButton; 25 | btn->setText(i); 26 | btn->setIcon(QIcon(":/user-group.png")); 27 | btn->setAutoRaise(true); // 按钮透明风格 28 | btn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); // 设置显示图标和文字 29 | btn->setFixedSize(220, 50); 30 | 31 | vToolBtn.push_back(btn); 32 | vIsOpen.push_back(false); 33 | 34 | ui->vLayout->addWidget(btn); // 加到垂直布局中 35 | } 36 | 37 | 38 | /* 对 9 个按钮添加信号和槽 */ 39 | for (auto i = 0; i < vToolBtn.size(); i++) 40 | { 41 | /* 弹出聊天对话框 */ 42 | connect(vToolBtn.at(i), &QToolButton::clicked, 43 | this, 44 | [=](){ 45 | 46 | /* 如果窗口已经被打开,就不要再执行 */ 47 | if (true == vIsOpen.at(i)) 48 | { 49 | QMessageBox::warning(this, "警告", QString("%1 的窗口已经被打开了").arg(vToolBtn.at(i)->text())); 50 | return; 51 | } 52 | 53 | Widget* widget = new Widget(nullptr, vToolBtn.at(i)->text()); // nullptr 代表为顶层窗口,参数二为构建窗口时告诉与某人的聊天窗口 54 | widget->setWindowTitle(vToolBtn.at(i)->text()); 55 | widget->setWindowIcon(QIcon(":/nekosilverfox.png")); 56 | widget->show(); 57 | 58 | vIsOpen[i] = true; 59 | 60 | 61 | /* 关闭聊天对话框 重置是否打开的数组。(如果接收到窗口关闭信号,就 XXX) */ 62 | connect(widget, &Widget::signalClose, 63 | this, [=](){ 64 | vIsOpen[i] = false; 65 | }); 66 | }); 67 | 68 | } 69 | } 70 | 71 | DialogList::~DialogList() 72 | { 73 | delete ui; 74 | } 75 | -------------------------------------------------------------------------------- /050_MySelfQQ/dialoglist.h: -------------------------------------------------------------------------------- 1 | #ifndef DIALOGLIST_H 2 | #define DIALOGLIST_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | namespace Ui { 9 | class DialogList; 10 | } 11 | 12 | class DialogList : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit DialogList(QWidget *parent = nullptr); 18 | ~DialogList(); 19 | 20 | private: 21 | Ui::DialogList *ui; 22 | 23 | QVector vToolBtn; // 用容器保存住按钮,方便后续操作 24 | QVector vIsOpen; // 对应人员的窗口是否已经被打开 25 | }; 26 | 27 | #endif // DIALOGLIST_H 28 | -------------------------------------------------------------------------------- /050_MySelfQQ/dialoglist.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DialogList 4 | 5 | 6 | 7 | 0 8 | 0 9 | 300 10 | 650 11 | 12 | 13 | 14 | 15 | 300 16 | 650 17 | 18 | 19 | 20 | Form 21 | 22 | 23 | 24 | 25 | 26 | 0 27 | 28 | 29 | 30 | 31 | 0 32 | 0 33 | 276 34 | 592 35 | 36 | 37 | 38 | 群成员 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /050_MySelfQQ/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "dialoglist.h" 3 | 4 | #include 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | 10 | 11 | 12 | DialogList list; 13 | list.show(); 14 | 15 | // Widget w; 16 | // w.show(); 17 | return a.exec(); 18 | } 19 | -------------------------------------------------------------------------------- /050_MySelfQQ/nekosilverfox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/050_MySelfQQ/nekosilverfox.png -------------------------------------------------------------------------------- /050_MySelfQQ/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | user-group.png 4 | nekosilverfox.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /050_MySelfQQ/user-group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/050_MySelfQQ/user-group.png -------------------------------------------------------------------------------- /050_MySelfQQ/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | namespace Ui { class Widget; } 9 | QT_END_NAMESPACE 10 | 11 | class Widget : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | enum MsgType {Msg, UserJoin, UserLeft}; 16 | 17 | public: 18 | Widget(QWidget *parent, QString userName); 19 | ~Widget(); 20 | 21 | void sendMsg(MsgType type); // 广播 UDP 消息 22 | void userJoin(QString name); // 处理用户加入 23 | void userLeft(QString name, QString time); // 处理用户离开 24 | QString getUser(); // 获取用户名 25 | QString getMsg(); // 获取聊天信息 26 | 27 | virtual void closeEvent(QCloseEvent*); // 【重写】触发关闭事件 28 | 29 | signals: 30 | void signalClose(); // 【自定义信号】如果关闭窗口则发送关闭信号 31 | 32 | private: 33 | Ui::Widget *ui; 34 | 35 | QUdpSocket* udpSocket; // UDP 套接字 36 | qint16 port; // 端口 37 | QString userName; // 用户名 38 | 39 | void receiveMessage(); // 接收 UDP 消息 40 | 41 | }; 42 | #endif // WIDGET_H 43 | -------------------------------------------------------------------------------- /055_Http/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | CMakeLists.txt.user* 41 | 42 | # xemacs temporary files 43 | *.flc 44 | 45 | # Vim temporary files 46 | .*.swp 47 | 48 | # Visual Studio generated files 49 | *.ib_pdb_index 50 | *.idb 51 | *.ilk 52 | *.pdb 53 | *.sln 54 | *.suo 55 | *.vcproj 56 | *vcproj.*.*.user 57 | *.ncb 58 | *.sdf 59 | *.opensdf 60 | *.vcxproj 61 | *vcxproj.* 62 | 63 | # MinGW generated files 64 | *.Debug 65 | *.Release 66 | 67 | # Python byte code 68 | *.pyc 69 | 70 | # Binaries 71 | # -------- 72 | *.dll 73 | *.exe 74 | 75 | -------------------------------------------------------------------------------- /055_Http/055_Http.pro: -------------------------------------------------------------------------------- 1 | QT += core gui network 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /055_Http/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /055_Http/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | Widget::Widget(QWidget *parent) 9 | : QWidget(parent) 10 | , ui(new Ui::Widget) 11 | { 12 | ui->setupUi(this); 13 | 14 | // 使用 Manger 对象,做 GET/POST 请求 15 | QNetworkAccessManager* manager = new QNetworkAccessManager(this); 16 | 17 | // 初始化一个 GET/POST 请求:设置请求头、URL 18 | QNetworkRequest request; 19 | request.setHeader(QNetworkRequest::UserAgentHeader, 20 | "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " 21 | "AppleWebKit/537.36 (KHTML, like Gecko) " 22 | "Chrome/131.0.0.0 Safari/537.36"); // 设置头,伪装成浏览器 23 | request.setUrl(QUrl("http://baidu.com")); 24 | 25 | // manager 发送数据并接收返回的数据 26 | // QNetworkReply* replay = manager->post(request, ""); 27 | QNetworkReply* replay = manager->get(request); 28 | 29 | // 读取服务器回写的数据 30 | connect(replay, &QNetworkReply::readyRead, this, [=](){ 31 | // 根据需求通过 QNetworkRequest::XXXXX 读取不同的 header 32 | QString header = replay->header(QNetworkRequest::LocationHeader).toString(); 33 | qDebug() << "读取到的头:" << header; 34 | 35 | 36 | /* 注意,这里只是包含回复的数据段,不包含头! */ 37 | QByteArray data = replay->readAll(); 38 | qDebug() << "读取的返回数据:" << data; 39 | }); 40 | } 41 | 42 | Widget::~Widget() 43 | { 44 | delete ui; 45 | } 46 | -------------------------------------------------------------------------------- /055_Http/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { 8 | class Widget; 9 | } 10 | QT_END_NAMESPACE 11 | 12 | class Widget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | Widget(QWidget *parent = nullptr); 18 | ~Widget(); 19 | 20 | private: 21 | Ui::Widget *ui; 22 | }; 23 | #endif // WIDGET_H 24 | -------------------------------------------------------------------------------- /055_Http/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /060_QTestlib/060_QTestlib.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = subdirs 2 | 3 | SUBDIRS += \ 4 | App \ 5 | Tester 6 | -------------------------------------------------------------------------------- /060_QTestlib/App/App.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /060_QTestlib/App/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /060_QTestlib/App/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | Widget::Widget(QWidget *parent) 5 | : QWidget(parent) 6 | , ui(new Ui::Widget) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | Widget::~Widget() 12 | { 13 | delete ui; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /060_QTestlib/App/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | QT_END_NAMESPACE 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | #endif // WIDGET_H 22 | -------------------------------------------------------------------------------- /060_QTestlib/App/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | PushButton 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /060_QTestlib/Tester/Tester.pro: -------------------------------------------------------------------------------- 1 | QT += core testlib gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += qt console warn_on depend_includepath testcase 6 | CONFIG -= app_bundle 7 | 8 | TEMPLATE = app 9 | 10 | CONFIG += console 11 | CONFIG += c++17 12 | 13 | SOURCES += tst_widgettester.cpp \ 14 | ../App/widget.cpp 15 | 16 | HEADERS += \ 17 | ../App/widget.h 18 | 19 | FORMS += \ 20 | ../App/widget.ui 21 | -------------------------------------------------------------------------------- /060_QTestlib/Tester/tst_widgettester.cpp: -------------------------------------------------------------------------------- 1 | #include // 单元测试必须包含,但是包含后会拖慢编译速度。因为他们包含了所有模块。注意不要写成 QtTest! 2 | 3 | // add necessary includes here 4 | #include 5 | #include 6 | 7 | #include "../App/widget.h" 8 | 9 | 10 | class WidgetTester : public QObject 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | WidgetTester(); 16 | ~WidgetTester(); 17 | 18 | private slots: 19 | void initTestCase(); 20 | void cleanupTestCase(); 21 | void test_case1(); 22 | void testGui(); 23 | void testSingal(); 24 | }; 25 | 26 | WidgetTester::WidgetTester() 27 | { 28 | 29 | } 30 | 31 | WidgetTester::~WidgetTester() 32 | { 33 | 34 | } 35 | 36 | void WidgetTester::initTestCase() 37 | { 38 | 39 | } 40 | 41 | void WidgetTester::cleanupTestCase() 42 | { 43 | 44 | } 45 | 46 | void WidgetTester::test_case1() 47 | { 48 | QCOMPARE("冰糖雪狸", "冰糖雪狸"); 49 | } 50 | 51 | /** 测试 GUI(包含了获取 private 成员的方法) 52 | * @brief WidgetTester::testGui 53 | */ 54 | void WidgetTester::testGui() 55 | { 56 | Widget widget; 57 | QLineEdit* lineEdit = widget.findChild("lineEdit"); // 【重点】获取 private 成员的方法 58 | 59 | QTest::keyClicks(lineEdit, "Hellooooooo"); // 但是不知道为什么,如果换成中文就报错 60 | 61 | QCOMPARE(lineEdit->text(), QString("Hellooooooo")); 62 | } 63 | 64 | /** 测试信号 65 | * @brief WidgetTester::testSingal 66 | */ 67 | void WidgetTester::testSingal() 68 | { 69 | Widget widget; 70 | QPushButton* pushButton = widget.findChild("pushButton"); 71 | 72 | QSignalSpy spy(pushButton, &QPushButton::clicked); 73 | // pushButton->animateClick(); // 做一些触发信号的事情 74 | pushButton->click(); 75 | QCOMPARE(spy.count(), 1); // 确保信号被准确地发射了一次 76 | 77 | QList arguments = spy.takeFirst(); // take the first signal 78 | QVERIFY(arguments.at(0).toBool() == false); // 验证第一个参数 79 | 80 | } 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | //QTEST_APPLESS_MAIN(WidgetTester) 92 | QTEST_MAIN(WidgetTester) // 自动为我们创建用于测试的 main 函 93 | 94 | #include "tst_widgettester.moc" // 编译或者生成一个额外的 cpp 文件,其中包含您需要的所有元结构 (因为 Qt 的信号和槽不属于 C++标准的内容)。以进行Qt的内省工作 95 | -------------------------------------------------------------------------------- /061_Use_Java_jar_in_Qt/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | *.qbs.user* 41 | CMakeLists.txt.user* 42 | 43 | # xemacs temporary files 44 | *.flc 45 | 46 | # Vim temporary files 47 | .*.swp 48 | 49 | # Visual Studio generated files 50 | *.ib_pdb_index 51 | *.idb 52 | *.ilk 53 | *.pdb 54 | *.sln 55 | *.suo 56 | *.vcproj 57 | *vcproj.*.*.user 58 | *.ncb 59 | *.sdf 60 | *.opensdf 61 | *.vcxproj 62 | *vcxproj.* 63 | 64 | # MinGW generated files 65 | *.Debug 66 | *.Release 67 | 68 | # Python byte code 69 | *.pyc 70 | 71 | # Binaries 72 | # -------- 73 | *.dll 74 | *.exe 75 | 76 | # Directories with generated files 77 | .moc/ 78 | .obj/ 79 | .pch/ 80 | .rcc/ 81 | .uic/ 82 | /build*/ 83 | -------------------------------------------------------------------------------- /061_Use_Java_jar_in_Qt/061_Use_Java_jar_in_Qt.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /061_Use_Java_jar_in_Qt/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QApplication a(argc, argv); 10 | Widget w; 11 | w.show(); 12 | return a.exec(); 13 | } 14 | -------------------------------------------------------------------------------- /061_Use_Java_jar_in_Qt/openstego.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/061_Use_Java_jar_in_Qt/openstego.jar -------------------------------------------------------------------------------- /061_Use_Java_jar_in_Qt/secret.txt: -------------------------------------------------------------------------------- 1 | I am a happy fox 2 | -------------------------------------------------------------------------------- /061_Use_Java_jar_in_Qt/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | #include 5 | #include 6 | 7 | 8 | Widget::Widget(QWidget *parent) 9 | : QWidget(parent) 10 | , ui(new Ui::Widget) 11 | { 12 | ui->setupUi(this); 13 | 14 | /* 将 secret.txt 嵌入 input.png,并将输出生成 test.png(注意,不支持 jpg,因为 jpg 会压缩数据),使用密码 -p 加密 15 | * java -jar /Users/fox/Downloads/openstego-0.8.6/lib/openstego.jar embed -a RandomLSB -mf secret.txt -cf IMG_9056.JPG -sf output.png -p happfox123 16 | * 17 | *java -jar /Users/fox/Downloads/openstego-0.8.6/lib/openstego.jar extract -a RandomLSB -sf output.png -xd . -p happfox123 18 | * 19 | */ 20 | QProcess process; 21 | QString program = "java"; // 使用Java运行OpenStego的JAR文件 22 | QStringList arguments; 23 | arguments << "-jar" << "/Users/fox/雪狸的文件/Programma/Qt/061_Use_Java_jar_in_Qt/openstego.jar" 24 | << "embed" << "-a" << "RandomLSB" 25 | << "-mf" << "/Users/fox/雪狸的文件/Programma/Qt/061_Use_Java_jar_in_Qt/secret.txt" 26 | << "-cf" << "/Users/fox/Downloads/IMG_8971.JPG" 27 | << "-sf" << "/Users/fox/Downloads/output.png" 28 | << "-p" << "happfox123"; 29 | 30 | process.start(program, arguments); 31 | process.waitForFinished(); 32 | 33 | if (process.exitCode() == 0) { 34 | qDebug() << "数据隐藏成功!" << process.readAllStandardOutput(); 35 | } else { 36 | qDebug() << "错误:" << process.readAllStandardError(); 37 | } 38 | 39 | } 40 | 41 | Widget::~Widget() 42 | { 43 | delete ui; 44 | } 45 | -------------------------------------------------------------------------------- /061_Use_Java_jar_in_Qt/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { 8 | class Widget; 9 | } 10 | QT_END_NAMESPACE 11 | 12 | class Widget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | Widget(QWidget *parent = nullptr); 18 | ~Widget(); 19 | 20 | private: 21 | Ui::Widget *ui; 22 | }; 23 | #endif // WIDGET_H 24 | -------------------------------------------------------------------------------- /061_Use_Java_jar_in_Qt/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /062_Use_Python_in_Qt/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | *.qbs.user* 41 | CMakeLists.txt.user* 42 | 43 | # xemacs temporary files 44 | *.flc 45 | 46 | # Vim temporary files 47 | .*.swp 48 | 49 | # Visual Studio generated files 50 | *.ib_pdb_index 51 | *.idb 52 | *.ilk 53 | *.pdb 54 | *.sln 55 | *.suo 56 | *.vcproj 57 | *vcproj.*.*.user 58 | *.ncb 59 | *.sdf 60 | *.opensdf 61 | *.vcxproj 62 | *vcxproj.* 63 | 64 | # MinGW generated files 65 | *.Debug 66 | *.Release 67 | 68 | # Python byte code 69 | *.pyc 70 | 71 | # Binaries 72 | # -------- 73 | *.dll 74 | *.exe 75 | 76 | # Directories with generated files 77 | .moc/ 78 | .obj/ 79 | .pch/ 80 | .rcc/ 81 | .uic/ 82 | /build*/ 83 | -------------------------------------------------------------------------------- /062_Use_Python_in_Qt/062_Use_Python_in_Qt.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | mainwindow.cpp 14 | 15 | HEADERS += \ 16 | mainwindow.h 17 | 18 | FORMS += \ 19 | mainwindow.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /062_Use_Python_in_Qt/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | MainWindow w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /062_Use_Python_in_Qt/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | #include // 运行脚本需要 5 | #include 6 | 7 | MainWindow::MainWindow(QWidget *parent) 8 | : QMainWindow(parent) 9 | , ui(new Ui::MainWindow) 10 | { 11 | ui->setupUi(this); 12 | 13 | runPipInstall(); 14 | } 15 | 16 | MainWindow::~MainWindow() 17 | { 18 | delete ui; 19 | } 20 | 21 | void MainWindow::runPipInstall() 22 | { 23 | // 异步处理 24 | QString program = "/usr/bin/python3"; // 使用 Python 模块调用更可靠 25 | QStringList arguments = {"-m", "pip", "install", "blind-watermark", "--user"}; 26 | QProcess* process = new QProcess(this); 27 | 28 | connect(process, &QProcess::started, this, [=](){ 29 | qDebug() << "Start run:" << program << arguments.join(" "); 30 | }); 31 | 32 | connect(process, &QProcess::readyReadStandardOutput, this, [=]() { 33 | QByteArray output = process->readAllStandardOutput(); 34 | qDebug() << "Real-time output:" << output.trimmed(); 35 | }); 36 | 37 | // 新增:连接信号:标准错误输出 38 | connect(process, &QProcess::readyReadStandardError, this, [=]() { 39 | QByteArray error = process->readAllStandardError(); 40 | qDebug() << "Error:" << error.trimmed(); 41 | }); 42 | 43 | // 新增:处理进程错误 44 | connect(process, &QProcess::errorOccurred, this, [=](QProcess::ProcessError error) { 45 | qDebug() << "Process Error:" << error << process->errorString(); 46 | }); 47 | 48 | process->start(program, arguments); 49 | } 50 | -------------------------------------------------------------------------------- /062_Use_Python_in_Qt/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { 8 | class MainWindow; 9 | } 10 | QT_END_NAMESPACE 11 | 12 | class MainWindow : public QMainWindow 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | MainWindow(QWidget *parent = nullptr); 18 | ~MainWindow(); 19 | 20 | void runPipInstall(); 21 | 22 | private: 23 | Ui::MainWindow *ui; 24 | }; 25 | #endif // MAINWINDOW_H 26 | -------------------------------------------------------------------------------- /062_Use_Python_in_Qt/mainwindow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | MainWindow 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 20 | 0 21 | 0 22 | 800 23 | 24 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /070_QChartView_2D_Plot/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | CMakeLists.txt.user* 41 | 42 | # xemacs temporary files 43 | *.flc 44 | 45 | # Vim temporary files 46 | .*.swp 47 | 48 | # Visual Studio generated files 49 | *.ib_pdb_index 50 | *.idb 51 | *.ilk 52 | *.pdb 53 | *.sln 54 | *.suo 55 | *.vcproj 56 | *vcproj.*.*.user 57 | *.ncb 58 | *.sdf 59 | *.opensdf 60 | *.vcxproj 61 | *vcxproj.* 62 | 63 | # MinGW generated files 64 | *.Debug 65 | *.Release 66 | 67 | # Python byte code 68 | *.pyc 69 | 70 | # Binaries 71 | # -------- 72 | *.dll 73 | *.exe 74 | 75 | -------------------------------------------------------------------------------- /070_QChartView_2D_Plot/070_QChartView_2D_Plot.pro: -------------------------------------------------------------------------------- 1 | QT += core gui charts # 添加Qt charts模块 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp 14 | 15 | HEADERS += \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | 21 | # Default rules for deployment. 22 | qnx: target.path = /tmp/$${TARGET}/bin 23 | else: unix:!android: target.path = /opt/$${TARGET}/bin 24 | !isEmpty(target.path): INSTALLS += target 25 | -------------------------------------------------------------------------------- /070_QChartView_2D_Plot/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /070_QChartView_2D_Plot/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include // 坐标轴 10 | #include 11 | 12 | // 引用命名空间 13 | // QT_CHARTS_USE_NAMESPACE 这个宏在 Qt 6 中不再被支持 14 | // using namespace QtCharts; 15 | 16 | QT_BEGIN_NAMESPACE 17 | namespace Ui { 18 | class Widget; 19 | } 20 | QT_END_NAMESPACE 21 | 22 | 23 | class Widget : public QWidget 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | Widget(QWidget *parent = nullptr); 29 | ~Widget(); 30 | 31 | void timerStart(); 32 | void timerStop(); 33 | 34 | void drawPoint(); 35 | 36 | private: 37 | Ui::Widget *ui; 38 | 39 | QChart* chart; 40 | QSplineSeries *splineSeries; 41 | QScatterSeries* scatterSeries; 42 | QValueAxis *axisX; 43 | QValueAxis *axisY; 44 | 45 | QTimer* timer; 46 | }; 47 | #endif // WIDGET_H 48 | -------------------------------------------------------------------------------- /070_QChartView_2D_Plot/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Start 24 | 25 | 26 | 27 | 28 | 29 | 30 | Stop 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | QChartView 45 | QGraphicsView 46 |
qchartview.h
47 |
48 |
49 | 50 | 51 |
52 | -------------------------------------------------------------------------------- /080_QThread/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | CMakeLists.txt.user* 41 | 42 | # xemacs temporary files 43 | *.flc 44 | 45 | # Vim temporary files 46 | .*.swp 47 | 48 | # Visual Studio generated files 49 | *.ib_pdb_index 50 | *.idb 51 | *.ilk 52 | *.pdb 53 | *.sln 54 | *.suo 55 | *.vcproj 56 | *vcproj.*.*.user 57 | *.ncb 58 | *.sdf 59 | *.opensdf 60 | *.vcxproj 61 | *vcxproj.* 62 | 63 | # MinGW generated files 64 | *.Debug 65 | *.Release 66 | 67 | # Python byte code 68 | *.pyc 69 | 70 | # Binaries 71 | # -------- 72 | *.dll 73 | *.exe 74 | 75 | -------------------------------------------------------------------------------- /080_QThread/080_QThread.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | main.cpp \ 13 | widget.cpp \ 14 | work.cpp 15 | 16 | HEADERS += \ 17 | widget.h \ 18 | work.h 19 | 20 | FORMS += \ 21 | widget.ui 22 | 23 | # Default rules for deployment. 24 | qnx: target.path = /tmp/$${TARGET}/bin 25 | else: unix:!android: target.path = /opt/$${TARGET}/bin 26 | !isEmpty(target.path): INSTALLS += target 27 | -------------------------------------------------------------------------------- /080_QThread/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | Widget w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /080_QThread/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | 4 | 5 | Widget::Widget(QWidget *parent) 6 | : QWidget(parent) 7 | , ui(new Ui::Widget) 8 | { 9 | ui->setupUi(this); 10 | 11 | ui->progressBar->setMinimum(0); 12 | ui->progressBar->setMaximum(100); 13 | 14 | /* 初始化两个对象 */ 15 | work = new Work(); // 注意,这里 work 一定不能传入父对象!!否则无法调用线程!! 16 | thread = new QThread(this); 17 | 18 | /* 将工作对象移动到线程中 */ 19 | work->moveToThread(thread); 20 | connect(thread, &QThread::started, work, &Work::someWork); 21 | connect(ui->btnStart, &QPushButton::clicked, this, [=](){ thread->start();}); // 点击按钮启动线程 22 | connect(ui->btnStop, &QPushButton::clicked, this, [=](){ thread->terminate();}); // 直接中断线程,但不建议使用这个函数 23 | 24 | /* 主线程接收并处理另一个线程执行过程中发出的信号 */ 25 | connect(work, &Work::signalUupdateUI, this, &Widget::updateUI, Qt::QueuedConnection); 26 | 27 | } 28 | 29 | Widget::~Widget() 30 | { 31 | if (thread->isRunning()) { 32 | thread->quit(); // 退出线程 33 | thread->wait(); // 等待线程完成 34 | } 35 | delete work; 36 | delete thread; 37 | 38 | delete ui; 39 | } 40 | 41 | void Widget::updateUI(unsigned int i) 42 | { 43 | ui->textBrowser->append(QString::number(i)); 44 | ui->progressBar->setValue(i % 101); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /080_QThread/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include "work.h" 5 | 6 | #include 7 | #include 8 | 9 | QT_BEGIN_NAMESPACE 10 | namespace Ui { 11 | class Widget; 12 | } 13 | QT_END_NAMESPACE 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | Widget(QWidget *parent = nullptr); 21 | ~Widget(); 22 | 23 | private slots: 24 | void updateUI(unsigned int i); 25 | 26 | private: 27 | Ui::Widget *ui; 28 | 29 | QThread* thread; // 线程对象,计算任务会在在这个线程执行 30 | Work* work; // 包含耗时操作的对象 31 | }; 32 | #endif // WIDGET_H 33 | -------------------------------------------------------------------------------- /080_QThread/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 405 10 | 264 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | Start 34 | 35 | 36 | 37 | 38 | 39 | 40 | Stop 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /080_QThread/work.cpp: -------------------------------------------------------------------------------- 1 | #include "work.h" 2 | #include 3 | #include 4 | 5 | Work::Work(QObject *parent) 6 | : QObject{parent} 7 | {} 8 | 9 | /** 10 | * @brief Work::someWork 这个类只做计算,并将计算结果通过信号的方式发送到主线程 11 | * 此函数模拟一些耗时的算法 12 | */ 13 | void Work::someWork() 14 | { 15 | unsigned int i = 0; 16 | while (true) 17 | { 18 | emit signalUupdateUI(i); 19 | qDebug() << i; 20 | i++; 21 | 22 | QThread::msleep(10); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /080_QThread/work.h: -------------------------------------------------------------------------------- 1 | #ifndef WORK_H 2 | #define WORK_H 3 | 4 | #include 5 | 6 | class Work : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit Work(QObject *parent = nullptr); 11 | 12 | void someWork(); 13 | 14 | /* 通过信号调用父对象的 ui 刷新 */ 15 | signals: 16 | void signalUupdateUI(unsigned int i); 17 | }; 18 | 19 | #endif // WORK_H 20 | -------------------------------------------------------------------------------- /65_QtLogging/.gitignore: -------------------------------------------------------------------------------- 1 | # This file is used to ignore files which are generated 2 | # ---------------------------------------------------------------------------- 3 | 4 | *~ 5 | *.autosave 6 | *.a 7 | *.core 8 | *.moc 9 | *.o 10 | *.obj 11 | *.orig 12 | *.rej 13 | *.so 14 | *.so.* 15 | *_pch.h.cpp 16 | *_resource.rc 17 | *.qm 18 | .#* 19 | *.*# 20 | core 21 | !core/ 22 | tags 23 | .DS_Store 24 | .directory 25 | *.debug 26 | Makefile* 27 | *.prl 28 | *.app 29 | moc_*.cpp 30 | ui_*.h 31 | qrc_*.cpp 32 | Thumbs.db 33 | *.res 34 | *.rc 35 | /.qmake.cache 36 | /.qmake.stash 37 | 38 | # qtcreator generated files 39 | *.pro.user* 40 | CMakeLists.txt.user* 41 | 42 | # xemacs temporary files 43 | *.flc 44 | 45 | # Vim temporary files 46 | .*.swp 47 | 48 | # Visual Studio generated files 49 | *.ib_pdb_index 50 | *.idb 51 | *.ilk 52 | *.pdb 53 | *.sln 54 | *.suo 55 | *.vcproj 56 | *vcproj.*.*.user 57 | *.ncb 58 | *.sdf 59 | *.opensdf 60 | *.vcxproj 61 | *vcxproj.* 62 | 63 | # MinGW generated files 64 | *.Debug 65 | *.Release 66 | 67 | # Python byte code 68 | *.pyc 69 | 70 | # Binaries 71 | # -------- 72 | *.dll 73 | *.exe 74 | 75 | -------------------------------------------------------------------------------- /65_QtLogging/65_QtLogging.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | 7 | # You can make your code fail to compile if it uses deprecated APIs. 8 | # In order to do so, uncomment the following line. 9 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 10 | 11 | SOURCES += \ 12 | logger.cpp \ 13 | main.cpp \ 14 | widget.cpp 15 | 16 | HEADERS += \ 17 | logger.h \ 18 | widget.h 19 | 20 | FORMS += \ 21 | widget.ui 22 | 23 | # Default rules for deployment. 24 | qnx: target.path = /tmp/$${TARGET}/bin 25 | else: unix:!android: target.path = /opt/$${TARGET}/bin 26 | !isEmpty(target.path): INSTALLS += target 27 | -------------------------------------------------------------------------------- /65_QtLogging/log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/65_QtLogging/log -------------------------------------------------------------------------------- /65_QtLogging/logger.cpp: -------------------------------------------------------------------------------- 1 | #include "logger.h" 2 | #include 3 | #include 4 | 5 | 6 | QString Logger::_date = "yyyy-MM-dd hh:mm:ss"; // 默认日期格式 7 | QString Logger::_sep = " | "; // 默认分隔符 8 | QFile* Logger::_logFile = nullptr; 9 | bool Logger::_isInit = false; 10 | QHash Logger::_contextName = { 11 | {QtMsgType::QtDebugMsg, " Debug "}, 12 | {QtMsgType::QtInfoMsg, " Info "}, 13 | {QtMsgType::QtWarningMsg, "Warning "}, 14 | {QtMsgType::QtCriticalMsg, "Critical"}, 15 | {QtMsgType::QtFatalMsg, " Fatal "} 16 | }; 17 | 18 | /** 19 | * @brief Logger::init 初始化 logger 20 | * @param path log文件路径 21 | * @param date 日期格式 22 | * @param sep 分隔符 23 | */ 24 | void Logger::init(const QString &path, const QString &date, const QString &sep) 25 | { 26 | if (_isInit) return; 27 | 28 | _date = date; 29 | _sep = sep; 30 | 31 | _logFile = new QFile; 32 | _logFile->setFileName(path); 33 | if (!_logFile->open(QIODevice::Append | QIODevice::Text)) 34 | qDebug() << "[ERROR] Can not open file " << _logFile->errorString(); 35 | 36 | _logFile->resize(0); // 将文件的大小调整为0字节。如果 _logFile 已经关联到一个实际的文件,这会导致该文件的内容被清空,即删除所有已写入的数据 37 | 38 | // 自定义日志消息的处理方式,比如将日志发送到网络或格式化输出,这里告诉 Qt 所有log将使用我们的自定义函数处理 39 | qInstallMessageHandler(Logger::msgOutput); 40 | 41 | _isInit = true; 42 | } 43 | 44 | /** 45 | * @brief Logger::msgOutput 我们自定义的日志处理函数 46 | * @param type 47 | * @param context 48 | * @param msg 49 | */ 50 | void Logger::msgOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) 51 | { 52 | QTextStream stream(_logFile); 53 | stream << QDateTime::currentDateTime().toString(_date) 54 | << _sep << _contextName.value(type) 55 | << _sep << QString(context.file) // 文件名 56 | << _sep << QString(context.function).section('(', -2, -2).section(' ', -1).section(':', -1) // 函数名 57 | << _sep << QString::number(context.line) // 行号 58 | << _sep << msg 59 | << "\n"; 60 | 61 | _logFile->flush(); // 待写数据从缓冲区写入文件 62 | } 63 | 64 | 65 | void Logger::clean() 66 | { 67 | if (_logFile != nullptr) 68 | { 69 | _logFile->close(); 70 | delete _logFile; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /65_QtLogging/logger.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGGER_H 2 | #define LOGGER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | /** 9 | * @brief 基于单例模式的 Logger 类 10 | */ 11 | class Logger 12 | { 13 | public: 14 | static void init(const QString &path, const QString &date, const QString &sep); 15 | static void msgOutput(QtMsgType type, const QMessageLogContext& context, const QString& msg); 16 | static void clean(); 17 | 18 | private: 19 | static QFile* _logFile; // 日志文件指针 20 | static bool _isInit; // 是否初始化 21 | static QHash _contextName; // 日志级别和对应字符串 22 | static QString _date; // 日志中日期格式 23 | static QString _sep; // 日志中分隔符 24 | }; 25 | 26 | #endif // LOGGER_H 27 | -------------------------------------------------------------------------------- /65_QtLogging/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | #include 4 | #include 5 | 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | QLoggingCategory::setFilterRules("*.debug=false;"); // 设置日志级别 10 | 11 | QApplication a(argc, argv); 12 | 13 | qDebug() << "This debug message should not be shown."; 14 | qInfo() << "This info message will be shown."; 15 | 16 | widget w; 17 | w.show(); 18 | 19 | return a.exec(); 20 | } 21 | -------------------------------------------------------------------------------- /65_QtLogging/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include "logger.h" 4 | 5 | widget::widget(QWidget *parent) 6 | : QWidget(parent) 7 | , ui(new Ui::widget) 8 | { 9 | ui->setupUi(this); 10 | 11 | Logger::init("/Users/fox/雪狸的文件/Programma/Qt/65_QtLogging/log", "yyyy-MM-dd hh:mm:ss", " | "); // 初始化 Logger 12 | 13 | connect(ui->btnDebug, &QPushButton::clicked, this, &widget::onDebug); 14 | connect(ui->btnInfo, &QPushButton::clicked, this, &widget::onInfo); 15 | connect(ui->btnWarning, &QPushButton::clicked, this, &widget::onWarning); 16 | connect(ui->btnCritical, &QPushButton::clicked, this, &widget::onCritical); 17 | connect(ui->btnFatal, &QPushButton::clicked, this, &widget::onFatal); 18 | } 19 | 20 | widget::~widget() 21 | { 22 | Logger::clean(); 23 | delete ui; 24 | } 25 | 26 | void widget::onDebug() 27 | { 28 | qDebug() << "Debug Log: qDebug():用于输出调试信息"; 29 | } 30 | 31 | void widget::onInfo() 32 | { 33 | qInfo() << "Info Log: qInfo():用于输出一般信息"; 34 | } 35 | 36 | void widget::onWarning() 37 | { 38 | qWarning() << "Warning Log: qWarning():用于输出警告信息"; 39 | } 40 | 41 | void widget::onCritical() 42 | { 43 | qCritical() << "Critical Log: qCritical():用于输出严重错误信息"; 44 | } 45 | 46 | void widget::onFatal() 47 | { 48 | qFatal("Fatal Log! qFatal():用于输出致命错误信息,并且会终止程序"); // 注意,Fatal 是稍微有些不同的 49 | } 50 | 51 | -------------------------------------------------------------------------------- /65_QtLogging/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class widget; } 8 | QT_END_NAMESPACE 9 | 10 | class widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | widget(QWidget *parent = nullptr); 16 | ~widget(); 17 | 18 | void onDebug(); 19 | void onInfo(); 20 | void onWarning(); 21 | void onCritical(); 22 | void onFatal(); 23 | 24 | private: 25 | Ui::widget *ui; 26 | }; 27 | #endif // WIDGET_H 28 | -------------------------------------------------------------------------------- /65_QtLogging/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 163 10 | 217 11 | 12 | 13 | 14 | widget 15 | 16 | 17 | 18 | 19 | 20 | Debug 21 | 22 | 23 | 24 | 25 | 26 | 27 | Info 28 | 29 | 30 | 31 | 32 | 33 | 34 | Warning 35 | 36 | 37 | 38 | 39 | 40 | 41 | Critical 42 | 43 | 44 | 45 | 46 | 47 | 48 | Fatal 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /doc/.$json.drawio.bkp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/.DS_Store -------------------------------------------------------------------------------- /doc/img/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/.DS_Store -------------------------------------------------------------------------------- /doc/img/09784656-31f1-4aba-ac38-30ec71d92381.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/09784656-31f1-4aba-ac38-30ec71d92381.png -------------------------------------------------------------------------------- /doc/img/24e43539-b0f8-4f91-b5c3-c8aa3d37d739.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/24e43539-b0f8-4f91-b5c3-c8aa3d37d739.png -------------------------------------------------------------------------------- /doc/img/34dfc396-25d4-4aa6-b3fc-86b3cc1dbe5a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/34dfc396-25d4-4aa6-b3fc-86b3cc1dbe5a.png -------------------------------------------------------------------------------- /doc/img/3f2ff1ec-225f-482f-8382-324c193748a7-1311573.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/3f2ff1ec-225f-482f-8382-324c193748a7-1311573.png -------------------------------------------------------------------------------- /doc/img/8ed42c6f-df0f-459f-a29d-692cd7a0cd04-1311573.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/8ed42c6f-df0f-459f-a29d-692cd7a0cd04-1311573.png -------------------------------------------------------------------------------- /doc/img/d3f1e4f8-b7c8-4c9a-8f54-43b435d9bc13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/d3f1e4f8-b7c8-4c9a-8f54-43b435d9bc13.png -------------------------------------------------------------------------------- /doc/img/d98f4e88-7fdd-470a-89d5-4f7efac2936a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/d98f4e88-7fdd-470a-89d5-4f7efac2936a.png -------------------------------------------------------------------------------- /doc/img/e51742a2-963d-43e8-af70-6629c893ad24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/e51742a2-963d-43e8-af70-6629c893ad24.png -------------------------------------------------------------------------------- /doc/img/f6fdb606-c539-4b68-8da2-9c6ba6d3c615.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/f6fdb606-c539-4b68-8da2-9c6ba6d3c615.png -------------------------------------------------------------------------------- /doc/img/iShot_2024-04-03_11.45.14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/iShot_2024-04-03_11.45.14.jpg -------------------------------------------------------------------------------- /doc/img/iShot_2024-11-24_20.20.56.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/iShot_2024-11-24_20.20.56.jpg -------------------------------------------------------------------------------- /doc/img/image-20221203140013717.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20221203140013717.png -------------------------------------------------------------------------------- /doc/img/image-20221203140151611.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20221203140151611.png -------------------------------------------------------------------------------- /doc/img/image-20221203140946678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20221203140946678.png -------------------------------------------------------------------------------- /doc/img/image-20221203141237375.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20221203141237375.png -------------------------------------------------------------------------------- /doc/img/image-20221203141501241.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20221203141501241.png -------------------------------------------------------------------------------- /doc/img/image-20221203141508675.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20221203141508675.png -------------------------------------------------------------------------------- /doc/img/image-20221203144419409.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20221203144419409.png -------------------------------------------------------------------------------- /doc/img/image-20221203150537882.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20221203150537882.png -------------------------------------------------------------------------------- /doc/img/image-20240325000503738.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240325000503738.png -------------------------------------------------------------------------------- /doc/img/image-20240325002753950.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240325002753950.png -------------------------------------------------------------------------------- /doc/img/image-20240325003017933.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240325003017933.png -------------------------------------------------------------------------------- /doc/img/image-20240325003038151.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240325003038151.png -------------------------------------------------------------------------------- /doc/img/image-20240325003522709.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240325003522709.png -------------------------------------------------------------------------------- /doc/img/image-20240325183354563.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240325183354563.png -------------------------------------------------------------------------------- /doc/img/image-20240325183411935.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240325183411935.png -------------------------------------------------------------------------------- /doc/img/image-20240325235139974.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240325235139974.png -------------------------------------------------------------------------------- /doc/img/image-20240326001341260.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326001341260.png -------------------------------------------------------------------------------- /doc/img/image-20240326001614035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326001614035.png -------------------------------------------------------------------------------- /doc/img/image-20240326195248614.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326195248614.png -------------------------------------------------------------------------------- /doc/img/image-20240326195253843.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326195253843.png -------------------------------------------------------------------------------- /doc/img/image-20240326195259488.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326195259488.png -------------------------------------------------------------------------------- /doc/img/image-20240326195309350.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326195309350.png -------------------------------------------------------------------------------- /doc/img/image-20240326195926664.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326195926664.png -------------------------------------------------------------------------------- /doc/img/image-20240326195931201.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326195931201.png -------------------------------------------------------------------------------- /doc/img/image-20240326202432553.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326202432553.png -------------------------------------------------------------------------------- /doc/img/image-20240326203518643.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326203518643.png -------------------------------------------------------------------------------- /doc/img/image-20240326204108957.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326204108957.png -------------------------------------------------------------------------------- /doc/img/image-20240326211851885.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326211851885.png -------------------------------------------------------------------------------- /doc/img/image-20240326213453534.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240326213453534.png -------------------------------------------------------------------------------- /doc/img/image-20240329131140453.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329131140453.png -------------------------------------------------------------------------------- /doc/img/image-20240329145518924.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329145518924.png -------------------------------------------------------------------------------- /doc/img/image-20240329145624474.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329145624474.png -------------------------------------------------------------------------------- /doc/img/image-20240329150735713.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329150735713.png -------------------------------------------------------------------------------- /doc/img/image-20240329151740284.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329151740284.png -------------------------------------------------------------------------------- /doc/img/image-20240329151946808.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329151946808.png -------------------------------------------------------------------------------- /doc/img/image-20240329152032547.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329152032547.png -------------------------------------------------------------------------------- /doc/img/image-20240329152148484.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329152148484.png -------------------------------------------------------------------------------- /doc/img/image-20240329153805644.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329153805644.png -------------------------------------------------------------------------------- /doc/img/image-20240329154136420.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329154136420.png -------------------------------------------------------------------------------- /doc/img/image-20240329154244880.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329154244880.png -------------------------------------------------------------------------------- /doc/img/image-20240329154450058.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329154450058.png -------------------------------------------------------------------------------- /doc/img/image-20240329154656762.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329154656762.png -------------------------------------------------------------------------------- /doc/img/image-20240329154757499.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329154757499.png -------------------------------------------------------------------------------- /doc/img/image-20240329154940810.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240329154940810.png -------------------------------------------------------------------------------- /doc/img/image-20240401001433537.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240401001433537.png -------------------------------------------------------------------------------- /doc/img/image-20240401001602055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240401001602055.png -------------------------------------------------------------------------------- /doc/img/image-20240401001808089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240401001808089.png -------------------------------------------------------------------------------- /doc/img/image-20240401003902104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240401003902104.png -------------------------------------------------------------------------------- /doc/img/image-20240401004435488.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240401004435488.png -------------------------------------------------------------------------------- /doc/img/image-20240401230524193.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240401230524193.png -------------------------------------------------------------------------------- /doc/img/image-20240405152509022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405152509022.png -------------------------------------------------------------------------------- /doc/img/image-20240405165500501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405165500501.png -------------------------------------------------------------------------------- /doc/img/image-20240405213532227.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405213532227.png -------------------------------------------------------------------------------- /doc/img/image-20240405214901715.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405214901715.png -------------------------------------------------------------------------------- /doc/img/image-20240405221205641.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405221205641.png -------------------------------------------------------------------------------- /doc/img/image-20240405221338549.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405221338549.png -------------------------------------------------------------------------------- /doc/img/image-20240405222211747.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405222211747.png -------------------------------------------------------------------------------- /doc/img/image-20240405222533302.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405222533302.png -------------------------------------------------------------------------------- /doc/img/image-20240405224122531.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405224122531.png -------------------------------------------------------------------------------- /doc/img/image-20240405232202230.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240405232202230.png -------------------------------------------------------------------------------- /doc/img/image-20240409172336330.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240409172336330.png -------------------------------------------------------------------------------- /doc/img/image-20240409172608576.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240409172608576.png -------------------------------------------------------------------------------- /doc/img/image-20240409173503236.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240409173503236.png -------------------------------------------------------------------------------- /doc/img/image-20240409221830554.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240409221830554.png -------------------------------------------------------------------------------- /doc/img/image-20240409231412665.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240409231412665.png -------------------------------------------------------------------------------- /doc/img/image-20240426150510970.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240426150510970.png -------------------------------------------------------------------------------- /doc/img/image-20240426154344765.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240426154344765.png -------------------------------------------------------------------------------- /doc/img/image-20240428183403225.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240428183403225.png -------------------------------------------------------------------------------- /doc/img/image-20240925125502545.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20240925125502545.png -------------------------------------------------------------------------------- /doc/img/image-20241124190143627.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20241124190143627.png -------------------------------------------------------------------------------- /doc/img/image-20250608131126360.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20250608131126360.png -------------------------------------------------------------------------------- /doc/img/image-20250609133027146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20250609133027146.png -------------------------------------------------------------------------------- /doc/img/image-20250609133222368.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20250609133222368.png -------------------------------------------------------------------------------- /doc/img/image-20250609133435501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/img/image-20250609133435501.png -------------------------------------------------------------------------------- /doc/json.drawio: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /doc/pic/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/.DS_Store -------------------------------------------------------------------------------- /doc/pic/README/image-20221018121725084.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018121725084.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018125125119.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018125125119.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018130933834.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018130933834.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018160534346.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018160534346.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018162054408.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018162054408.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018170737986.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018170737986.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018170902491.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018170902491.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018171003019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018171003019.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018171522579.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018171522579.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018171651888.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018171651888.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018171743063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018171743063.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018172146656.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018172146656.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018172310863.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018172310863.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018172452507.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018172452507.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018173232309.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018173232309.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221018173318599.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221018173318599.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221128225157690.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221128225157690.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221128225354793.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221128225354793.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221128225405311.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221128225405311.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221128225428076.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221128225428076.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221128225434576.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221128225434576.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130145334893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130145334893.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130161212231.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130161212231.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130161456003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130161456003.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130161827092.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130161827092.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130162043745.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130162043745.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130162353685.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130162353685.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130163634192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130163634192.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130164311887.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130164311887.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130164629710.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130164629710.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130164712179.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130164712179.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130165040902.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130165040902.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130165149890.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130165149890.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130165204798.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130165204798.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130165733293.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130165733293.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130165745758.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130165745758.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130230942923.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130230942923.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221130233207709.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221130233207709.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221201110928964.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221201110928964.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221201111710072.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221201111710072.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221201111917031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221201111917031.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221201181634343.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221201181634343.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221201181640740.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221201181640740.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221201182133168.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221201182133168.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221201203516994.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221201203516994.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203135812710.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203135812710.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203140013717.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203140013717.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203140110110.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203140110110.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203140151611.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203140151611.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203140743369.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203140743369.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203140946678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203140946678.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203141237375.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203141237375.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203141501241.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203141501241.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203141508675.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203141508675.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203141650280.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203141650280.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203142009053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203142009053.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203144032185.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203144032185.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203144419409.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203144419409.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203144554453.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203144554453.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145348848.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145348848.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145456249.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145456249.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145525829.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145525829.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145607802.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145607802.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145609404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145609404.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145713706.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145713706.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145826876.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145826876.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145938500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145938500.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203145956363.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203145956363.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203150006693.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203150006693.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203150113188.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203150113188.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203150537882.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203150537882.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203150611547.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203150611547.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203150842960.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203150842960.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203150856557.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203150856557.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203155115323.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203155115323.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203155432229.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203155432229.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203155956762.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203155956762.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203161108507.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203161108507.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203162325641.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203162325641.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203163133452.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203163133452.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203163227138.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203163227138.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203163338502.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203163338502.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203163942809.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203163942809.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203164759843.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203164759843.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203164845827.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203164845827.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203165138558.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203165138558.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203171535255.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203171535255.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221203234539079.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221203234539079.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221204164809839.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221204164809839.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221204171416935.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221204171416935.png -------------------------------------------------------------------------------- /doc/pic/README/image-20221204182815217.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nekosilverfox/Qt/dcd0559cbefb6b9ff1afb1e1f5ed9f4c0f3e2430/doc/pic/README/image-20221204182815217.png --------------------------------------------------------------------------------