├── 3D move rotation ├── 3DTest.pro ├── 3DTest.pro.user ├── img │ └── 1cube.obj ├── main.cpp ├── resource.qrc ├── resources.qrc ├── widget.cpp ├── widget.h └── widget.ui ├── 3DScatter Demo ├── 3DTest.pro ├── 3DTest.pro.user ├── img │ └── oo.obj ├── main.cpp ├── resources.qrc ├── widget.cpp ├── widget.h └── widget.ui ├── AnimationTest1QML ├── FirstReadMe.txt ├── QMLAnimation.pro ├── QMLAnimation.pro.user ├── img │ ├── back.jpg │ ├── img.png │ └── img2.png ├── main.cpp ├── main.qml ├── main.qml.autosave └── qml.qrc ├── AudioDemo ├── AudioDemo.pro ├── AudioDemo.pro.user └── main.cpp ├── CSHack ├── CSHack.pro ├── CSHack.pro.user ├── CSHack.pro.user.4.8-pre1 ├── CSHack.sdf ├── CSHack.v11.suo ├── CSHack.vcxproj ├── CSHack.vcxproj.filters ├── CSHack.vcxproj.user ├── Debug │ ├── CSHack.exe │ ├── CSHack.ilk │ ├── CSHack.pdb │ ├── moc_widget.cpp │ └── moc_windowhand.cpp ├── GeneratedFiles │ └── ui_widget.h ├── Win32 │ └── Debug │ │ ├── CL.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── CSHack.lastbuildstate │ │ ├── CSHack.log │ │ ├── cl.command.1.tlog │ │ ├── custombuild.command.1.tlog │ │ ├── custombuild.read.1.tlog │ │ ├── custombuild.write.1.tlog │ │ ├── link-cvtres.read.1.tlog │ │ ├── link-cvtres.write.1.tlog │ │ ├── link-rc.read.1.tlog │ │ ├── link-rc.write.1.tlog │ │ ├── link.command.1.tlog │ │ ├── link.read.1.tlog │ │ ├── link.write.1.tlog │ │ ├── main.obj │ │ ├── moc_widget.obj │ │ ├── moc_windowhand.obj │ │ ├── vc110.pdb │ │ ├── widget.obj │ │ └── windowhand.obj ├── compile_commands.json ├── main.cpp ├── qxtglobalshortcut5-master.zip ├── qxtglobalshortcut5 │ ├── core │ │ ├── qxtglobal.cpp │ │ └── qxtglobal.h │ ├── gui │ │ ├── qxtglobalshortcut.cpp │ │ ├── qxtglobalshortcut.h │ │ ├── qxtglobalshortcut_mac.cpp │ │ ├── qxtglobalshortcut_p.h │ │ ├── qxtglobalshortcut_win.cpp │ │ ├── qxtglobalshortcut_x11.cpp │ │ ├── qxtwindowsystem.cpp │ │ ├── qxtwindowsystem.h │ │ ├── qxtwindowsystem_mac.cpp │ │ ├── qxtwindowsystem_mac.h │ │ ├── qxtwindowsystem_win.cpp │ │ ├── qxtwindowsystem_x11.cpp │ │ ├── x11info.cpp │ │ └── x11info.h │ ├── qxt.pri │ └── readme.md ├── widget.cpp ├── widget.h ├── widget.ui ├── windowhand.cpp └── windowhand.h ├── CompleterDemo ├── CompleterDemo.pro ├── CompleterDemo.pro.user ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── ConnectionTest ├── ConnectionTest.pro ├── ConnectionTest.pro.user ├── Demo1.cpp ├── Demo1.h ├── ReceClass.cpp ├── ReceClass.h └── main.cpp ├── Content-Security-Policy Of HTTP ├── FirstReadMe.txt ├── conf.ini ├── httpserver │ ├── httpconnectionhandler.cpp │ ├── httpconnectionhandler.h │ ├── httpconnectionhandlerpool.cpp │ ├── httpconnectionhandlerpool.h │ ├── httpcookie.cpp │ ├── httpcookie.h │ ├── httpglobal.cpp │ ├── httpglobal.h │ ├── httplistener.cpp │ ├── httplistener.h │ ├── httprequest.cpp │ ├── httprequest.h │ ├── httprequesthandler.cpp │ ├── httprequesthandler.h │ ├── httpresponse.cpp │ ├── httpresponse.h │ ├── httpserver.pri │ ├── httpsession.cpp │ ├── httpsession.h │ ├── httpsessionstore.cpp │ ├── httpsessionstore.h │ ├── myrequesthandler.cpp │ ├── myrequesthandler.h │ ├── staticfilecontroller.cpp │ └── staticfilecontroller.h ├── main.cpp ├── myrequesthandler.cpp ├── myrequesthandler.h ├── re │ ├── index.html │ └── pic.jpg ├── resources.qrc ├── useQtWebAPP.pro ├── useQtWebAPP.pro.user ├── widget.cpp ├── widget.h └── widget.ui ├── CookieHTTPDemo ├── CookieHTTPDemo.pro ├── CookieHTTPDemo.pro.user ├── FirstReadMe.txt ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── CrackMe_1 ├── CrackMe_1.pro ├── CrackMe_1.pro.user ├── Data.h ├── Widget.cpp ├── Widget.h ├── Widget.ui └── main.cpp ├── DPIWindows ├── DPIWindows.pro ├── DPIWindows.pro.user └── main.cpp ├── DealWithBigData ├── BigDataTest.cpp ├── BigDataTest.h ├── DealWithBigData.pro ├── DealWithBigData.pro.user ├── MySQLInstanc.cpp ├── MySQLInstanc.h ├── MySQLInstance.cpp ├── MySQLInstance.h └── main.cpp ├── DecoratorWidget ├── DecoratorWidget.pro ├── DecoratorWidget.pro.user ├── component.cpp ├── component.h ├── concretecomponent.cpp ├── concretecomponent.h ├── concretedecoratora.cpp ├── concretedecoratora.h ├── concretedecoratorb.cpp ├── concretedecoratorb.h ├── concretedecoratorc.cpp ├── concretedecoratorc.h ├── decorator.cpp ├── decorator.h ├── formadminintroduce.cpp ├── formadminintroduce.h ├── formadminintroduce.ui ├── formadminmodifypw.cpp ├── formadminmodifypw.h ├── formadminmodifypw.ui ├── formuserintroduce.cpp ├── formuserintroduce.h ├── formuserintroduce.ui ├── main.cpp ├── widget.cpp ├── widget.cpp.autosave ├── widget.h └── widget.ui ├── DocxToPdfDemo ├── DocxToPdfDemo.pro ├── DocxToPdfDemo.pro.user └── main.cpp ├── DrawHeart ├── DrawHeart.pro ├── DrawHeart.pro.user ├── Widget.cpp ├── Widget.h ├── Widget.ui └── main.cpp ├── EthernetNetWork ├── ARPDemo.pro ├── ARPDemo.pro.user └── main.cpp ├── FileDialogOfQML ├── FileDialogOfQML.pro ├── FileDialogOfQML.pro.user ├── FirstReadMe.txt ├── main.cpp ├── main.qml ├── resources.qrc ├── widget.cpp └── widget.h ├── GADGET_Demo ├── GADGET_Demo.pro ├── GADGET_Demo.pro.user ├── GadgetTest.cpp ├── GadgetTest.h └── main.cpp ├── GenerateRSAKeys ├── GenerateRSAKeys.pro ├── GenerateRSAKeys.pro.user └── main.cpp ├── HTTPCORSTest ├── FirstReadMe.txt ├── HTTPCORSTest.pro ├── HTTPCORSTest.pro.user ├── main.cpp ├── widget.cpp ├── widget.cpp.autosave ├── widget.h └── widget.ui ├── HTTPCache-ControlDemo ├── FirstReadMe.txt ├── HttpServer.pro ├── HttpServer.pro.user ├── main.cpp ├── widget.cpp ├── widget.cpp.autosave ├── widget.h └── widget.ui ├── HTTPLast-Modified ├── FirstReadMe.txt ├── HTTPLast-Modified.pro ├── HTTPLast-Modified.pro.user ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── HeightMapSurfaceDemo ├── HeightMapSurfaceDemo.pro ├── HeightMapSurfaceDemo.pro.user ├── img │ ├── Heightmap1.png │ ├── Heightmap2.png │ ├── Heightmap3.png │ └── Heightmap4.png ├── main.cpp ├── resource.qrc └── widget.cpp ├── IntegrateCPP&QML ├── Integrate.pro ├── Integrate.pro.user ├── backend.cpp ├── backend.h ├── itemmanager.cpp ├── itemmanager.h ├── main.cpp ├── main.qml └── qml.qrc ├── JavaScript Of QML Slide ├── FirstReadMe.txt ├── JavaScriptDemo2.pro ├── JavaScriptDemo2.pro.user ├── Test.js ├── Triangle.qml ├── main.cpp ├── main.qml └── qml.qrc ├── KeepAliveOfHTTP ├── FirstReadMe.txt ├── conf.ini ├── httpserver │ ├── httpconnectionhandler.cpp │ ├── httpconnectionhandler.h │ ├── httpconnectionhandlerpool.cpp │ ├── httpconnectionhandlerpool.h │ ├── httpcookie.cpp │ ├── httpcookie.h │ ├── httpglobal.cpp │ ├── httpglobal.h │ ├── httplistener.cpp │ ├── httplistener.h │ ├── httprequest.cpp │ ├── httprequest.h │ ├── httprequesthandler.cpp │ ├── httprequesthandler.h │ ├── httpresponse.cpp │ ├── httpresponse.h │ ├── httpserver.pri │ ├── httpsession.cpp │ ├── httpsession.h │ ├── httpsessionstore.cpp │ ├── httpsessionstore.h │ ├── myrequesthandler.cpp │ ├── myrequesthandler.h │ ├── staticfilecontroller.cpp │ └── staticfilecontroller.h ├── main.cpp ├── myrequesthandler.cpp ├── myrequesthandler.h ├── re │ ├── index.html │ └── pic.jpg ├── resources.qrc ├── useQtWebAPP.pro ├── useQtWebAPP.pro.user ├── widget.cpp ├── widget.h └── widget.ui ├── MysqlPageQt ├── SQLLIMIT.pro ├── SQLLIMIT.pro.user ├── main.cpp ├── mysql.sql ├── sql.cpp ├── sql.h ├── widget.cpp ├── widget.h └── widget.ui ├── OpenSSLDemo ├── OpenSSLDemo.pro ├── OpenSSLDemo.pro.user └── main.cpp ├── ParticleDemoAoutQML ├── FirstReadMe.txt ├── MyParticle.qml ├── MyParticleDemo.pro ├── MyParticleDemo.pro.user ├── img │ ├── bg.jpg │ └── star.png ├── main.cpp ├── main.qml ├── main.qml.autosave └── qml.qrc ├── ProcessList ├── ProcessList.pro ├── ProcessList.pro.user ├── main.cpp ├── thread.cpp ├── thread.h ├── widget.cpp ├── widget.h └── widget.ui ├── QHostInfoLookupDemo ├── FirstReadMe.txt ├── QHostInfoLookupDemo.pro ├── QHostInfoLookupDemo.pro.user ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── QLibraryDemo ├── qt_demo │ └── libraryDemo │ │ ├── DLL_C_Demo.dll │ │ ├── libraryDemo.pro │ │ ├── libraryDemo.pro.user │ │ └── main.cpp └── vs2015_dll │ ├── DLL_C_Demo.cpp │ ├── DLL_C_Demo.vcxproj │ ├── DLL_C_Demo.vcxproj.filters │ ├── ReadMe.txt │ ├── dllmain.cpp │ ├── myDll.cpp │ ├── myDll.h │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h ├── QML Style Of Button ├── FirstReadMe.txt ├── QMLPushButton.pro ├── QMLPushButton.pro.user ├── img │ ├── normal.png │ └── press.png ├── main.cpp ├── main.qml ├── qml.qrc └── resources.qrc ├── QMLLove ├── QMLLove.pro ├── QMLLove.pro.user ├── QMLLove.pro.user.a1a8977 ├── img │ └── love_PNG89.png ├── main.cpp ├── main.qml ├── note.txt └── qml.qrc ├── QMLSignal ├── Background.qml ├── BackgroundForm.ui.qml ├── Circle.qml ├── CircleForm.ui.qml ├── QMLSignal.pro ├── QMLSignal.pro.user ├── Receiver.qml ├── Sender.qml ├── main.cpp ├── main.qml └── qml.qrc ├── QMLWebEngineTest ├── MainForm.ui.qml ├── QMLWebEngineTest.pro ├── QMLWebEngineTest.pro.user ├── main.cpp ├── main.qml └── qml.qrc ├── QMapKeyCustom ├── QMapKeyCustom.pro ├── QMapKeyCustom.pro.user └── main.cpp ├── QPointerMutiThread ├── ProjectData.cpp ├── ProjectData.h ├── QPointerMutiThread.pro ├── QPointerMutiThread.pro.user ├── WorkerThread.cpp ├── WorkerThread.h └── main.cpp ├── QPortScanner ├── FirstReadMe.txt ├── WidgetInFace.pro ├── WidgetInFace.pro.user ├── img │ ├── close.png │ ├── close_hover.png │ ├── icon.png │ ├── icon_hover.png │ ├── min.png │ ├── min_hover.png │ └── myQSS.txt ├── main.cpp ├── mylabel.cpp ├── mylabel.h ├── mynetwork.cpp ├── mynetwork.h ├── resources.qrc ├── version.ico ├── version.rc ├── widget.cpp ├── widget.h └── widget.ui ├── QSslSocket_Two_Way_Ssl ├── SSLClient │ ├── QSSLClient.cpp │ ├── QSSLClient.cpp.autosave │ ├── QSSLClient.h │ ├── SSLClient.pro │ ├── SSLClient.pro.user │ ├── main.cpp │ ├── res │ │ └── p_client.p12 │ └── resources.qrc └── SSLServer │ ├── QSSLServer.cpp │ ├── QSSLServer.h │ ├── SSLServer.pro │ ├── SSLServer.pro.user │ ├── main.cpp │ ├── res │ └── p_server.p12 │ ├── resources.qrc │ └── 证书 │ ├── client.bat │ ├── client.cer │ ├── client.jks │ ├── client_trust.jks │ ├── p_client.p12 │ ├── p_server.p12 │ ├── server.bat │ ├── server.cer │ ├── server.jks │ └── server_trust.jks ├── QThreadPoolDemo ├── Com.cpp ├── Com.h ├── QThreadPoolDemo.pro ├── QThreadPoolDemo.pro.user ├── Woork.cpp ├── Woork.h └── main.cpp ├── QWebPage Qt5.5.1 ├── FirstReadMe.txt ├── QWebPage.pro ├── QWebPage.pro.user ├── build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug │ ├── Makefile │ ├── Makefile.Debug │ ├── Makefile.Release │ ├── debug │ │ ├── QWebPage.exe │ │ ├── QWebPage.exe.embed.manifest │ │ ├── QWebPage.exe_manifest.rc │ │ ├── QWebPage.exe_manifest.res │ │ ├── QWebPage.ilk │ │ ├── main.obj │ │ ├── moc_thumbnailer.cpp │ │ ├── moc_thumbnailer.obj │ │ ├── qwebpage.pdb │ │ └── thumbnailer.obj │ ├── original.png │ └── thumbnail.png ├── main.cpp ├── thumbnailer.cpp └── thumbnailer.h ├── QWebViewPageAndCookie ├── FirstReadMe.txt ├── LoginWeb.opensdf ├── LoginWeb.sln ├── LoginWeb.v11.suo ├── LoginWeb │ ├── Debug │ │ ├── CL.read.1.tlog │ │ ├── CL.write.1.tlog │ │ ├── LoginWeb.lastbuildstate │ │ ├── LoginWeb.log │ │ ├── LoginWeb.res │ │ ├── cl.command.1.tlog │ │ ├── custombuild.command.1.tlog │ │ ├── custombuild.read.1.tlog │ │ ├── custombuild.write.1.tlog │ │ ├── link-cvtres.read.1.tlog │ │ ├── link-cvtres.write.1.tlog │ │ ├── link-rc.read.1.tlog │ │ ├── link-rc.write.1.tlog │ │ ├── link.1656-cvtres.read.1.tlog │ │ ├── link.1656-cvtres.write.1.tlog │ │ ├── link.1656-rc.read.1.tlog │ │ ├── link.1656-rc.write.1.tlog │ │ ├── link.1656.read.1.tlog │ │ ├── link.1656.write.1.tlog │ │ ├── link.3496-cvtres.read.1.tlog │ │ ├── link.3496-cvtres.write.1.tlog │ │ ├── link.3496-rc.read.1.tlog │ │ ├── link.3496-rc.write.1.tlog │ │ ├── link.3496.read.1.tlog │ │ ├── link.3496.write.1.tlog │ │ ├── link.3760-cvtres.read.1.tlog │ │ ├── link.3760-cvtres.write.1.tlog │ │ ├── link.3760-rc.read.1.tlog │ │ ├── link.3760-rc.write.1.tlog │ │ ├── link.3760.read.1.tlog │ │ ├── link.3760.write.1.tlog │ │ ├── link.command.1.tlog │ │ ├── link.read.1.tlog │ │ ├── link.write.1.tlog │ │ ├── loginweb.obj │ │ ├── main.obj │ │ ├── moc_loginweb.obj │ │ ├── qrc_loginweb.obj │ │ ├── rc.command.1.tlog │ │ ├── rc.read.1.tlog │ │ ├── rc.write.1.tlog │ │ └── vc110.pdb │ ├── GeneratedFiles │ │ ├── Debug │ │ │ └── moc_loginweb.cpp │ │ ├── qrc_loginweb.cpp │ │ └── ui_loginweb.h │ ├── LoginWeb.ico │ ├── LoginWeb.rc │ ├── LoginWeb.vcxproj │ ├── LoginWeb.vcxproj.filters │ ├── LoginWeb.vcxproj.user │ ├── loginweb.cpp │ ├── loginweb.h │ ├── loginweb.qrc │ ├── loginweb.ui │ └── main.cpp └── Win32 │ └── Debug │ ├── LoginWeb.exe │ ├── LoginWeb.ilk │ └── LoginWeb.pdb ├── QWindowBase ├── QWindowBase.pro ├── QWindowBase.pro.user ├── main.cpp ├── widget.cpp ├── widget.h ├── widget.ui ├── window.cpp └── window.h ├── Q_ENUMDemo ├── EnumTest.cpp ├── EnumTest.h ├── Q_ENUMDemo.pro ├── Q_ENUMDemo.pro.user ├── main.cpp └── main.cpp.autosave ├── Qt3DLabel ├── Qt3DLabel.pro ├── Qt3DLabel.pro.user ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── QtWebSearchKey ├── QtWebSearchKey.pro ├── QtWebSearchKey.pro.user ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── QtWebSocketDemo ├── Server.cpp ├── Server.h ├── WebSocketDemo.pro ├── WebSocketDemo.pro.user ├── index.html └── main.cpp ├── QxOrmDemo1 ├── QxOrm │ └── QxOrm.pri ├── export.h ├── main.cpp ├── precompiled.h ├── qxDemo1.pro ├── qxDemo1.pro.user ├── user.cpp └── user.h ├── RSAEncryptionAndDecryption ├── RSAEncryptionAndDecryption.pro ├── RSAEncryptionAndDecryption.pro.user ├── main.cpp ├── private.pem └── public.pem ├── RTTRDemo ├── RTTRDemo.pro ├── librttr_core.so ├── librttr_core.so.0.9.5 └── main.cpp ├── RadioButtonQML ├── FirstReadMe.txt ├── RadioButtonTest.pro ├── RadioButtonTest.pro.user ├── main.cpp ├── main.qml └── qml.qrc ├── RedisWithQt ├── begin.pro ├── begin.pro.user └── main.cpp ├── ReflectDemo ├── ReflectDemo.pro ├── ReflectDemo.pro.user ├── ReflectTest.cpp ├── ReflectTest.h └── main.cpp ├── SemaphoreTest ├── Boss.cpp ├── Boss.h ├── SemaphoreTest.pro ├── SemaphoreTest.pro.user ├── Worker.cpp ├── Worker.h └── main.cpp ├── SimpleHttpServer ├── FirstReadMe.txt ├── HttpServer.pro ├── HttpServer.pro.user ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── SpritesOfQML ├── FirstReadMe.txt ├── img │ ├── bg.jpeg │ ├── soldier.png │ └── soldier.qml ├── main.cpp ├── main.qml ├── qml.qrc ├── soldier.qml ├── spritesDemo.pro └── spritesDemo.pro.user ├── StaticMetaObjectDemo ├── StaticMetaObjectDemo.pro ├── StaticMetaObjectDemo.pro.user ├── TestClass.cpp ├── TestClass.h └── main.cpp ├── TestFieldOfQML ├── FirstReadMe.txt ├── MyTextField.qml ├── MyTextField2.qml ├── TestFieldOfQML.lnk ├── TestFieldOfQML.pro ├── TestFieldOfQML.pro.user ├── img │ ├── textfield_1.png │ ├── textfield_2.png │ └── textfield_3.png ├── main.cpp ├── main.qml ├── mytextfield.qrc └── qml.qrc ├── TheRedirectOfHTTP ├── FirstReadMe.txt ├── conf.ini ├── httpserver │ ├── httpconnectionhandler.cpp │ ├── httpconnectionhandler.h │ ├── httpconnectionhandlerpool.cpp │ ├── httpconnectionhandlerpool.h │ ├── httpcookie.cpp │ ├── httpcookie.h │ ├── httpglobal.cpp │ ├── httpglobal.h │ ├── httplistener.cpp │ ├── httplistener.h │ ├── httprequest.cpp │ ├── httprequest.h │ ├── httprequesthandler.cpp │ ├── httprequesthandler.h │ ├── httpresponse.cpp │ ├── httpresponse.h │ ├── httpserver.pri │ ├── httpsession.cpp │ ├── httpsession.h │ ├── httpsessionstore.cpp │ ├── httpsessionstore.h │ ├── myrequesthandler.cpp │ ├── myrequesthandler.h │ ├── staticfilecontroller.cpp │ └── staticfilecontroller.h ├── main.cpp ├── myrequesthandler.cpp ├── myrequesthandler.h ├── re │ ├── index.html │ └── pic.jpg ├── resources.qrc ├── useQtWebAPP.pro ├── useQtWebAPP.pro.user ├── widget.cpp ├── widget.h └── widget.ui ├── UseQtWebAppFrame ├── FirstReadMe.txt ├── conf.ini ├── httpserver │ ├── httpconnectionhandler.cpp │ ├── httpconnectionhandler.h │ ├── httpconnectionhandlerpool.cpp │ ├── httpconnectionhandlerpool.h │ ├── httpcookie.cpp │ ├── httpcookie.h │ ├── httpglobal.cpp │ ├── httpglobal.h │ ├── httplistener.cpp │ ├── httplistener.h │ ├── httprequest.cpp │ ├── httprequest.h │ ├── httprequesthandler.cpp │ ├── httprequesthandler.h │ ├── httpresponse.cpp │ ├── httpresponse.h │ ├── httpserver.pri │ ├── httpsession.cpp │ ├── httpsession.h │ ├── httpsessionstore.cpp │ ├── httpsessionstore.h │ ├── myrequesthandler.cpp │ ├── myrequesthandler.h │ ├── staticfilecontroller.cpp │ └── staticfilecontroller.h ├── main.cpp ├── myrequesthandler.cpp ├── myrequesthandler.h ├── useQtWebAPP.pro ├── useQtWebAPP.pro.user ├── widget.cpp ├── widget.h └── widget.ui ├── WebEngineTest ├── WebEngineTest.pro ├── WebEngineTest.pro.user ├── Widget.cpp ├── Widget.h ├── Widget.ui └── main.cpp ├── WindowsPipe ├── pipe_client │ ├── main.cpp │ ├── pipe_client.pro │ └── pipe_client.pro.user └── pipe_server │ ├── main.cpp │ ├── pipe_server.pro │ └── pipe_server.pro.user ├── XorPic ├── Widget.cpp ├── Widget.h ├── Widget.ui ├── XorPic.pro ├── XorPic.pro.user ├── lbxx.jpeg ├── main.cpp ├── resource.qrc ├── tghg.png └── xor.png ├── checkPasswdOfOD ├── TraceMe.exe ├── checkPasswd.pro ├── checkPasswd.pro.user ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── getLANUser ├── FirstReadMe.txt ├── LANUser.pro ├── LANUser.pro.user ├── main.cpp ├── widget.cpp ├── widget.h └── widget.ui ├── keyQMLDemo ├── FirstReadMe.txt ├── Rect.qml ├── img │ └── bg.jpg ├── keyQMLDemo.pro ├── keyQMLDemo.pro.user ├── main.cpp ├── main.qml └── qml.qrc ├── pagingTable ├── FirstReadMe.txt ├── main.cpp ├── pagingTable.pro ├── pagingTable.pro.user ├── widget.cpp ├── widget.h └── widget.ui ├── probuffDemo ├── TestProtocStruMsg.pb.cc ├── TestProtocStruMsg.pb.h ├── file ├── main.cpp ├── probuffDemo.pro └── probuffDemo.pro.user ├── sharedLibrariesDemo ├── callLib │ ├── callLib.cpp │ ├── callLib.h │ ├── callLib.pro │ ├── callLib.pro.user │ ├── callLib.ui │ └── main.cpp └── libDemo │ ├── LibDemo.cpp │ ├── LibDemo.h │ ├── libDemo.pro │ ├── libDemo.pro.user │ └── libDemo_global.h ├── timestampDemo ├── FirstReadMe.txt ├── main.cpp ├── timestampDemo.pro ├── timestampDemo.pro.user ├── widget.cpp ├── widget.h └── widget.ui └── winscp_begin_in_Qt ├── ARPDemo.pro ├── ARPDemo.pro.user └── main.cpp /3D move rotation/3DTest.pro: -------------------------------------------------------------------------------- 1 | QT += core gui datavisualization qml quick 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | TARGET = 3DTest 6 | TEMPLATE = app 7 | 8 | DEFINES += QT_DEPRECATED_WARNINGS 9 | 10 | SOURCES += main.cpp\ 11 | widget.cpp 12 | 13 | HEADERS += widget.h 14 | 15 | FORMS += widget.ui 16 | 17 | RESOURCES += \ 18 | resource.qrc 19 | -------------------------------------------------------------------------------- /3D move rotation/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | 7 | QApplication a(argc, argv); 8 | 9 | Widget w; 10 | w.show(); 11 | 12 | return a.exec(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /3D move rotation/resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | img/1cube.obj 4 | 5 | 6 | -------------------------------------------------------------------------------- /3D move rotation/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | img/oo.obj 4 | img/1cube.obj 5 | img/2teddy.obj 6 | img/3cow.obj 7 | img/4bunny.obj 8 | img/5monkey.obj 9 | img/6man.obj 10 | img/7dinosaur.obj 11 | img/8mba.obj 12 | img/9porsche.obj 13 | img/10Lamborghini.obj 14 | img/11Boeing-MD-11.obj 15 | img/12atmo_fighter.obj 16 | img/13airplane.obj 17 | img/14AIRBOAT.OBJ 18 | img/15CESSNA.OBJ 19 | img/16FLAMINGO.OBJ 20 | img/17PORSCHE.OBJ 21 | img/18SHUTTLE.OBJ 22 | img/19X29.OBJ 23 | img/20Iron Man.obj 24 | 25 | 26 | -------------------------------------------------------------------------------- /3D move rotation/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class Widget; 9 | } 10 | 11 | QT_BEGIN_NAMESPACE 12 | class QTimer; 13 | QT_END_NAMESPACE 14 | 15 | using namespace QtDataVisualization; 16 | 17 | class Widget : public QWidget 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit Widget(QWidget *parent = 0); 23 | ~Widget(); 24 | QWidget *getWidgetContent(); 25 | 26 | protected: 27 | void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; 28 | 29 | private: 30 | Ui::Widget *ui; 31 | QTimer *m_timer; 32 | QTimer *m_rotationTimer; 33 | Q3DScatter *m_graph; 34 | }; 35 | 36 | #endif // WIDGET_H 37 | -------------------------------------------------------------------------------- /3D move rotation/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 606 10 | 491 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /3DScatter Demo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | 7 | QApplication a(argc, argv); 8 | 9 | Widget w; 10 | w.show(); 11 | 12 | return a.exec(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /3DScatter Demo/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | img/oo.obj 4 | 5 | 6 | -------------------------------------------------------------------------------- /3DScatter Demo/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = 0); 16 | ~Widget(); 17 | QWidget *getWidgetContent(); 18 | 19 | private: 20 | Ui::Widget *ui; 21 | }; 22 | 23 | #endif // WIDGET_H 24 | -------------------------------------------------------------------------------- /3DScatter Demo/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 606 10 | 491 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /AnimationTest1QML/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | My test about animation of qml. -------------------------------------------------------------------------------- /AnimationTest1QML/img/back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/AnimationTest1QML/img/back.jpg -------------------------------------------------------------------------------- /AnimationTest1QML/img/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/AnimationTest1QML/img/img.png -------------------------------------------------------------------------------- /AnimationTest1QML/img/img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/AnimationTest1QML/img/img2.png -------------------------------------------------------------------------------- /AnimationTest1QML/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | if (engine.rootObjects().isEmpty()) 13 | return -1; 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /AnimationTest1QML/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | img/img.png 5 | img/img2.png 6 | img/back.jpg 7 | 8 | 9 | -------------------------------------------------------------------------------- /AudioDemo/AudioDemo.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | QT += multimedia 3 | 4 | 5 | CONFIG += c++11 console 6 | CONFIG -= app_bundle 7 | 8 | # You can make your code fail to compile if it uses deprecated APIs. 9 | # In order to do so, uncomment the following line. 10 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 11 | 12 | SOURCES += \ 13 | main.cpp 14 | 15 | # Default rules for deployment. 16 | qnx: target.path = /tmp/$${TARGET}/bin 17 | else: unix:!android: target.path = /opt/$${TARGET}/bin 18 | !isEmpty(target.path): INSTALLS += target 19 | -------------------------------------------------------------------------------- /CSHack/CSHack.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-11-24T16:18:34 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | CONFIG += C++11 9 | 10 | include(qxtglobalshortcut5/qxt.pri) 11 | 12 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 13 | 14 | TARGET = CSHack 15 | TEMPLATE = app 16 | 17 | 18 | SOURCES += main.cpp\ 19 | widget.cpp \ 20 | windowhand.cpp 21 | 22 | HEADERS += widget.h \ 23 | windowhand.h 24 | 25 | FORMS += widget.ui 26 | -------------------------------------------------------------------------------- /CSHack/CSHack.sdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/CSHack.sdf -------------------------------------------------------------------------------- /CSHack/CSHack.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/CSHack.v11.suo -------------------------------------------------------------------------------- /CSHack/CSHack.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | D:\Qt5.5.1\5.5\msvc2012 6 | PATH=$(QTDIR)\bin%3b$(PATH) 7 | 8 | 9 | D:\Qt5.5.1\5.5\msvc2012 10 | PATH=$(QTDIR)\bin%3b$(PATH) 11 | 12 | -------------------------------------------------------------------------------- /CSHack/Debug/CSHack.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Debug/CSHack.exe -------------------------------------------------------------------------------- /CSHack/Debug/CSHack.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Debug/CSHack.ilk -------------------------------------------------------------------------------- /CSHack/Debug/CSHack.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Debug/CSHack.pdb -------------------------------------------------------------------------------- /CSHack/Win32/Debug/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/CL.read.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/CL.write.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/CSHack.lastbuildstate: -------------------------------------------------------------------------------- 1 | #v4.0:v110:false 2 | Debug|Win32|E:\Qt2019\CSHack\| 3 | -------------------------------------------------------------------------------- /CSHack/Win32/Debug/cl.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/cl.command.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/custombuild.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/custombuild.command.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/custombuild.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/custombuild.read.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/custombuild.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/custombuild.write.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/link-cvtres.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/link-cvtres.read.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/link-cvtres.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/link-cvtres.write.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/link-rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/link-rc.read.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/link-rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/link-rc.write.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/link.command.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/link.read.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/link.write.1.tlog -------------------------------------------------------------------------------- /CSHack/Win32/Debug/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/main.obj -------------------------------------------------------------------------------- /CSHack/Win32/Debug/moc_widget.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/moc_widget.obj -------------------------------------------------------------------------------- /CSHack/Win32/Debug/moc_windowhand.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/moc_windowhand.obj -------------------------------------------------------------------------------- /CSHack/Win32/Debug/vc110.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/vc110.pdb -------------------------------------------------------------------------------- /CSHack/Win32/Debug/widget.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/widget.obj -------------------------------------------------------------------------------- /CSHack/Win32/Debug/windowhand.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/Win32/Debug/windowhand.obj -------------------------------------------------------------------------------- /CSHack/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /CSHack/qxtglobalshortcut5-master.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/CSHack/qxtglobalshortcut5-master.zip -------------------------------------------------------------------------------- /CSHack/qxtglobalshortcut5/readme.md: -------------------------------------------------------------------------------- 1 | ### Qxt qxtglobalshortcut qt5 2 | --- 3 | 4 | [Qxt ](http://dev.libqxt.org/libqxt/wiki/Home) qxtglobalshortcut library qt5 compatibility 5 | Tested with qt5.4 on OSX 10.9.2, linux, windows (mingw and msvc) 6 | 7 | usage: 8 | 9 | ``` 10 | git clone https://github.com/ddqd/qxtglobalshortcut5.git 11 | ``` 12 | 13 | add in ur .pro file: 14 | ``` 15 | include(qxtglobalshortcut5/qxt.pri) 16 | ``` 17 | 18 | example code: 19 | ```cpp 20 | #include 21 | #include "qxtglobalshortcut.h" 22 | ... 23 | 24 | QxtGlobalShortcut *shortcut = new QxtGlobalShortcut(this); 25 | shortcut->setShortcut(QKeySequence("Shift+1")); 26 | connect(shortcut, &QxtGlobalShortcut::activated, 27 | [=]() {qDebug() << "shortcut activated";}); 28 | ``` 29 | -------------------------------------------------------------------------------- /CSHack/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class WindowHand; 7 | 8 | namespace Ui { 9 | class Widget; 10 | } 11 | 12 | class Widget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit Widget(QWidget *parent = 0); 18 | ~Widget(); 19 | 20 | protected: 21 | void setWidgetStatus(bool status); 22 | void timerEvent(QTimerEvent *event); 23 | 24 | protected slots: 25 | void setStatusString(bool status); 26 | 27 | private: 28 | Ui::Widget *ui; 29 | WindowHand *m_windowHand; 30 | }; 31 | 32 | #endif // WIDGET_H 33 | -------------------------------------------------------------------------------- /CSHack/windowhand.h: -------------------------------------------------------------------------------- 1 | #ifndef WINDOWHAND_H 2 | #define WINDOWHAND_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | class WindowHand : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | WindowHand(QObject *parent = 0); 14 | void moneyUnmatched(); 15 | void bloodUnmatched(); 16 | void shellUnmatched(); 17 | void bulletUnmatched(); 18 | void goUnmatched(); 19 | void grenadeUnmatched(); 20 | void recoilUnmatched(); 21 | 22 | signals: 23 | void windowsStatus(bool status); 24 | 25 | protected: 26 | void checkWindowsStatus(); 27 | void timerEvent(QTimerEvent *event); 28 | unsigned long readMemory(unsigned long base); 29 | void writeMemory(unsigned long base, unsigned long setValue); 30 | 31 | protected: 32 | HANDLE m_hand; 33 | }; 34 | 35 | #endif // WINDOWHAND_H 36 | -------------------------------------------------------------------------------- /CompleterDemo/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 | -------------------------------------------------------------------------------- /CompleterDemo/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 | QStringList wordList; 14 | wordList << "alpha" << "omega" << "omicron" << "zeta" << "中文" << "中文中文中文中文"; 15 | QCompleter *completer1 = new QCompleter(wordList, this); 16 | completer1->setCaseSensitivity(Qt::CaseInsensitive); 17 | ui->lineEdit->setCompleter(completer1); 18 | 19 | QCompleter *completer2 = new QCompleter(this); 20 | completer2->setModel(new QDirModel(completer2)); 21 | ui->lineEdit_2->setCompleter(completer2); 22 | 23 | for(int i = 0; completer1->setCurrentRow(i); i++){ 24 | 25 | qDebug() << completer1->currentCompletion() << " is match number " << i; 26 | } 27 | } 28 | 29 | Widget::~Widget() 30 | { 31 | delete ui; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /CompleterDemo/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 | -------------------------------------------------------------------------------- /CompleterDemo/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 297 10 | 64 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ConnectionTest/Demo1.cpp: -------------------------------------------------------------------------------- 1 | #include "Demo1.h" 2 | #include 3 | 4 | 5 | void Demo1::run() 6 | { 7 | for(int i = 0; i < 10; i++){ 8 | 9 | emit sendMsg(this->m_msg); 10 | qDebug() << "emit " << this->m_msg << " over"; 11 | } 12 | qDebug() << "msg:" << this->m_msg << " over"; 13 | } 14 | 15 | void Demo1::setMsg(const QString &msg) 16 | { 17 | this->m_msg = msg; 18 | } 19 | -------------------------------------------------------------------------------- /ConnectionTest/Demo1.h: -------------------------------------------------------------------------------- 1 | #ifndef DEMO1_H 2 | #define DEMO1_H 3 | 4 | #include 5 | 6 | class Demo1 : public QThread 7 | { 8 | Q_OBJECT 9 | void run() override; 10 | 11 | public: 12 | void setMsg(const QString &msg); 13 | 14 | signals: 15 | void sendMsg(QString msg); 16 | 17 | private: 18 | QString m_msg; 19 | }; 20 | 21 | #endif // DEMO1_H 22 | -------------------------------------------------------------------------------- /ConnectionTest/ReceClass.cpp: -------------------------------------------------------------------------------- 1 | #include "ReceClass.h" 2 | #include 3 | #include 4 | 5 | ReceClass::ReceClass(QObject *parent) : QObject(parent) 6 | { 7 | 8 | } 9 | 10 | void ReceClass::receMsg(QString msg) 11 | { 12 | qDebug() << "Get msg: " + msg; 13 | QThread::sleep(1); 14 | } 15 | -------------------------------------------------------------------------------- /ConnectionTest/ReceClass.h: -------------------------------------------------------------------------------- 1 | #ifndef RECECLASS_H 2 | #define RECECLASS_H 3 | 4 | #include 5 | 6 | class ReceClass : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit ReceClass(QObject *parent = nullptr); 11 | 12 | public slots: 13 | void receMsg(QString msg); 14 | }; 15 | 16 | #endif // RECECLASS_H 17 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | Content-Security-Policy Of HTTP -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/httpserver/httpglobal.cpp: -------------------------------------------------------------------------------- 1 | #include "httpglobal.h" 2 | 3 | const char* getQtWebAppLibVersion() 4 | { 5 | return "1.7.8"; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/httpserver/httpglobal.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file 3 | @author Stefan Frings 4 | */ 5 | 6 | #ifndef HTTPGLOBAL_H 7 | #define HTTPGLOBAL_H 8 | 9 | #include 10 | 11 | // This is specific to Windows dll's 12 | #if defined(Q_OS_WIN) 13 | #if defined(QTWEBAPPLIB_EXPORT) 14 | #define DECLSPEC Q_DECL_EXPORT 15 | #elif defined(QTWEBAPPLIB_IMPORT) 16 | #define DECLSPEC Q_DECL_IMPORT 17 | #endif 18 | #endif 19 | #if !defined(DECLSPEC) 20 | #define DECLSPEC 21 | #endif 22 | 23 | /** Get the library version number */ 24 | DECLSPEC const char* getQtWebAppLibVersion(); 25 | 26 | 27 | #endif // HTTPGLOBAL_H 28 | 29 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/httpserver/httprequesthandler.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | @file 3 | @author Stefan Frings 4 | */ 5 | 6 | #include "httprequesthandler.h" 7 | 8 | using namespace stefanfrings; 9 | 10 | HttpRequestHandler::HttpRequestHandler(QObject* parent) 11 | : QObject(parent) 12 | {} 13 | 14 | HttpRequestHandler::~HttpRequestHandler() 15 | {} 16 | 17 | void HttpRequestHandler::service(HttpRequest& request, HttpResponse& response) 18 | { 19 | qCritical("HttpRequestHandler: you need to override the service() function"); 20 | qDebug("HttpRequestHandler: request=%s %s %s",request.getMethod().data(),request.getPath().data(),request.getVersion().data()); 21 | response.setStatus(501,"not implemented"); 22 | response.write("501 not implemented",true); 23 | } 24 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/httpserver/myrequesthandler.cpp: -------------------------------------------------------------------------------- 1 | #include "myrequesthandler.h" 2 | 3 | MyRequestHandler::MyRequestHandler(QObject *parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/httpserver/myrequesthandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MYREQUESTHANDLER_H 2 | #define MYREQUESTHANDLER_H 3 | 4 | 5 | class MyRequestHandler 6 | { 7 | public: 8 | MyRequestHandler(); 9 | }; 10 | 11 | #endif // MYREQUESTHANDLER_H 12 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "httpserver/httplistener.h" 4 | #include "myrequesthandler.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | 10 | QSettings *listenerSettings=new QSettings("E:\\Qt2019\\useQtWebAPP\\conf.ini", QSettings::IniFormat, &a); 11 | listenerSettings->beginGroup("listener"); 12 | new HttpListener(listenerSettings, new MyRequestHandler, &a); 13 | 14 | 15 | return a.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/myrequesthandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MYREQUESTHANDLER_H 2 | #define MYREQUESTHANDLER_H 3 | 4 | #include "httpserver/httprequesthandler.h" 5 | using namespace stefanfrings; 6 | 7 | class MyRequestHandler: public HttpRequestHandler 8 | { 9 | Q_OBJECT 10 | public: 11 | MyRequestHandler(QObject* parent=nullptr); 12 | void service(HttpRequest& request, HttpResponse& response); 13 | }; 14 | 15 | #endif // MYREQUESTHANDLER_H 16 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/re/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | IT1995 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/re/pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/Content-Security-Policy Of HTTP/re/pic.jpg -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | re/index.html 4 | re/pic.jpg 5 | 6 | 7 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/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 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | 22 | #endif // WIDGET_H 23 | -------------------------------------------------------------------------------- /Content-Security-Policy Of HTTP/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /CookieHTTPDemo/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that the Cookie of HTTP. -------------------------------------------------------------------------------- /CookieHTTPDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /CookieHTTPDemo/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_HEADER 7 | class QTcpServer; 8 | class QTcpSocket; 9 | QT_END_NAMESPACE 10 | 11 | namespace Ui { 12 | class Widget; 13 | } 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit Widget(QWidget *parent = nullptr); 21 | ~Widget(); 22 | 23 | protected slots: 24 | void newConnectionSlot(); 25 | void errorStringSlot(); 26 | void btnClicked(); 27 | void sendMsg(); 28 | 29 | private: 30 | Ui::Widget *ui; 31 | QTcpServer *m_tcpServer; 32 | QTcpSocket *m_tcpSocket; 33 | }; 34 | 35 | #endif // WIDGET_H 36 | -------------------------------------------------------------------------------- /CookieHTTPDemo/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 282 10 | 41 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 有max-age 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /CrackMe_1/Data.h: -------------------------------------------------------------------------------- 1 | #ifndef DATA_H 2 | #define DATA_H 3 | 4 | static int resource = 10; 5 | 6 | #endif // DATA_H 7 | -------------------------------------------------------------------------------- /CrackMe_1/Widget.cpp: -------------------------------------------------------------------------------- 1 | #include "Widget.h" 2 | #include "ui_Widget.h" 3 | #include "Data.h" 4 | #include 5 | #include 6 | 7 | Widget::Widget(QWidget *parent) 8 | : QWidget(parent) 9 | , ui(new Ui::Widget) 10 | { 11 | ui->setupUi(this); 12 | ui->label->setText(QString::number(resource)); 13 | this->setWindowTitle("crackMe_1"); 14 | startTimer(1000); 15 | 16 | qDebug() << "resource address:" << &resource; 17 | } 18 | 19 | void Widget::timerEvent(QTimerEvent *event) 20 | { 21 | Q_UNUSED(event) 22 | 23 | if(resource <= 0){ 24 | 25 | QMessageBox::information(this, "title", "game over"); 26 | exit(-1); 27 | } 28 | 29 | ui->label->setText(QString::number(--resource)); 30 | } 31 | 32 | Widget::~Widget() 33 | { 34 | delete ui; 35 | } 36 | 37 | -------------------------------------------------------------------------------- /CrackMe_1/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 | void timerEvent(QTimerEvent *event); 17 | ~Widget(); 18 | 19 | private: 20 | Ui::Widget *ui; 21 | }; 22 | #endif // WIDGET_H 23 | -------------------------------------------------------------------------------- /CrackMe_1/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 | -------------------------------------------------------------------------------- /DPIWindows/DPIWindows.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 console 4 | CONFIG -= app_bundle 5 | 6 | # You can make your code fail to compile if it uses deprecated APIs. 7 | # In order to do so, uncomment the following line. 8 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 9 | 10 | SOURCES += \ 11 | main.cpp 12 | 13 | INCLUDEPATH += D:/DM/DM/source/drivers/dpi/include 14 | LIBS += -LD:/DM/DM/source/drivers/dpi -ldmdpi 15 | 16 | # Default rules for deployment. 17 | qnx: target.path = /tmp/$${TARGET}/bin 18 | else: unix:!android: target.path = /opt/$${TARGET}/bin 19 | !isEmpty(target.path): INSTALLS += target 20 | -------------------------------------------------------------------------------- /DealWithBigData/BigDataTest.cpp: -------------------------------------------------------------------------------- 1 | #include "BigDataTest.h" 2 | #include "MySQLInstance.h" 3 | #include 4 | #include 5 | #include 6 | 7 | BigDataTest::BigDataTest(QObject *parent) : QObject(parent) 8 | { 9 | 10 | m_str << "SELECT 1 + 1" << "SELECT 100 * 100 * 100 / 10" << "SELECT 100 + 99" << "SELECT 1 + 1" 11 | << "SELECT 1 + 1 + 500" << "SELECT 1 + 1 + 1000" << "SELECT 1999 - 199" << "SELECT 1999 + 10" 12 | << "SELECT 1 + 1 + 8888" << "SELECT 1 + 1 + 788"; 13 | } 14 | 15 | QString sqlResult(const QString &cmd) 16 | { 17 | qDebug() << "处理SQL语句进程 : " << QThread::currentThread(); 18 | MySQLInstance *instance = MySQLInstance::getInstance(); 19 | return instance->execSql(cmd); 20 | } 21 | 22 | 23 | void BigDataTest::run() 24 | { 25 | QList retList = QtConcurrent::blockingMapped(m_str, sqlResult); 26 | qDebug() << "返回结果"; 27 | qDebug() << retList; 28 | } 29 | -------------------------------------------------------------------------------- /DealWithBigData/BigDataTest.h: -------------------------------------------------------------------------------- 1 | #ifndef CONCURRENT_H 2 | #define CONCURRENT_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | class BigDataTest : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | BigDataTest(QObject *parent = 0); 13 | void run(); 14 | 15 | protected: 16 | bool connectMySQL(); 17 | friend QString sqlResult(const QString &cmd); 18 | 19 | private: 20 | QList m_str; 21 | }; 22 | 23 | #endif // CONCURRENT_H 24 | -------------------------------------------------------------------------------- /DealWithBigData/MySQLInstanc.cpp: -------------------------------------------------------------------------------- 1 | #include "MySQLInstanc.h" 2 | 3 | MySQLInstance::MySQLInstance(QObject *parent) : QObject(parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /DealWithBigData/MySQLInstanc.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQLINSTANC_H 2 | #define MYSQLINSTANC_H 3 | 4 | 5 | class MySQLInstance 6 | { 7 | public: 8 | MySQLInstance(); 9 | 10 | }; 11 | 12 | #endif // MYSQLINSTANC_H 13 | -------------------------------------------------------------------------------- /DealWithBigData/MySQLInstance.h: -------------------------------------------------------------------------------- 1 | #ifndef MYSQLINSTANCE_H 2 | #define MYSQLINSTANCE_H 3 | 4 | #include 5 | 6 | class MySQLInstance 7 | { 8 | public: 9 | static MySQLInstance *getInstance(); 10 | QString execSql(const QString &cmd); 11 | 12 | protected: 13 | MySQLInstance(); 14 | void connectMySQL(); 15 | 16 | private: 17 | static MySQLInstance *m_instance; 18 | QSqlDatabase m_db; 19 | }; 20 | 21 | #endif // MYSQLINSTANCE_H 22 | -------------------------------------------------------------------------------- /DealWithBigData/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "BigDataTest.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication a(argc, argv); 7 | 8 | BigDataTest bigDataTest; 9 | bigDataTest.run(); 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /DecoratorWidget/component.cpp: -------------------------------------------------------------------------------- 1 | #include "component.h" 2 | 3 | 4 | void Component::processOperation(QWidget *page) 5 | { 6 | Q_UNUSED(page) 7 | } 8 | 9 | Component::Component() 10 | { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /DecoratorWidget/component.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPONENT_H 2 | #define COMPONENT_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QWidget; 8 | QT_END_NAMESPACE 9 | 10 | class Component 11 | { 12 | public: 13 | virtual void processOperation(QWidget *page = nullptr); 14 | 15 | protected: 16 | Component(); 17 | }; 18 | 19 | #endif // COMPONENT_H 20 | -------------------------------------------------------------------------------- /DecoratorWidget/concretecomponent.cpp: -------------------------------------------------------------------------------- 1 | #include "concretecomponent.h" 2 | #include 3 | #include 4 | #include 5 | 6 | ConcreteComponent::ConcreteComponent() 7 | { 8 | m_tabWidget = nullptr; 9 | } 10 | 11 | void ConcreteComponent::processOperation(QWidget *page) 12 | { 13 | if(page == nullptr && m_tabWidget == nullptr) 14 | return; 15 | 16 | qDebug() << "add admin widget"; 17 | m_tabWidget->addTab(page, page->windowTitle()); 18 | } 19 | 20 | void ConcreteComponent::setTabWidget(QTabWidget *tabWidget) 21 | { 22 | m_tabWidget = tabWidget; 23 | } 24 | -------------------------------------------------------------------------------- /DecoratorWidget/concretecomponent.h: -------------------------------------------------------------------------------- 1 | #ifndef CONCRETECOMPONENT_H 2 | #define CONCRETECOMPONENT_H 3 | 4 | #include "component.h" 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QTabWidget; 8 | QT_END_NAMESPACE 9 | 10 | 11 | class ConcreteComponent: public Component 12 | { 13 | public: 14 | ConcreteComponent(); 15 | void processOperation(QWidget *page = nullptr); 16 | void setTabWidget(QTabWidget *tabWidget); 17 | 18 | private: 19 | QTabWidget *m_tabWidget; 20 | }; 21 | 22 | #endif // CONCRETECOMPONENT_H 23 | -------------------------------------------------------------------------------- /DecoratorWidget/concretedecoratora.cpp: -------------------------------------------------------------------------------- 1 | #include "concretedecoratora.h" 2 | #include "formadminintroduce.h" 3 | #include 4 | 5 | ConcreteDecoratorA::ConcreteDecoratorA() 6 | { 7 | 8 | } 9 | 10 | 11 | void ConcreteDecoratorA::processOperation(QWidget *page) 12 | { 13 | Q_UNUSED(page) 14 | 15 | qDebug() << "ConcreteDecoratorA processOperation called!" << this; 16 | FormAdminIntroduce *adminForm = new FormAdminIntroduce; 17 | Decorator::processOperation(adminForm); 18 | } 19 | -------------------------------------------------------------------------------- /DecoratorWidget/concretedecoratora.h: -------------------------------------------------------------------------------- 1 | #ifndef CONCRETEDECORATORA_H 2 | #define CONCRETEDECORATORA_H 3 | 4 | #include "decorator.h" 5 | 6 | class ConcreteDecoratorA: public Decorator 7 | { 8 | public: 9 | ConcreteDecoratorA(); 10 | void processOperation(QWidget *page = nullptr); 11 | }; 12 | 13 | #endif // CONCRETEDECORATORA_H 14 | -------------------------------------------------------------------------------- /DecoratorWidget/concretedecoratorb.cpp: -------------------------------------------------------------------------------- 1 | #include "concretedecoratorb.h" 2 | #include "formadminmodifypw.h" 3 | #include 4 | 5 | ConcreteDecoratorB::ConcreteDecoratorB() 6 | { 7 | 8 | } 9 | 10 | void ConcreteDecoratorB::processOperation(QWidget *page) 11 | { 12 | Q_UNUSED(page) 13 | qDebug() << "ConcreteDecoratorB processOperation called!" << this; 14 | FormAdminModifyPW *adminForm = new FormAdminModifyPW; 15 | Decorator::processOperation(adminForm); 16 | } 17 | -------------------------------------------------------------------------------- /DecoratorWidget/concretedecoratorb.h: -------------------------------------------------------------------------------- 1 | #ifndef CONCRETEDECORATORB_H 2 | #define CONCRETEDECORATORB_H 3 | 4 | #include "decorator.h" 5 | 6 | class ConcreteDecoratorB: public Decorator 7 | { 8 | public: 9 | ConcreteDecoratorB(); 10 | void processOperation(QWidget *page = nullptr); 11 | }; 12 | 13 | #endif // CONCRETEDECORATORB_H 14 | -------------------------------------------------------------------------------- /DecoratorWidget/concretedecoratorc.cpp: -------------------------------------------------------------------------------- 1 | #include "concretedecoratorc.h" 2 | #include "formuserintroduce.h" 3 | #include 4 | 5 | ConcreteDecoratorC::ConcreteDecoratorC() 6 | { 7 | 8 | } 9 | 10 | void ConcreteDecoratorC::processOperation(QWidget *page) 11 | { 12 | Q_UNUSED(page) 13 | qDebug() << "ConcreteDecoratorC processOperation called!" << this; 14 | FormUserIntroduce *user = new FormUserIntroduce; 15 | Decorator::processOperation(user); 16 | } 17 | -------------------------------------------------------------------------------- /DecoratorWidget/concretedecoratorc.h: -------------------------------------------------------------------------------- 1 | #ifndef CONCRETEDECORATORC_H 2 | #define CONCRETEDECORATORC_H 3 | 4 | #include "decorator.h" 5 | 6 | class ConcreteDecoratorC: public Decorator 7 | { 8 | public: 9 | ConcreteDecoratorC(); 10 | void processOperation(QWidget *page = nullptr); 11 | }; 12 | 13 | #endif // CONCRETEDECORATORC_H 14 | -------------------------------------------------------------------------------- /DecoratorWidget/decorator.cpp: -------------------------------------------------------------------------------- 1 | #include "decorator.h" 2 | #include 3 | #include 4 | 5 | Decorator::Decorator() 6 | { 7 | m_component = nullptr; 8 | } 9 | 10 | void Decorator::setComponent(Component *component) 11 | { 12 | m_component = component; 13 | processOperation(); 14 | } 15 | 16 | void Decorator::processOperation(QWidget *page) 17 | { 18 | if(page == nullptr) 19 | return; 20 | 21 | qDebug() << "Decorator processOperation called!" << m_component; 22 | 23 | m_component->processOperation(page); 24 | } 25 | -------------------------------------------------------------------------------- /DecoratorWidget/decorator.h: -------------------------------------------------------------------------------- 1 | #ifndef DECORATOR_H 2 | #define DECORATOR_H 3 | 4 | #include "component.h" 5 | 6 | class Decorator: public Component 7 | { 8 | public: 9 | Decorator(); 10 | void setComponent(Component *component); 11 | void processOperation(QWidget *page = nullptr); 12 | 13 | private: 14 | Component *m_component; 15 | }; 16 | 17 | #endif // DECORATOR_H 18 | -------------------------------------------------------------------------------- /DecoratorWidget/formadminintroduce.cpp: -------------------------------------------------------------------------------- 1 | #include "formadminintroduce.h" 2 | #include "ui_formadminintroduce.h" 3 | 4 | FormAdminIntroduce::FormAdminIntroduce(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::FormAdminIntroduce) 7 | { 8 | ui->setupUi(this); 9 | this->setWindowTitle("管理员门户界面"); 10 | } 11 | 12 | FormAdminIntroduce::~FormAdminIntroduce() 13 | { 14 | delete ui; 15 | } 16 | -------------------------------------------------------------------------------- /DecoratorWidget/formadminintroduce.h: -------------------------------------------------------------------------------- 1 | #ifndef FORMADMININTRODUCE_H 2 | #define FORMADMININTRODUCE_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class FormAdminIntroduce; 8 | } 9 | 10 | class FormAdminIntroduce : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | FormAdminIntroduce(QWidget *parent = nullptr); 16 | ~FormAdminIntroduce(); 17 | 18 | private: 19 | Ui::FormAdminIntroduce *ui; 20 | }; 21 | 22 | #endif // FORMADMININTRODUCE_H 23 | -------------------------------------------------------------------------------- /DecoratorWidget/formadminmodifypw.cpp: -------------------------------------------------------------------------------- 1 | #include "formadminmodifypw.h" 2 | #include "ui_formadminmodifypw.h" 3 | 4 | FormAdminModifyPW::FormAdminModifyPW(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::FormAdminModifyPW) 7 | { 8 | ui->setupUi(this); 9 | this->setWindowTitle("修改管理员密码"); 10 | } 11 | 12 | FormAdminModifyPW::~FormAdminModifyPW() 13 | { 14 | delete ui; 15 | } 16 | -------------------------------------------------------------------------------- /DecoratorWidget/formadminmodifypw.h: -------------------------------------------------------------------------------- 1 | #ifndef FORMADMINMODIFYPW_H 2 | #define FORMADMINMODIFYPW_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class FormAdminModifyPW; 8 | } 9 | 10 | class FormAdminModifyPW : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit FormAdminModifyPW(QWidget *parent = nullptr); 16 | ~FormAdminModifyPW(); 17 | 18 | private: 19 | Ui::FormAdminModifyPW *ui; 20 | }; 21 | 22 | #endif // FORMADMINMODIFYPW_H 23 | -------------------------------------------------------------------------------- /DecoratorWidget/formuserintroduce.cpp: -------------------------------------------------------------------------------- 1 | #include "formuserintroduce.h" 2 | #include "ui_formuserintroduce.h" 3 | 4 | FormUserIntroduce::FormUserIntroduce(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::FormUserIntroduce) 7 | { 8 | ui->setupUi(this); 9 | this->setWindowTitle("用户简介"); 10 | } 11 | 12 | FormUserIntroduce::~FormUserIntroduce() 13 | { 14 | delete ui; 15 | } 16 | -------------------------------------------------------------------------------- /DecoratorWidget/formuserintroduce.h: -------------------------------------------------------------------------------- 1 | #ifndef FORMUSERINTRODUCE_H 2 | #define FORMUSERINTRODUCE_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class FormUserIntroduce; 8 | } 9 | 10 | class FormUserIntroduce : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit FormUserIntroduce(QWidget *parent = nullptr); 16 | ~FormUserIntroduce(); 17 | 18 | private: 19 | Ui::FormUserIntroduce *ui; 20 | }; 21 | 22 | #endif // FORMUSERINTRODUCE_H 23 | -------------------------------------------------------------------------------- /DecoratorWidget/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /DecoratorWidget/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class ConcreteComponent; 7 | class ConcreteDecoratorA; 8 | class ConcreteDecoratorB; 9 | class ConcreteDecoratorC; 10 | 11 | namespace Ui { 12 | class Widget; 13 | } 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | Widget(QWidget *parent = nullptr); 21 | ~Widget(); 22 | 23 | private: 24 | Ui::Widget *ui; 25 | ConcreteComponent *m_admin; 26 | ConcreteComponent *m_user; 27 | 28 | ConcreteDecoratorA *m_a; //管理员信息模块 29 | ConcreteDecoratorB *m_b; //管理员修改密码模块 30 | ConcreteDecoratorC *m_c; //用户模块 31 | ConcreteDecoratorC *m_d; 32 | }; 33 | 34 | #endif // WIDGET_H 35 | -------------------------------------------------------------------------------- /DocxToPdfDemo/DocxToPdfDemo.pro: -------------------------------------------------------------------------------- 1 | QT += axcontainer gui widgets 2 | 3 | CONFIG += c++11 console 4 | CONFIG -= app_bundle 5 | 6 | # You can make your code fail to compile if it uses deprecated APIs. 7 | # In order to do so, uncomment the following line. 8 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 9 | 10 | SOURCES += \ 11 | main.cpp 12 | 13 | # Default rules for deployment. 14 | qnx: target.path = /tmp/$${TARGET}/bin 15 | else: unix:!android: target.path = /opt/$${TARGET}/bin 16 | !isEmpty(target.path): INSTALLS += target 17 | -------------------------------------------------------------------------------- /DrawHeart/DrawHeart.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++11 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 | -------------------------------------------------------------------------------- /DrawHeart/Widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class QGraphicsScene; 7 | 8 | QT_BEGIN_NAMESPACE 9 | namespace Ui { class Widget; } 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 | protected: 21 | void drawCricle(int x, int y, int height, int width, int startAngle, int endAngle); 22 | void drawPolygon(); 23 | 24 | private: 25 | Ui::Widget *ui; 26 | QGraphicsScene *m_scene; 27 | }; 28 | #endif // WIDGET_H 29 | -------------------------------------------------------------------------------- /DrawHeart/Widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1015 10 | 716 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DrawHeart/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 | -------------------------------------------------------------------------------- /EthernetNetWork/ARPDemo.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 console 4 | CONFIG -= app_bundle 5 | 6 | DEFINES += QT_DEPRECATED_WARNINGS 7 | 8 | SOURCES += \ 9 | main.cpp 10 | 11 | qnx: target.path = /tmp/$${TARGET}/bin 12 | else: unix:!android: target.path = /opt/$${TARGET}/bin 13 | !isEmpty(target.path): INSTALLS += target 14 | 15 | INCLUDEPATH += D:/winscp/WpdPack/Include 16 | LIBS += -L D:/winscp/WpdPack/Lib/libpacket.a \ 17 | -L D:/winscp/WpdPack/Lib/libwpcap.a 18 | -------------------------------------------------------------------------------- /FileDialogOfQML/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project demonstrates how to use FileDialog QML Type. -------------------------------------------------------------------------------- /FileDialogOfQML/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | 10 | QQuickWindow::setDefaultAlphaBuffer(true); 11 | QQmlApplicationEngine engine(QUrl("qrc:/main.qml")); 12 | 13 | return a.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /FileDialogOfQML/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | import QtQuick.Dialogs 1.0 3 | import QtQuick.Window 2.1 4 | 5 | Window { 6 | 7 | FileDialog { 8 | 9 | id: fileDialog 10 | title: "Please choose a file" 11 | folder: shortcuts.home 12 | selectFolder: true 13 | onAccepted: { 14 | 15 | console.log("You chose: " + fileDialog.fileUrls) 16 | Qt.quit() 17 | } 18 | 19 | onRejected: { 20 | 21 | console.log("Canceled") 22 | Qt.quit() 23 | } 24 | //Component.onCompleted: visible = true 25 | } 26 | 27 | id: root 28 | visible: true 29 | width: 1024 30 | height: 768 31 | color: "black" 32 | 33 | Component.onCompleted: fileDialog.open() 34 | } 35 | -------------------------------------------------------------------------------- /FileDialogOfQML/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /FileDialogOfQML/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | Widget::Widget(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | } 7 | 8 | Widget::~Widget() 9 | { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /FileDialogOfQML/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class Widget : public QWidget 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | Widget(QWidget *parent = 0); 12 | ~Widget(); 13 | }; 14 | 15 | #endif // WIDGET_H 16 | -------------------------------------------------------------------------------- /GADGET_Demo/GadgetTest.cpp: -------------------------------------------------------------------------------- 1 | #include "GadgetTest.h" 2 | 3 | GadgetTest::GadgetTest() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /GADGET_Demo/GadgetTest.h: -------------------------------------------------------------------------------- 1 | #ifndef GADGETTEST_H 2 | #define GADGETTEST_H 3 | 4 | #include 5 | 6 | class GadgetTest 7 | { 8 | Q_GADGET 9 | public: 10 | GadgetTest(); 11 | enum Priority { High, Low, VeryHigh, VeryLow }; 12 | enum Type{Zero, One, Two, Three}; 13 | Q_ENUM(Priority) 14 | Q_ENUM(Type) 15 | }; 16 | 17 | #endif // GADGETTEST_H 18 | -------------------------------------------------------------------------------- /GADGET_Demo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "GadgetTest.h" 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | QCoreApplication a(argc, argv); 12 | 13 | int count = GadgetTest::staticMetaObject.enumeratorCount(); 14 | for(int i = 0; i < count; i++){ 15 | 16 | QMetaEnum en = GadgetTest::staticMetaObject.enumerator(i); 17 | int enCount = en.keyCount(); 18 | for(int j = 0; j < enCount; j++){ 19 | 20 | qDebug() << en.value(j); 21 | qDebug() << en.key(j); 22 | } 23 | qDebug() << "----------------华丽的分割线----------------"; 24 | } 25 | 26 | return a.exec(); 27 | } 28 | -------------------------------------------------------------------------------- /GenerateRSAKeys/GenerateRSAKeys.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | QT -= gui 3 | 4 | TARGET = GenerateRSAKeys 5 | CONFIG += console 6 | CONFIG += c++11 7 | CONFIG -= app_bundle 8 | 9 | QMAKE_CFLAGS = -fpermissive 10 | QMAKE_CXXFLAGS = -fpermissive 11 | QMAKE_LFLAGS = -fpermissive 12 | 13 | INCLUDEPATH += /usr/local/ssl/include 14 | LIBS += -L /usr/local/ssl/lib/ -lssl -lcrypto 15 | 16 | TEMPLATE = app 17 | 18 | SOURCES += main.cpp 19 | 20 | -------------------------------------------------------------------------------- /HTTPCORSTest/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | Qt demo about CORST. -------------------------------------------------------------------------------- /HTTPCORSTest/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /HTTPCORSTest/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QTcpServer; 8 | class QTcpSocket; 9 | QT_END_NAMESPACE 10 | 11 | namespace Ui { 12 | class Widget; 13 | } 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit Widget(QWidget *parent = 0); 21 | ~Widget(); 22 | 23 | protected slots: 24 | void newConnectionSlot80(); 25 | void newConnectionSlot81(); 26 | 27 | void errorStringSlot80(); 28 | void errorStringSlot81(); 29 | 30 | void sendMsg80(); 31 | void sendMsg81(); 32 | 33 | private: 34 | Ui::Widget *ui; 35 | QTcpServer *m_tcpServer80; 36 | QTcpSocket *m_tcpSocket80; 37 | 38 | QTcpServer *m_tcpServer81; 39 | QTcpSocket *m_tcpSocket81; 40 | }; 41 | 42 | #endif // WIDGET_H 43 | -------------------------------------------------------------------------------- /HTTPCORSTest/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /HTTPCache-ControlDemo/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This program shows that the Cache-Contro of HTTP; -------------------------------------------------------------------------------- /HTTPCache-ControlDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /HTTPCache-ControlDemo/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QTcpServer; 8 | class QTcpSocket; 9 | QT_END_NAMESPACE 10 | 11 | namespace Ui { 12 | class Widget; 13 | } 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit Widget(QWidget *parent = 0); 21 | ~Widget(); 22 | 23 | 24 | protected slots: 25 | void newConnectionSlot(); 26 | void errorStringSlot(); 27 | void sendMsg(); 28 | 29 | private: 30 | Ui::Widget *ui; 31 | QTcpServer *m_tcpServer; 32 | QTcpSocket *m_tcpSocket; 33 | }; 34 | 35 | #endif // WIDGET_H 36 | -------------------------------------------------------------------------------- /HTTPCache-ControlDemo/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /HTTPLast-Modified/FirstReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/HTTPLast-Modified/FirstReadMe.txt -------------------------------------------------------------------------------- /HTTPLast-Modified/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /HTTPLast-Modified/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QTcpServer; 8 | class QTcpSocket; 9 | QT_END_NAMESPACE 10 | 11 | namespace Ui { 12 | class Widget; 13 | } 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | Widget(QWidget *parent = 0); 21 | ~Widget(); 22 | 23 | protected slots: 24 | void newConnectionSlot80(); 25 | void errorStringSlot80(); 26 | void sendMsg80(); 27 | void btnClicked(); 28 | 29 | private: 30 | Ui::Widget *ui; 31 | QTcpServer *m_tcpServer80; 32 | QTcpSocket *m_tcpSocket80; 33 | 34 | }; 35 | 36 | #endif // WIDGET_H 37 | -------------------------------------------------------------------------------- /HTTPLast-Modified/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 267 10 | 41 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 正常回HTTP包 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /HeightMapSurfaceDemo/img/Heightmap1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/HeightMapSurfaceDemo/img/Heightmap1.png -------------------------------------------------------------------------------- /HeightMapSurfaceDemo/img/Heightmap2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/HeightMapSurfaceDemo/img/Heightmap2.png -------------------------------------------------------------------------------- /HeightMapSurfaceDemo/img/Heightmap3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/HeightMapSurfaceDemo/img/Heightmap3.png -------------------------------------------------------------------------------- /HeightMapSurfaceDemo/img/Heightmap4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/HeightMapSurfaceDemo/img/Heightmap4.png -------------------------------------------------------------------------------- /HeightMapSurfaceDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace QtDataVisualization; 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | QApplication a(argc, argv); 12 | 13 | Q3DSurface surface; 14 | surface.setFlags(surface.flags() ^ Qt::FramelessWindowHint); 15 | surface.resize(800, 600); 16 | surface.show(); 17 | 18 | //添加数据 19 | QImage image(":/img/Heightmap4.png"); 20 | QHeightMapSurfaceDataProxy *proxy = new QHeightMapSurfaceDataProxy(image); 21 | proxy->setValueRanges(0.0f, 500.0f, 0.0f, 500.0f); 22 | QSurface3DSeries *series = new QSurface3DSeries(proxy); 23 | series->setDrawMode(QSurface3DSeries::DrawSurface); 24 | series->setFlatShadingEnabled(false); 25 | surface.addSeries(series); 26 | 27 | return a.exec(); 28 | } 29 | -------------------------------------------------------------------------------- /HeightMapSurfaceDemo/resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | img/Heightmap1.png 4 | img/Heightmap2.png 5 | img/Heightmap3.png 6 | img/Heightmap4.png 7 | 8 | 9 | -------------------------------------------------------------------------------- /HeightMapSurfaceDemo/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | 3 | Widget::Widget(QWidget *parent) 4 | : QWidget(parent) 5 | { 6 | } 7 | 8 | Widget::~Widget() 9 | { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /IntegrateCPP&QML/backend.cpp: -------------------------------------------------------------------------------- 1 | #include "backend.h" 2 | #include "itemmanager.h" 3 | #include 4 | 5 | BackEnd::BackEnd(QObject *parent) : QObject(parent) 6 | { 7 | 8 | ItemManager *manager = ItemManager::getInstance(); 9 | manager->addItem(this); 10 | 11 | connect(this, &BackEnd::userNameChanged, [=] (){ 12 | 13 | qDebug() << m_userName; 14 | }); 15 | } 16 | 17 | BackEnd::~BackEnd() 18 | { 19 | qDebug() << "BackEnd::~BackEnd() called"; 20 | } 21 | 22 | QString BackEnd::userName(){ 23 | 24 | return m_userName; 25 | } 26 | 27 | void BackEnd::setUserName(const QString &userName){ 28 | 29 | if(userName == m_userName) 30 | return; 31 | 32 | m_userName = userName; 33 | emit userNameChanged(); 34 | } 35 | -------------------------------------------------------------------------------- /IntegrateCPP&QML/backend.h: -------------------------------------------------------------------------------- 1 | #ifndef BACKEND_H 2 | #define BACKEND_H 3 | 4 | #include 5 | 6 | class BackEnd : public QObject 7 | { 8 | Q_OBJECT 9 | Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged) 10 | 11 | public: 12 | explicit BackEnd(QObject *parent = nullptr); 13 | ~BackEnd(); 14 | 15 | QString userName(); 16 | void setUserName(const QString &userName); 17 | 18 | 19 | signals: 20 | void userNameChanged(); 21 | 22 | private: 23 | QString m_userName; 24 | 25 | }; 26 | 27 | #endif // BACKEND_H 28 | -------------------------------------------------------------------------------- /IntegrateCPP&QML/itemmanager.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEMMANAGER_H 2 | #define ITEMMANAGER_H 3 | 4 | #include 5 | #include 6 | 7 | class ItemManager : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | void addItem(QObject *item); 12 | QObject *getObject(); 13 | void printTest(); 14 | ~ItemManager(); 15 | static ItemManager *getInstance(); 16 | 17 | 18 | protected: 19 | explicit ItemManager(QObject *parent = nullptr); 20 | ItemManager(); 21 | ItemManager(ItemManager &item); 22 | 23 | private: 24 | QList m_item; 25 | 26 | static ItemManager *m_instance; 27 | 28 | }; 29 | 30 | #endif // ITEMMANAGER_H 31 | -------------------------------------------------------------------------------- /IntegrateCPP&QML/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.6 2 | import QtQuick.Window 2.14 3 | import QtQuick.Controls 2.2 4 | import cn.it1995.bakend 1.0 5 | 6 | Window { 7 | visible: true 8 | width: 640 9 | height: 480 10 | title: qsTr("Hello World") 11 | 12 | BackEnd{ 13 | 14 | id: backend 15 | } 16 | 17 | TextField{ 18 | 19 | text: backend.userName 20 | placeholderText: "user name" 21 | anchors.centerIn: parent 22 | onTextChanged: backend.userName = text 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /IntegrateCPP&QML/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /JavaScript Of QML Slide/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that how to use JavaScript to accomplish the sliding picture. -------------------------------------------------------------------------------- /JavaScript Of QML Slide/Test.js: -------------------------------------------------------------------------------- 1 | function showPic(item) { 2 | 3 | item.anchors.leftMargin = item.anchors.leftMargin + 1 4 | } 5 | 6 | function hidePic(item) { 7 | 8 | item.anchors.leftMargin = item.anchors.leftMargin - 1 9 | } 10 | -------------------------------------------------------------------------------- /JavaScript Of QML Slide/Triangle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | Canvas { 4 | 5 | id: triangle 6 | property color triangleColor: "blue" 7 | width: parent.width - parent.width / 3 8 | height: parent.height - parent.height / 3 9 | contextType: "2d" 10 | 11 | onPaint: { 12 | 13 | context.lineWidth = 0 14 | context.strokeStyle = "#00000000" 15 | context.fillStyle = triangleColor 16 | context.beginPath(); 17 | context.moveTo(0, 0) 18 | context.lineTo(0, triangle.height); 19 | context.lineTo(triangle.width, triangle.height/2); 20 | context.closePath(); 21 | context.fill() 22 | context.stroke(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /JavaScript Of QML Slide/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | if (engine.rootObjects().isEmpty()) 13 | return -1; 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /JavaScript Of QML Slide/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | Test.js 5 | Triangle.qml 6 | 7 | 8 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This program shows that the keep-alive of http. -------------------------------------------------------------------------------- /KeepAliveOfHTTP/httpserver/httpglobal.cpp: -------------------------------------------------------------------------------- 1 | #include "httpglobal.h" 2 | 3 | const char* getQtWebAppLibVersion() 4 | { 5 | return "1.7.8"; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/httpserver/httpglobal.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file 3 | @author Stefan Frings 4 | */ 5 | 6 | #ifndef HTTPGLOBAL_H 7 | #define HTTPGLOBAL_H 8 | 9 | #include 10 | 11 | // This is specific to Windows dll's 12 | #if defined(Q_OS_WIN) 13 | #if defined(QTWEBAPPLIB_EXPORT) 14 | #define DECLSPEC Q_DECL_EXPORT 15 | #elif defined(QTWEBAPPLIB_IMPORT) 16 | #define DECLSPEC Q_DECL_IMPORT 17 | #endif 18 | #endif 19 | #if !defined(DECLSPEC) 20 | #define DECLSPEC 21 | #endif 22 | 23 | /** Get the library version number */ 24 | DECLSPEC const char* getQtWebAppLibVersion(); 25 | 26 | 27 | #endif // HTTPGLOBAL_H 28 | 29 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/httpserver/httprequesthandler.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | @file 3 | @author Stefan Frings 4 | */ 5 | 6 | #include "httprequesthandler.h" 7 | 8 | using namespace stefanfrings; 9 | 10 | HttpRequestHandler::HttpRequestHandler(QObject* parent) 11 | : QObject(parent) 12 | {} 13 | 14 | HttpRequestHandler::~HttpRequestHandler() 15 | {} 16 | 17 | void HttpRequestHandler::service(HttpRequest& request, HttpResponse& response) 18 | { 19 | qCritical("HttpRequestHandler: you need to override the service() function"); 20 | qDebug("HttpRequestHandler: request=%s %s %s",request.getMethod().data(),request.getPath().data(),request.getVersion().data()); 21 | response.setStatus(501,"not implemented"); 22 | response.write("501 not implemented",true); 23 | } 24 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/httpserver/myrequesthandler.cpp: -------------------------------------------------------------------------------- 1 | #include "myrequesthandler.h" 2 | 3 | MyRequestHandler::MyRequestHandler(QObject *parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/httpserver/myrequesthandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MYREQUESTHANDLER_H 2 | #define MYREQUESTHANDLER_H 3 | 4 | 5 | class MyRequestHandler 6 | { 7 | public: 8 | MyRequestHandler(); 9 | }; 10 | 11 | #endif // MYREQUESTHANDLER_H 12 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "httpserver/httplistener.h" 4 | #include "myrequesthandler.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | 10 | QSettings *listenerSettings=new QSettings("E:\\Qt2019\\useQtWebAPP\\conf.ini", QSettings::IniFormat, &a); 11 | listenerSettings->beginGroup("listener"); 12 | new HttpListener(listenerSettings, new MyRequestHandler, &a); 13 | 14 | 15 | return a.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/myrequesthandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MYREQUESTHANDLER_H 2 | #define MYREQUESTHANDLER_H 3 | 4 | #include "httpserver/httprequesthandler.h" 5 | using namespace stefanfrings; 6 | 7 | class MyRequestHandler: public HttpRequestHandler 8 | { 9 | Q_OBJECT 10 | public: 11 | MyRequestHandler(QObject* parent=nullptr); 12 | void service(HttpRequest& request, HttpResponse& response); 13 | }; 14 | 15 | #endif // MYREQUESTHANDLER_H 16 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/re/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | IT1995 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/re/pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/KeepAliveOfHTTP/re/pic.jpg -------------------------------------------------------------------------------- /KeepAliveOfHTTP/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | re/index.html 4 | re/pic.jpg 5 | 6 | 7 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/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 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | 22 | #endif // WIDGET_H 23 | -------------------------------------------------------------------------------- /KeepAliveOfHTTP/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /MysqlPageQt/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /MysqlPageQt/sql.h: -------------------------------------------------------------------------------- 1 | #ifndef SQL_H 2 | #define SQL_H 3 | 4 | #include 5 | 6 | 7 | class SQL 8 | { 9 | public: 10 | SQL(); 11 | QVector limitSql(const int &start = 0, const int &num = 0); 12 | int getCount(); 13 | 14 | private: 15 | QSqlDatabase m_db; 16 | }; 17 | 18 | #endif // SQL_H 19 | -------------------------------------------------------------------------------- /MysqlPageQt/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class SQL; 7 | 8 | namespace Ui { 9 | class Widget; 10 | } 11 | 12 | class Widget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit Widget(QWidget *parent = nullptr); 18 | ~Widget(); 19 | 20 | protected: 21 | void updateBtnStatus(); 22 | void setTreeWidget(); 23 | 24 | protected slots: 25 | void valueChange(int num); 26 | void upBtnClicked(); 27 | void downBtnClicked(); 28 | 29 | private: 30 | Ui::Widget *ui; 31 | SQL *m_sql; 32 | int m_count; 33 | int m_currentPage; 34 | int m_numInPage; 35 | int m_countPage; 36 | }; 37 | 38 | #endif // WIDGET_H 39 | -------------------------------------------------------------------------------- /OpenSSLDemo/OpenSSLDemo.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | QT -= gui 3 | 4 | TARGET = OpenSSLDemo 5 | CONFIG += console 6 | CONFIG -= app_bundle 7 | 8 | INCLUDEPATH += /usr/local/ssl/include 9 | LIBS += -L /usr/local/ssl/lib/ -lssl -lcrypto 10 | 11 | TEMPLATE = app 12 | 13 | SOURCES += main.cpp 14 | 15 | -------------------------------------------------------------------------------- /OpenSSLDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QCoreApplication a(argc, argv); 9 | 10 | std::cout << OpenSSL_version(0) << std::endl; 11 | std::cout << OpenSSL_version(1) << std::endl; 12 | std::cout << OpenSSL_version(2) << std::endl; 13 | std::cout << OpenSSL_version(3) << std::endl; 14 | std::cout << OpenSSL_version(4) << std::endl; 15 | std::cout << OpenSSL_version(5) << std::endl; 16 | 17 | return a.exec(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /ParticleDemoAoutQML/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | the particle demo of QML. -------------------------------------------------------------------------------- /ParticleDemoAoutQML/MyParticle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Particles 2.0 3 | 4 | Item { 5 | 6 | ParticleSystem{ 7 | 8 | id: sys 9 | } 10 | 11 | ImageParticle{ 12 | 13 | system: sys 14 | source: "qrc:/img/star.png" 15 | } 16 | 17 | Emitter{ 18 | 19 | id: startField 20 | system: sys 21 | 22 | emitRate: 80 23 | lifeSpan: 2500 24 | lifeSpanVariation: 4000 25 | 26 | width: window.width 27 | height: window.height 28 | 29 | //acceleration: PointDirection { xVariation: 200; yVariation: 200; } 30 | 31 | size: 0 32 | endSize: 48 33 | sizeVariation: 10 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ParticleDemoAoutQML/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/ParticleDemoAoutQML/img/bg.jpg -------------------------------------------------------------------------------- /ParticleDemoAoutQML/img/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/ParticleDemoAoutQML/img/star.png -------------------------------------------------------------------------------- /ParticleDemoAoutQML/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | if (engine.rootObjects().isEmpty()) 13 | return -1; 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /ParticleDemoAoutQML/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.9 2 | import QtQuick.Window 2.2 3 | 4 | Window { 5 | 6 | id: window 7 | visible: true 8 | width: 800 9 | height: 600 10 | title: qsTr("Hello World") 11 | 12 | Image{ 13 | 14 | id: image 15 | source: "qrc:/img/bg.jpg" 16 | transformOrigin: Item.Center 17 | anchors.centerIn: parent 18 | 19 | NumberAnimation on rotation { 20 | 21 | from: 0 22 | to: 360 23 | duration: 20000 24 | loops: Animation.Infinite 25 | } 26 | 27 | 28 | } 29 | 30 | MyParticle{ 31 | 32 | id: myParticle 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ParticleDemoAoutQML/main.qml.autosave: -------------------------------------------------------------------------------- 1 | import QtQuick 2.9 2 | import QtQuick.Window 2.2 3 | 4 | Window { 5 | 6 | id: window 7 | visible: true 8 | width: 800 9 | height: 600 10 | title: qsTr("Hello World") 11 | 12 | Image{ 13 | 14 | id: image 15 | source: "qrc:/img/bg.jpg" 16 | transformOrigin: Item.Center 17 | anchors.centerIn: parent 18 | 19 | NumberAnimation on rotation { 20 | 21 | from: 0 22 | to: 360 23 | duration: 20000 24 | loops: Animation.Infinite 25 | } 26 | } 27 | 28 | MyParticle{ 29 | 30 | id: myParticle 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /ParticleDemoAoutQML/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | img/bg.jpg 5 | img/star.png 6 | MyParticle.qml 7 | 8 | 9 | -------------------------------------------------------------------------------- /ProcessList/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /ProcessList/thread.h: -------------------------------------------------------------------------------- 1 | #ifndef THREAD_H 2 | #define THREAD_H 3 | 4 | #include 5 | #include 6 | 7 | struct ProcessInfo{ 8 | 9 | QString processID; //进程ID 10 | QString threadNum; //该进程开启的线程数 11 | QString parentProcessID; //父进程ID 12 | QString processPri; //线程优先权 13 | QString processHandle; //进程句柄 14 | QString processName; //名称 15 | }; 16 | 17 | 18 | class Thread 19 | { 20 | public: 21 | Thread(); 22 | void getSnapshot(); 23 | const QVector &getVec(); 24 | void clearVec(); 25 | 26 | protected: 27 | void insertInfo(const QString &pID, const QString &thrNum, 28 | const QString &parePID, const QString &processPr, 29 | const QString &handle, const QString &processName); 30 | 31 | private: 32 | 33 | QVector m_vec; 34 | }; 35 | 36 | #endif // THREAD_H 37 | -------------------------------------------------------------------------------- /ProcessList/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | class Thread; 8 | 9 | namespace Ui { 10 | class Widget; 11 | } 12 | 13 | class Widget : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit Widget(QWidget *parent = nullptr); 19 | ~Widget(); 20 | 21 | protected: 22 | void timerEvent(QTimerEvent *event); 23 | void clearmPvec(); 24 | void addNew(); 25 | void removeOld(); 26 | 27 | private: 28 | Ui::Widget *ui; 29 | Thread *m_thread; 30 | }; 31 | 32 | #endif // WIDGET_H 33 | -------------------------------------------------------------------------------- /ProcessList/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 717 10 | 237 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /QHostInfoLookupDemo/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This program shows how to use QHostInfo. -------------------------------------------------------------------------------- /QHostInfoLookupDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /QHostInfoLookupDemo/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QHostInfo; 8 | QT_END_NAMESPACE 9 | 10 | namespace Ui { 11 | class Widget; 12 | } 13 | 14 | class Widget : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Widget(QWidget *parent = 0); 20 | ~Widget(); 21 | 22 | protected slots: 23 | void lookUp(const QHostInfo &host); 24 | 25 | private: 26 | Ui::Widget *ui; 27 | }; 28 | 29 | #endif // WIDGET_H 30 | -------------------------------------------------------------------------------- /QHostInfoLookupDemo/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /QLibraryDemo/qt_demo/libraryDemo/DLL_C_Demo.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QLibraryDemo/qt_demo/libraryDemo/DLL_C_Demo.dll -------------------------------------------------------------------------------- /QLibraryDemo/qt_demo/libraryDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QCoreApplication a(argc, argv); 8 | 9 | QLibrary myLib("D:\\QtProject\\libraryDemo\\DLL_C_Demo"); 10 | typedef int (*Add)(int a, int b); 11 | Add function = (Add)myLib.resolve("Add"); 12 | if(function){ 13 | 14 | qDebug() << function(10, 20); 15 | } 16 | 17 | qDebug() << "----------华丽的分割线----------"; 18 | 19 | typedef int (*Sub)(int a, int b); 20 | Sub function2 = (Sub)QLibrary::resolve("D:\\QtProject\\libraryDemo\\DLL_C_Demo.dll", "Sub"); 21 | if(function2){ 22 | 23 | qDebug() << function2(10, 100); 24 | } 25 | 26 | return a.exec(); 27 | } 28 | -------------------------------------------------------------------------------- /QLibraryDemo/vs2015_dll/DLL_C_Demo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QLibraryDemo/vs2015_dll/DLL_C_Demo.cpp -------------------------------------------------------------------------------- /QLibraryDemo/vs2015_dll/dllmain.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QLibraryDemo/vs2015_dll/dllmain.cpp -------------------------------------------------------------------------------- /QLibraryDemo/vs2015_dll/myDll.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "myDll.h" 3 | 4 | 5 | int Add(int a, int b) { 6 | 7 | 8 | return a + b; 9 | } 10 | 11 | int Sub(int a, int b) { 12 | 13 | 14 | return a - b; 15 | } -------------------------------------------------------------------------------- /QLibraryDemo/vs2015_dll/myDll.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #define ExportFunc _declspec(dllexport) 5 | 6 | extern "C" ExportFunc int Add(int a, int b); 7 | extern "C" ExportFunc int Sub(int a, int b); -------------------------------------------------------------------------------- /QLibraryDemo/vs2015_dll/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QLibraryDemo/vs2015_dll/stdafx.cpp -------------------------------------------------------------------------------- /QLibraryDemo/vs2015_dll/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QLibraryDemo/vs2015_dll/stdafx.h -------------------------------------------------------------------------------- /QLibraryDemo/vs2015_dll/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QLibraryDemo/vs2015_dll/targetver.h -------------------------------------------------------------------------------- /QML Style Of Button/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that the how to use style of button. -------------------------------------------------------------------------------- /QML Style Of Button/img/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QML Style Of Button/img/normal.png -------------------------------------------------------------------------------- /QML Style Of Button/img/press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QML Style Of Button/img/press.png -------------------------------------------------------------------------------- /QML Style Of Button/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | if (engine.rootObjects().isEmpty()) 13 | return -1; 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /QML Style Of Button/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /QML Style Of Button/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | img/normal.png 4 | img/press.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /QMLLove/img/love_PNG89.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QMLLove/img/love_PNG89.png -------------------------------------------------------------------------------- /QMLLove/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | const QUrl url(QStringLiteral("qrc:/main.qml")); 12 | QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, 13 | &app, [url](QObject *obj, const QUrl &objUrl) { 14 | if (!obj && url == objUrl) 15 | QCoreApplication::exit(-1); 16 | }, Qt::QueuedConnection); 17 | engine.load(url); 18 | 19 | return app.exec(); 20 | } 21 | -------------------------------------------------------------------------------- /QMLLove/note.txt: -------------------------------------------------------------------------------- 1 | https://doc.qt.io/qt-5/qtqml-cppintegration-topic.html -------------------------------------------------------------------------------- /QMLLove/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | img/love_PNG89.png 5 | 6 | 7 | -------------------------------------------------------------------------------- /QMLSignal/Background.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | 3 | BackgroundForm { 4 | 5 | property Circle target: null 6 | focus: true 7 | 8 | Keys.onPressed: { 9 | 10 | if(event.key == Qt.Key_Plus) target.width = target.width + 10 11 | if(event.key == Qt.key_Minus) target.width = target.width - 10 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /QMLSignal/BackgroundForm.ui.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | 3 | Item { 4 | width: 400 5 | height: 400 6 | 7 | Rectangle { 8 | id: rectangle 9 | gradient: Gradient { 10 | GradientStop { 11 | position: 0 12 | color: "#f7fcfa" 13 | } 14 | 15 | GradientStop { 16 | position: 1 17 | color: "#30cce8" 18 | } 19 | } 20 | anchors.fill: parent 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /QMLSignal/Circle.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | 3 | CircleForm { 4 | } 5 | -------------------------------------------------------------------------------- /QMLSignal/CircleForm.ui.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.4 2 | 3 | Item { 4 | width: 200 5 | height: 200 6 | property alias buttonColor: button.color 7 | property alias displayText: display.text 8 | 9 | Rectangle { 10 | id: button 11 | color: "#f03131" 12 | radius: width * 0.5 13 | anchors.fill: parent 14 | 15 | Text { 16 | id: display 17 | x: 88 18 | y: 94 19 | color: "#fbfbfb" 20 | text: qsTr("Text") 21 | font.bold: true 22 | anchors.horizontalCenter: parent.horizontalCenter 23 | anchors.verticalCenter: parent.verticalCenter 24 | font.pixelSize: 28 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /QMLSignal/Receiver.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Circle { 4 | 5 | id: receiverButton 6 | function receive(value){ 7 | 8 | displayText = value 9 | clicknotify.running = true 10 | } 11 | 12 | SequentialAnimation on buttonColor { 13 | 14 | id: clicknotify 15 | running: false 16 | 17 | ColorAnimation{ 18 | 19 | from: "red" 20 | to: "blue" 21 | duration: 250 22 | } 23 | 24 | 25 | ColorAnimation { 26 | from: "blue" 27 | to: "red" 28 | duration: 250 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /QMLSignal/Sender.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Circle { 4 | 5 | id: sendButton 6 | 7 | property int counter: 0 8 | property Receiver target: null 9 | 10 | signal send(string value) 11 | onTargetChanged: send.connect(target.receive) 12 | 13 | MouseArea{ 14 | 15 | anchors.fill: parent 16 | 17 | onClicked: { 18 | 19 | counter++ 20 | parent.send(counter) 21 | } 22 | 23 | onPressed: parent.buttonColor = "green" 24 | onReleased: parent.buttonColor = "blue" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /QMLSignal/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | const QUrl url(QStringLiteral("qrc:/main.qml")); 12 | QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, 13 | &app, [url](QObject *obj, const QUrl &objUrl) { 14 | if (!obj && url == objUrl) 15 | QCoreApplication::exit(-1); 16 | }, Qt::QueuedConnection); 17 | engine.load(url); 18 | 19 | return app.exec(); 20 | } 21 | -------------------------------------------------------------------------------- /QMLSignal/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | Background.qml 5 | BackgroundForm.ui.qml 6 | Circle.qml 7 | CircleForm.ui.qml 8 | Receiver.qml 9 | Sender.qml 10 | 11 | 12 | -------------------------------------------------------------------------------- /QMLWebEngineTest/MainForm.ui.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | 3 | Rectangle { 4 | property alias mouseArea: mouseArea 5 | property alias textEdit: textEdit 6 | 7 | width: 360 8 | height: 360 9 | 10 | MouseArea { 11 | id: mouseArea 12 | anchors.fill: parent 13 | } 14 | 15 | TextEdit { 16 | id: textEdit 17 | text: qsTr("Enter some text...") 18 | verticalAlignment: Text.AlignVCenter 19 | anchors.top: parent.top 20 | anchors.horizontalCenter: parent.horizontalCenter 21 | anchors.topMargin: 20 22 | Rectangle { 23 | anchors.fill: parent 24 | anchors.margins: -10 25 | color: "transparent" 26 | border.width: 1 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /QMLWebEngineTest/QMLWebEngineTest.pro: -------------------------------------------------------------------------------- 1 | TEMPLATE = app 2 | 3 | QT += qml quick webengine 4 | CONFIG += c++11 5 | 6 | SOURCES += main.cpp 7 | 8 | RESOURCES += qml.qrc 9 | 10 | QML_IMPORT_PATH = 11 | 12 | QML_DESIGNER_IMPORT_PATH = 13 | 14 | DEFINES += QT_DEPRECATED_WARNINGS 15 | 16 | qnx: target.path = /tmp/$${TARGET}/bin 17 | else: unix:!android: target.path = /opt/$${TARGET}/bin 18 | !isEmpty(target.path): INSTALLS += target 19 | -------------------------------------------------------------------------------- /QMLWebEngineTest/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QGuiApplication app(argc, argv); 8 | 9 | QtWebEngine::initialize(); 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | 13 | return app.exec(); 14 | } 15 | -------------------------------------------------------------------------------- /QMLWebEngineTest/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.5 2 | import QtQuick.Window 2.2 3 | import QtWebEngine 1.0 4 | 5 | Window { 6 | width: 1024 7 | height: 750 8 | visible: true 9 | WebEngineView { 10 | 11 | anchors.fill: parent 12 | url: "http://192.1.101.118:8888" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /QMLWebEngineTest/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /QMapKeyCustom/QMapKeyCustom.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 console 4 | CONFIG -= app_bundle 5 | 6 | # You can make your code fail to compile if it uses deprecated APIs. 7 | # In order to do so, uncomment the following line. 8 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 9 | 10 | SOURCES += \ 11 | main.cpp 12 | 13 | # Default rules for deployment. 14 | qnx: target.path = /tmp/$${TARGET}/bin 15 | else: unix:!android: target.path = /opt/$${TARGET}/bin 16 | !isEmpty(target.path): INSTALLS += target 17 | -------------------------------------------------------------------------------- /QMapKeyCustom/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | struct MyKey{ 6 | 7 | MyKey(QString key1, int key2){ 8 | 9 | this->key1 = key1; 10 | this->key2 = key2; 11 | } 12 | 13 | bool operator < (const MyKey &key) const{ 14 | 15 | return std::tie(key1, key2) < std::tie(key.key1, key.key2); 16 | } 17 | 18 | QString key1; 19 | int key2; 20 | }; 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | QCoreApplication a(argc, argv); 25 | 26 | QMap map; 27 | map.insert(MyKey("10086", 0), "value1"); 28 | map.insert(MyKey("10086", 1), "value2"); 29 | map.insert(MyKey("10086", 2), "value3"); 30 | map.insert(MyKey("10010", 1), "value4"); 31 | map.insert(MyKey("10010", 2), "value5"); 32 | 33 | 34 | return a.exec(); 35 | } 36 | -------------------------------------------------------------------------------- /QPointerMutiThread/ProjectData.cpp: -------------------------------------------------------------------------------- 1 | #include "ProjectData.h" 2 | #include 3 | 4 | QMutex mutex; 5 | 6 | ProjectData::ProjectData(QObject *parent) : QObject(parent) 7 | { 8 | 9 | } 10 | 11 | 12 | void ProjectData::addItem(QObject *item) 13 | { 14 | m_objList.append(item); 15 | } 16 | 17 | int ProjectData::getSize() 18 | { 19 | return m_objList.size(); 20 | } 21 | 22 | QObject* ProjectData::getItem() 23 | { 24 | mutex.lock(); 25 | if(m_objList.size() == 0){ 26 | 27 | mutex.unlock(); 28 | return nullptr; 29 | } 30 | 31 | QObject *ret = m_objList[0]; 32 | m_objList.removeFirst(); 33 | mutex.unlock(); 34 | return ret; 35 | } 36 | 37 | QList ProjectData::getAll() 38 | { 39 | return m_objList; 40 | } 41 | -------------------------------------------------------------------------------- /QPointerMutiThread/ProjectData.h: -------------------------------------------------------------------------------- 1 | #ifndef PROJECTDATA_H 2 | #define PROJECTDATA_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class ProjectData : public QObject 9 | { 10 | Q_OBJECT 11 | public: 12 | ProjectData(QObject *parent = nullptr); 13 | void addItem(QObject *item); 14 | int getSize(); 15 | QObject *getItem(); 16 | QList getAll(); 17 | 18 | private: 19 | QList m_objList; 20 | }; 21 | 22 | #endif // PROJECTDATA_H 23 | -------------------------------------------------------------------------------- /QPointerMutiThread/WorkerThread.h: -------------------------------------------------------------------------------- 1 | #ifndef WORKERTHREAD_H 2 | #define WORKERTHREAD_H 3 | 4 | #include 5 | 6 | class ProjectData; 7 | 8 | class WorkerThread : public QThread 9 | { 10 | Q_OBJECT 11 | public: 12 | WorkerThread(); 13 | void setProjectData(ProjectData *project); 14 | void run() Q_DECL_OVERRIDE; 15 | bool stopFlag; 16 | 17 | private: 18 | ProjectData *m_project; 19 | }; 20 | 21 | #endif // WORKERTHREAD_H 22 | -------------------------------------------------------------------------------- /QPortScanner/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project creator a tool that can ability to scan TCP ports. And multithreading is used. -------------------------------------------------------------------------------- /QPortScanner/WidgetInFace.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2018-07-09T23:35:34 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui network 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = WidgetInFace 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | widget.cpp \ 17 | mylabel.cpp \ 18 | mynetwork.cpp 19 | 20 | HEADERS += widget.h \ 21 | mylabel.h \ 22 | mynetwork.h 23 | 24 | FORMS += widget.ui 25 | 26 | 27 | RC_FILE = version.rc 28 | 29 | 30 | RESOURCES += \ 31 | resources.qrc 32 | -------------------------------------------------------------------------------- /QPortScanner/img/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QPortScanner/img/close.png -------------------------------------------------------------------------------- /QPortScanner/img/close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QPortScanner/img/close_hover.png -------------------------------------------------------------------------------- /QPortScanner/img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QPortScanner/img/icon.png -------------------------------------------------------------------------------- /QPortScanner/img/icon_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QPortScanner/img/icon_hover.png -------------------------------------------------------------------------------- /QPortScanner/img/min.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QPortScanner/img/min.png -------------------------------------------------------------------------------- /QPortScanner/img/min_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QPortScanner/img/min_hover.png -------------------------------------------------------------------------------- /QPortScanner/img/myQSS.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QPortScanner/img/myQSS.txt -------------------------------------------------------------------------------- /QPortScanner/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /QPortScanner/mylabel.cpp: -------------------------------------------------------------------------------- 1 | #include "mylabel.h" 2 | #include 3 | #include 4 | 5 | MyLabel::MyLabel(QWidget *parent): 6 | QLabel(parent) 7 | { 8 | 9 | } 10 | 11 | void MyLabel::setStatus(const int status) 12 | { 13 | m_status=status; 14 | } 15 | 16 | MyLabel::~MyLabel() 17 | { 18 | 19 | } 20 | 21 | void MyLabel::mouseReleaseEvent(QMouseEvent *event) 22 | { 23 | if(event->button()==Qt::LeftButton){ 24 | if(m_status==CloseLabel){ 25 | emit prepareToClose(); 26 | } 27 | else if(m_status==MinLabel){ 28 | emit prepareToMin(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /QPortScanner/mylabel.h: -------------------------------------------------------------------------------- 1 | #ifndef MYLABEL_H 2 | #define MYLABEL_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | #define CloseLabel 0 9 | #define MinLabel 1 10 | 11 | 12 | 13 | class MyLabel : public QLabel 14 | { 15 | Q_OBJECT 16 | public: 17 | MyLabel(QWidget *parent=0); 18 | void setStatus(const int status); 19 | ~MyLabel(); 20 | 21 | protected: 22 | void mouseReleaseEvent(QMouseEvent *event); 23 | 24 | signals: 25 | void prepareToClose(); 26 | void prepareToMin(); 27 | 28 | private: 29 | int m_status; 30 | 31 | }; 32 | 33 | #endif // MYLABEL_H 34 | -------------------------------------------------------------------------------- /QPortScanner/mynetwork.h: -------------------------------------------------------------------------------- 1 | #ifndef MYNETWORK_H 2 | #define MYNETWORK_H 3 | 4 | #include 5 | #include 6 | 7 | class QTcpSocket; 8 | 9 | class MyNetWork:public QObject 10 | { 11 | Q_OBJECT 12 | public: 13 | MyNetWork(QObject *parent=0); 14 | ~MyNetWork(); 15 | 16 | void setIp(const QString ip); 17 | void setStartPort(const int startPort); 18 | void setEndPort(const int endPort); 19 | 20 | public slots: 21 | void beginToScanner(); 22 | 23 | signals: 24 | void progressBarAdd(); 25 | void pcIsConnected(int port); 26 | 27 | private: 28 | QTcpSocket *m_tcpSocket; 29 | QThread m_thread; 30 | 31 | int m_startPort; 32 | int m_endPort; 33 | QString m_ip; 34 | }; 35 | 36 | #endif // MYNETWORK_H 37 | -------------------------------------------------------------------------------- /QPortScanner/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | img/close.png 4 | img/min.png 5 | img/close_hover.png 6 | img/icon.png 7 | img/icon_hover.png 8 | img/min_hover.png 9 | img/myQSS.txt 10 | 11 | 12 | -------------------------------------------------------------------------------- /QPortScanner/version.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QPortScanner/version.ico -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLClient/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "QSSLClient.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QCoreApplication a(argc, argv); 9 | 10 | QSSLClient sslClient; 11 | sslClient.connectServer(); 12 | sslClient.sendMsg("Hello Server"); 13 | QTimer::singleShot(2 * 1000, &sslClient, &QSSLClient::closeSocket); 14 | return a.exec(); 15 | } 16 | -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLClient/res/p_client.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLClient/res/p_client.p12 -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLClient/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | res/p_client.p12 4 | 5 | 6 | -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "QSSLServer.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication a(argc, argv); 7 | 8 | QSSLServer sslServer; 9 | 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/res/p_server.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/res/p_server.p12 -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | res/p_server.p12 4 | 5 | 6 | -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/client.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | keytool -genkeypair -keyalg RSA -dname "CN=localhost" -alias client -keystore client.jks -keypass cccccc -storepass cccccc 3 | keytool -exportcert -file client.cer -alias client -keystore client.jks -storepass cccccc 4 | keytool -importcert -file client.cer -alias client -keystore server_trust.jks -storepass cccccc -keypass cccccc -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/client.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/证书/client.cer -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/client.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/证书/client.jks -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/client_trust.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/证书/client_trust.jks -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/p_client.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/证书/p_client.p12 -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/p_server.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/证书/p_server.p12 -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/server.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | keytool -genkeypair -keyalg RSA -dname "CN=localhost" -alias server -keystore server.jks -keypass cccccc -storepass cccccc 3 | keytool -exportcert -file server.cer -alias server -keystore server.jks -storepass cccccc 4 | keytool -importcert -file server.cer -alias server -keystore client_trust.jks -storepass cccccc -keypass cccccc -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/server.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/证书/server.cer -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/server.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/证书/server.jks -------------------------------------------------------------------------------- /QSslSocket_Two_Way_Ssl/SSLServer/证书/server_trust.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QSslSocket_Two_Way_Ssl/SSLServer/证书/server_trust.jks -------------------------------------------------------------------------------- /QThreadPoolDemo/Com.cpp: -------------------------------------------------------------------------------- 1 | #include "Com.h" 2 | #include "Woork.h" 3 | #include 4 | #include 5 | #include 6 | 7 | Com::Com(QObject *parent) : QObject(parent) 8 | { 9 | m_timer = new QTimer(this); 10 | m_pool = new QThreadPool(this); 11 | m_pool->setMaxThreadCount(1); 12 | 13 | connect(m_timer, &QTimer::timeout, this, &Com::timeOut); 14 | m_timer->start(1000); 15 | } 16 | 17 | void Com::timeOut() 18 | { 19 | Work *work = new Work; 20 | connect(work, &Work::nowTime, this, &Com::getTime); 21 | m_pool->start(work); 22 | } 23 | 24 | void Com::getTime(const QString &time) 25 | { 26 | qDebug() << "接收到:" + time; 27 | } 28 | -------------------------------------------------------------------------------- /QThreadPoolDemo/Com.h: -------------------------------------------------------------------------------- 1 | #ifndef COM_H 2 | #define COM_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QThreadPool; 8 | class QTimer; 9 | QT_END_NAMESPACE 10 | 11 | class Com : public QObject 12 | { 13 | Q_OBJECT 14 | public: 15 | Com(QObject *parent = nullptr); 16 | 17 | protected slots: 18 | void timeOut(); 19 | void getTime(const QString &time); 20 | 21 | private: 22 | QThreadPool *m_pool; 23 | QTimer *m_timer; 24 | }; 25 | 26 | #endif // COM_H 27 | -------------------------------------------------------------------------------- /QThreadPoolDemo/Woork.cpp: -------------------------------------------------------------------------------- 1 | #include "Woork.h" 2 | #include 3 | #include 4 | 5 | Work::Work() 6 | { 7 | qDebug() << "Work::Work()"; 8 | } 9 | 10 | Work::~Work() 11 | { 12 | qDebug() << "Work::~Work()"; 13 | } 14 | 15 | void Work::run() 16 | { 17 | emit this->nowTime(QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss")); 18 | } 19 | -------------------------------------------------------------------------------- /QThreadPoolDemo/Woork.h: -------------------------------------------------------------------------------- 1 | #ifndef WORK_H 2 | #define WORK_H 3 | 4 | #include 5 | #include 6 | 7 | class Work : public QObject, public QRunnable 8 | { 9 | Q_OBJECT 10 | public: 11 | Work(); 12 | ~Work(); 13 | 14 | protected: 15 | void run() Q_DECL_OVERRIDE; 16 | 17 | signals: 18 | void nowTime(const QString &time); 19 | }; 20 | 21 | #endif // WORK_H 22 | -------------------------------------------------------------------------------- /QThreadPoolDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Com.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication a(argc, argv); 7 | 8 | Com com; 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project complements the official example. -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/QWebPage.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2019-03-26T14:23:50 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui webkitwidgets 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = QWebPage 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | thumbnailer.cpp 17 | 18 | HEADERS += thumbnailer.h 19 | -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/QWebPage.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/QWebPage.exe -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/QWebPage.exe.embed.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/QWebPage.exe_manifest.rc: -------------------------------------------------------------------------------- 1 | 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ "debug\\QWebPage.exe.embed.manifest" 2 | -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/QWebPage.exe_manifest.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/QWebPage.exe_manifest.res -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/QWebPage.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/QWebPage.ilk -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/main.obj -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/moc_thumbnailer.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/moc_thumbnailer.obj -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/qwebpage.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/qwebpage.pdb -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/thumbnailer.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/debug/thumbnailer.obj -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/original.png -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebPage Qt5.5.1/build-QWebPage-Desktop_Qt_5_5_1_MSVC2012_32bit-Debug/thumbnail.png -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/main.cpp: -------------------------------------------------------------------------------- 1 | #include "thumbnailer.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Thumbnailer w(QUrl("http://www.baidu.com")); 8 | Q_UNUSED(w) 9 | return a.exec(); 10 | } 11 | -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/thumbnailer.cpp: -------------------------------------------------------------------------------- 1 | #include "thumbnailer.h" 2 | #include 3 | #include 4 | #include 5 | 6 | Thumbnailer::Thumbnailer(const QUrl &url) 7 | { 8 | page.mainFrame()->load(url); 9 | connect(&page, SIGNAL(loadFinished(bool)), this, SLOT(render())); 10 | } 11 | 12 | Thumbnailer::~Thumbnailer() 13 | { 14 | 15 | } 16 | 17 | void Thumbnailer::render() 18 | { 19 | page.setViewportSize(page.mainFrame()->contentsSize()); 20 | QImage image(page.viewportSize(), QImage::Format_ARGB32); 21 | QPainter painter(&image); 22 | 23 | page.mainFrame()->render(&painter); 24 | painter.end(); 25 | 26 | QImage thumbnail = image.scaled(400, 400); 27 | thumbnail.save("thumbnail.png"); 28 | image.save("original.png"); 29 | emit finished(); 30 | } 31 | -------------------------------------------------------------------------------- /QWebPage Qt5.5.1/thumbnailer.h: -------------------------------------------------------------------------------- 1 | #ifndef THUMBNAILER_H 2 | #define THUMBNAILER_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class Thumbnailer : public QObject 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | Thumbnailer(const QUrl &url); 14 | ~Thumbnailer(); 15 | 16 | Q_SIGNALS: 17 | void finished(); 18 | 19 | private Q_SLOTS: 20 | void render(); 21 | 22 | private: 23 | QWebPage page; 24 | }; 25 | 26 | #endif // THUMBNAILER_H 27 | -------------------------------------------------------------------------------- /QWebViewPageAndCookie/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that the how to get cookie about QWebView. -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb.opensdf: -------------------------------------------------------------------------------- 1 | AdministratorCFF -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LoginWeb", "LoginWeb\LoginWeb.vcxproj", "{B12702AD-ABFB-343A-A199-8E24837244A3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {B12702AD-ABFB-343A-A199-8E24837244A3}.Debug|Win32.Build.0 = Debug|Win32 14 | {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.ActiveCfg = Release|Win32 15 | {B12702AD-ABFB-343A-A199-8E24837244A3}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb.v11.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb.v11.suo -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/CL.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/CL.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/LoginWeb.lastbuildstate: -------------------------------------------------------------------------------- 1 | #v4.0:v110:false 2 | Debug|Win32|E:\vs2012\LoginWeb\| 3 | -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/LoginWeb.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/LoginWeb.res -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/cl.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/cl.command.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/custombuild.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/custombuild.command.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/custombuild.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/custombuild.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/custombuild.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/custombuild.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link-cvtres.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link-cvtres.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link-cvtres.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link-cvtres.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link-rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link-rc.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link-rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link-rc.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.1656-cvtres.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.1656-cvtres.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.1656-cvtres.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.1656-cvtres.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.1656-rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.1656-rc.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.1656-rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.1656-rc.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.1656.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.1656.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.1656.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.1656.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3496-cvtres.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3496-cvtres.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3496-cvtres.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3496-cvtres.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3496-rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3496-rc.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3496-rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3496-rc.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3496.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3496.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3496.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3496.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3760-cvtres.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3760-cvtres.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3760-cvtres.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3760-cvtres.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3760-rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3760-rc.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3760-rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3760-rc.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3760.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3760.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.3760.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.3760.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.command.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/link.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/loginweb.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/loginweb.obj -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/main.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/main.obj -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/moc_loginweb.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/moc_loginweb.obj -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/qrc_loginweb.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/qrc_loginweb.obj -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/rc.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/rc.command.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/rc.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/rc.read.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/rc.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/rc.write.1.tlog -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/Debug/vc110.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/Debug/vc110.pdb -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/LoginWeb.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/LoginWeb.ico -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/LoginWeb.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "LoginWeb.ico" 2 | 3 | -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/LoginWeb.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | D:\Qt5.5.1\5.5\msvc2012 6 | PATH=$(QTDIR)\bin%3b$(PATH) 7 | 8 | 9 | D:\Qt5.5.1\5.5\msvc2012 10 | PATH=$(QTDIR)\bin%3b$(PATH) 11 | 12 | -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/loginweb.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/LoginWeb/loginweb.cpp -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/loginweb.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGINWEB_H 2 | #define LOGINWEB_H 3 | 4 | #include 5 | #include "ui_loginweb.h" 6 | 7 | class LoginWeb : public QWidget 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | LoginWeb(QWidget *parent = 0); 13 | ~LoginWeb(); 14 | 15 | protected: 16 | void timerEvent(QTimerEvent *event); 17 | 18 | private: 19 | Ui::LoginWebClass ui; 20 | }; 21 | 22 | #endif // LOGINWEB_H 23 | -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/loginweb.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /QWebViewPageAndCookie/LoginWeb/main.cpp: -------------------------------------------------------------------------------- 1 | #include "loginweb.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | LoginWeb w; 8 | w.show(); 9 | return a.exec(); 10 | } 11 | -------------------------------------------------------------------------------- /QWebViewPageAndCookie/Win32/Debug/LoginWeb.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/Win32/Debug/LoginWeb.exe -------------------------------------------------------------------------------- /QWebViewPageAndCookie/Win32/Debug/LoginWeb.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/Win32/Debug/LoginWeb.ilk -------------------------------------------------------------------------------- /QWebViewPageAndCookie/Win32/Debug/LoginWeb.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/QWebViewPageAndCookie/Win32/Debug/LoginWeb.pdb -------------------------------------------------------------------------------- /QWindowBase/QWindowBase.pro: -------------------------------------------------------------------------------- 1 | QT += core gui 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | TARGET = QWindowBase 6 | TEMPLATE = app 7 | 8 | DEFINES += QT_DEPRECATED_WARNINGS 9 | 10 | SOURCES += main.cpp \ 11 | window.cpp \ 12 | widget.cpp 13 | 14 | HEADERS += \ 15 | window.h \ 16 | widget.h 17 | 18 | FORMS += \ 19 | widget.ui 20 | -------------------------------------------------------------------------------- /QWindowBase/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | 8 | Widget w; 9 | w.show(); 10 | 11 | return a.exec(); 12 | } 13 | -------------------------------------------------------------------------------- /QWindowBase/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include "window.h" 4 | #include 5 | 6 | Widget::Widget(QWidget *parent) : 7 | QWidget(parent), 8 | ui(new Ui::Widget) 9 | { 10 | ui->setupUi(this); 11 | this->setWindowTitle("CSDN IT1995"); 12 | m_window = new Window; 13 | QWidget *widget = QWidget::createWindowContainer(m_window); 14 | QHBoxLayout *lay = new QHBoxLayout; 15 | lay->addWidget(widget); 16 | ui->widget->setLayout(lay); 17 | connect(ui->lineEdit, SIGNAL(textChanged(QString)), m_window, SLOT(getMsg(QString))); 18 | } 19 | 20 | Widget::~Widget() 21 | { 22 | delete m_window; 23 | delete ui; 24 | } 25 | -------------------------------------------------------------------------------- /QWindowBase/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | class Window; 7 | 8 | namespace Ui { 9 | class Widget; 10 | } 11 | 12 | class Widget : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit Widget(QWidget *parent = 0); 18 | ~Widget(); 19 | 20 | private: 21 | Ui::Widget *ui; 22 | Window *m_window; 23 | }; 24 | 25 | #endif // WIDGET_H 26 | -------------------------------------------------------------------------------- /QWindowBase/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 494 10 | 385 11 | 12 | 13 | 14 | Form 15 | 16 | 17 | 18 | 19 | 20 | 21 | 0 22 | 0 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /QWindowBase/window.h: -------------------------------------------------------------------------------- 1 | #ifndef WINDOW_H 2 | #define WINDOW_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | class QPainter; 9 | class QBackingStore; 10 | QT_END_NAMESPACE 11 | 12 | class Window : public QWindow 13 | { 14 | Q_OBJECT 15 | public: 16 | Window(QWindow *parent = 0); 17 | void render(QPainter *painter); 18 | void setStr(const QString &str); 19 | 20 | public slots: 21 | void renderLater(); 22 | void renderNow(); 23 | void getMsg(const QString &str); 24 | 25 | protected: 26 | bool event(QEvent *event) override; 27 | 28 | void resizeEvent(QResizeEvent *event) override; 29 | void exposeEvent(QExposeEvent *event) override; 30 | 31 | private: 32 | QBackingStore *m_backingStore; 33 | QString m_str; 34 | 35 | }; 36 | 37 | #endif // WINDOW_H 38 | -------------------------------------------------------------------------------- /Q_ENUMDemo/EnumTest.cpp: -------------------------------------------------------------------------------- 1 | #include "EnumTest.h" 2 | 3 | EnumTest::EnumTest(QObject *parent) : QObject(parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /Q_ENUMDemo/EnumTest.h: -------------------------------------------------------------------------------- 1 | #ifndef ENUMTEST_H 2 | #define ENUMTEST_H 3 | 4 | #include 5 | 6 | class EnumTest : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | EnumTest(QObject *parent = nullptr); 11 | enum MyType{ 12 | One, Two, Three, Four 13 | }; 14 | enum CType{ 15 | One1, Two2, Three3, Four4 16 | }; 17 | 18 | Q_ENUM(MyType) 19 | 20 | }; 21 | 22 | #endif // ENUMTEST_H 23 | -------------------------------------------------------------------------------- /Q_ENUMDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "EnumTest.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QCoreApplication a(argc, argv); 9 | 10 | QMetaEnum myType = QMetaEnum::fromType(); 11 | int count = myType.keyCount(); 12 | 13 | for(int i = 0; i < count; i++){ 14 | 15 | qDebug() << myType.value(i); 16 | } 17 | 18 | qDebug() << "----------华丽的分割线----------"; 19 | 20 | qDebug() << EnumTest::MyType::One; 21 | qDebug() << EnumTest::One1; 22 | 23 | qDebug() << "----------华丽的分割线----------"; 24 | QVariant var; 25 | qDebug() << var.value(); 26 | qDebug() << var.value(); 27 | 28 | if(EnumTest::MyType::One == 0){ 29 | 30 | qDebug() << "zero"; 31 | } 32 | 33 | return a.exec(); 34 | } 35 | -------------------------------------------------------------------------------- /Q_ENUMDemo/main.cpp.autosave: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "EnumTest.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QCoreApplication a(argc, argv); 9 | 10 | QMetaEnum myType = QMetaEnum::fromType(); 11 | int count = myType.keyCount(); 12 | 13 | for(int i = 0; i < count; i++){ 14 | 15 | qDebug() << myType.value(i); 16 | } 17 | 18 | qDebug() << "----------华丽的分割线----------"; 19 | 20 | qDebug() << EnumTest::MyType::One; 21 | qDebug() << EnumTest::One1; 22 | 23 | qDebug() << "----------华丽的分割线----------"; 24 | QVariant var; 25 | qDebug() << var.value(); 26 | // qDebug() << var.value(); 27 | 28 | if(EnumTest::MyType::One == 0){ 29 | 30 | qDebug() << "zero"; 31 | } 32 | 33 | return a.exec(); 34 | } 35 | -------------------------------------------------------------------------------- /Qt3DLabel/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 | -------------------------------------------------------------------------------- /Qt3DLabel/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | namespace Ui { class Widget; } 8 | namespace QtDataVisualization{ 9 | class Q3DSurface; 10 | class QCustom3DLabel; 11 | } 12 | class QPropertyAnimation; 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 | public slots: 24 | void handleElementSelected(int type); 25 | 26 | protected: 27 | void createLabel(const QString text); 28 | 29 | private: 30 | Ui::Widget *ui; 31 | QtDataVisualization::Q3DSurface *m_surface; 32 | QtDataVisualization::QCustom3DLabel *m_label; 33 | QPropertyAnimation *m_selectionAnimation; 34 | }; 35 | #endif // WIDGET_H 36 | -------------------------------------------------------------------------------- /QtWebSearchKey/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /QtWebSearchKey/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_USE_NAMESPACE 7 | class QNetworkAccessManager; 8 | QT_END_NAMESPACE 9 | 10 | namespace Ui { 11 | class Widget; 12 | } 13 | 14 | class Widget : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Widget(QWidget *parent = nullptr); 20 | ~Widget(); 21 | 22 | protected slots: 23 | void inputChanged(const QString &text); 24 | 25 | protected: 26 | void resetListWidget(QStringList list); 27 | 28 | private: 29 | Ui::Widget *ui; 30 | QNetworkAccessManager *m_manager; 31 | }; 32 | 33 | #endif // WIDGET_H 34 | -------------------------------------------------------------------------------- /QtWebSearchKey/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /QtWebSocketDemo/WebSocketDemo.pro: -------------------------------------------------------------------------------- 1 | QT += core websockets 2 | QT -= gui 3 | 4 | CONFIG += c++11 5 | 6 | TARGET = WebSocketDemo 7 | CONFIG += console 8 | CONFIG -= app_bundle 9 | 10 | TEMPLATE = app 11 | 12 | SOURCES += main.cpp \ 13 | Server.cpp 14 | 15 | # The following define makes your compiler emit warnings if you use 16 | # any feature of Qt which as been marked deprecated (the exact warnings 17 | # depend on your compiler). Please consult the documentation of the 18 | # deprecated API in order to know how to port your code away from it. 19 | DEFINES += QT_DEPRECATED_WARNINGS 20 | 21 | # You can also make your code fail to compile if you use deprecated APIs. 22 | # In order to do so, uncomment the following line. 23 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 24 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 25 | 26 | HEADERS += \ 27 | Server.h 28 | -------------------------------------------------------------------------------- /QtWebSocketDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Server.h" 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication a(argc, argv); 7 | 8 | Server Server(1234); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /QxOrmDemo1/export.h: -------------------------------------------------------------------------------- 1 | #ifndef EXPORT_H 2 | #define EXPORT_H 3 | 4 | #ifdef _BUILDING_QX_DEMO 5 | #define QX_DEMO_DLL_EXPORT QX_DLL_EXPORT_HELPER 6 | #else 7 | #define QX_DEMO_DLL_EXPORT QX_DLL_IMPORT_HELPER 8 | #endif 9 | 10 | #ifdef _BUILDING_QX_DEMO 11 | #define QX_REGISTER_HPP_QX_DEMO QX_REGISTER_HPP_EXPORT_DLL 12 | #define QX_REGISTER_CPP_QX_DEMO QX_REGISTER_CPP_EXPORT_DLL 13 | #else 14 | #define QX_REGISTER_HPP_QX_DEMO QX_REGISTER_HPP_IMPORT_DLL 15 | #define QX_REGISTER_CPP_QX_DEMO QX_REGISTER_CPP_IMPORT_DLL 16 | #endif 17 | 18 | #endif // EXPORT_H 19 | -------------------------------------------------------------------------------- /QxOrmDemo1/precompiled.h: -------------------------------------------------------------------------------- 1 | #ifndef PRECOMPILED_H 2 | #define PRECOMPILED_H 3 | 4 | #include 5 | #include "export.h" 6 | 7 | #endif // PRECOMPILED_H 8 | -------------------------------------------------------------------------------- /QxOrmDemo1/user.cpp: -------------------------------------------------------------------------------- 1 | #include "precompiled.h" 2 | #include "user.h" 3 | #include 4 | 5 | QX_REGISTER_CPP_QX_DEMO(User) 6 | 7 | namespace qx{ 8 | 9 | template <> void register_class(QxClass &t){ 10 | 11 | t.id(&User::id, "id"); 12 | t.data(&User::age, "age"); 13 | t.data(&User::name, "name"); 14 | t.data(&User::capacity, "capacity"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /QxOrmDemo1/user.h: -------------------------------------------------------------------------------- 1 | #ifndef USER_H 2 | #define USER_H 3 | 4 | class QX_DEMO_DLL_EXPORT User{ 5 | 6 | public: 7 | int id; 8 | QString name; 9 | int age; 10 | double capacity; 11 | 12 | User(): id(1){} 13 | virtual ~User(){} 14 | }; 15 | 16 | QX_REGISTER_PRIMARY_KEY(User, int) 17 | QX_REGISTER_HPP_QX_DEMO(User, qx::trait::no_base_class_defined, 0) 18 | 19 | typedef std::shared_ptr User_ptr; 20 | typedef qx::QxCollection List_user; 21 | 22 | #endif // USER_H 23 | -------------------------------------------------------------------------------- /RSAEncryptionAndDecryption/RSAEncryptionAndDecryption.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | QT -= gui 3 | 4 | TARGET = RSAEncryptionAndDecryption 5 | CONFIG += console 6 | CONFIG -= app_bundle 7 | 8 | QMAKE_CFLAGS = -fpermissive 9 | QMAKE_CXXFLAGS = -fpermissive 10 | QMAKE_LFLAGS = -fpermissive 11 | 12 | INCLUDEPATH += /usr/local/ssl/include 13 | LIBS += -L /usr/local/ssl/lib/ -lssl -lcrypto 14 | 15 | 16 | TEMPLATE = app 17 | 18 | SOURCES += main.cpp 19 | 20 | -------------------------------------------------------------------------------- /RSAEncryptionAndDecryption/public.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCqtrWUqPrhnKkdtB6Vf 3 | qenJrOuJ6UDdFSijuwTGzUuIKN+gJsO4g5wrdA2fOnvF+r6OJeJPYWBZ2tjrEVmh 4 | hxgcW6qfP1GfL9WHUVcLKSvCCJnRu/9g0027pTzoz1Z45JCi5aq/LMtt9Eykw157 5 | 3sen7L6eOD0P5rFnjM+c/BUlPDug5p/Yb73HNRwLGcvKi66gB+O7iZhdXljkROh0 6 | dS9M7TTF+CcL73I/IeEpsKmU2cvdYIX4J+RmcB+1v6taSZYYS8tvMKd+BTgGqKXg 7 | x4DdFpgAkjx8iRcP/pAHTRSPqZN5d4ijJARYtCPBfwbFu/FziUH9jciAsKwoKM5d 8 | ewIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /RTTRDemo/RTTRDemo.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | QT -= gui 3 | 4 | CONFIG += c++11 5 | 6 | TARGET = RTTRDemo 7 | CONFIG += console 8 | CONFIG -= app_bundle 9 | 10 | TEMPLATE = app 11 | 12 | SOURCES += main.cpp 13 | 14 | 15 | INCLUDEPATH += /xxxx/xxxx/CFFPro/rttr-0.9.5-src/src 16 | LIBS += -L/xxxx/xxxx/CFFPro/rttr-0.9.5-src/bin -lrttr_core 17 | -------------------------------------------------------------------------------- /RTTRDemo/librttr_core.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/RTTRDemo/librttr_core.so -------------------------------------------------------------------------------- /RTTRDemo/librttr_core.so.0.9.5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/RTTRDemo/librttr_core.so.0.9.5 -------------------------------------------------------------------------------- /RadioButtonQML/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that the radioButton of QML. -------------------------------------------------------------------------------- /RadioButtonQML/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | if (engine.rootObjects().isEmpty()) 13 | return -1; 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /RadioButtonQML/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | 5 | 6 | -------------------------------------------------------------------------------- /RedisWithQt/begin.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | QT -= gui 3 | 4 | CONFIG += c++11 5 | 6 | TARGET = begin 7 | CONFIG += console 8 | CONFIG -= app_bundle 9 | 10 | TEMPLATE = app 11 | 12 | SOURCES += main.cpp 13 | 14 | 15 | LIBS += -L/home/ngsgcc/test_kf/MyRedis/hiredis-master -lhiredis 16 | INCLUDEPATH += /home/ngsgcc/test_kf/MyRedis/hiredis-master 17 | 18 | HEADERS += \ 19 | ../../hiredis-master/adapters/qt.h 20 | 21 | -------------------------------------------------------------------------------- /ReflectDemo/ReflectTest.cpp: -------------------------------------------------------------------------------- 1 | #include "ReflectTest.h" 2 | 3 | ReflectTest::ReflectTest(QObject *parent) : QObject(parent) 4 | { 5 | 6 | } 7 | 8 | void ReflectTest::setPrint(const QString &print) 9 | { 10 | m_print = print; 11 | } 12 | 13 | QString ReflectTest::getPrint() 14 | { 15 | return m_print; 16 | } 17 | 18 | QString ReflectTest::testFunction(QString para) 19 | { 20 | return "return:" + para; 21 | } 22 | -------------------------------------------------------------------------------- /ReflectDemo/ReflectTest.h: -------------------------------------------------------------------------------- 1 | #ifndef REFLECTTEST_H 2 | #define REFLECTTEST_H 3 | 4 | #include 5 | 6 | class ReflectTest : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | ReflectTest(QObject *parent = nullptr); 11 | Q_INVOKABLE void setPrint(const QString &print); 12 | Q_INVOKABLE QString getPrint(); 13 | Q_INVOKABLE QString testFunction(QString para); 14 | 15 | private: 16 | QString m_print; 17 | 18 | }; 19 | 20 | #endif // REFLECTTEST_H 21 | -------------------------------------------------------------------------------- /SemaphoreTest/Boss.cpp: -------------------------------------------------------------------------------- 1 | #include "Boss.h" 2 | #include 3 | #include 4 | #include 5 | 6 | Boss::Boss(QSemaphore *sem, QObject *parent) : QObject(parent) 7 | { 8 | m_sem = sem; 9 | } 10 | 11 | Boss::~Boss() 12 | { 13 | qDebug() << "BOSS 析构"; 14 | } 15 | 16 | void Boss::doWork() 17 | { 18 | qDebug() << "子线程[" << QThread::currentThread() << "]: " << "BOSS" << " 等待所有人完成工作..."; 19 | m_sem->acquire(1); 20 | qDebug() << "子线程[" << QThread::currentThread() << "]: " << "BOSS" << " 开始检测工作!!!"; 21 | } 22 | -------------------------------------------------------------------------------- /SemaphoreTest/Boss.h: -------------------------------------------------------------------------------- 1 | #ifndef BOSS_H 2 | #define BOSS_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QSemaphore; 8 | QT_END_NAMESPACE 9 | 10 | class Boss : public QObject 11 | { 12 | Q_OBJECT 13 | public: 14 | Boss(QSemaphore *sem, QObject *parent = nullptr); 15 | ~Boss(); 16 | 17 | public slots: 18 | void doWork(); 19 | 20 | private: 21 | QSemaphore *m_sem; 22 | 23 | }; 24 | 25 | #endif // BOSS_H 26 | -------------------------------------------------------------------------------- /SemaphoreTest/Worker.cpp: -------------------------------------------------------------------------------- 1 | #include "Worker.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | Worker::Worker(QSemaphore *sem, QString name, QObject *parent) : QObject(parent) 8 | { 9 | m_sem = sem; 10 | m_name = name; 11 | } 12 | 13 | Worker::~Worker() 14 | { 15 | qDebug() << m_name << " 析构"; 16 | } 17 | 18 | void Worker::doWork() 19 | { 20 | qsrand(QTime::currentTime().msec() + QTime::currentTime().second()*1000); 21 | qDebug() << "子线程[" << QThread::currentThread() << "]: " << m_name << " 正在干活..."; 22 | QThread::sleep(qrand() % 10 + 5); 23 | qDebug() << "子线程[" << QThread::currentThread() << "]: " << m_name << " 活干完了!!!"; 24 | m_sem->release(1); 25 | } 26 | -------------------------------------------------------------------------------- /SemaphoreTest/Worker.h: -------------------------------------------------------------------------------- 1 | #ifndef WORKER_H 2 | #define WORKER_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QSemaphore; 8 | QT_END_NAMESPACE 9 | 10 | class Worker : public QObject 11 | { 12 | Q_OBJECT 13 | public: 14 | Worker(QSemaphore *sem, QString name, QObject *parent = nullptr); 15 | ~Worker(); 16 | 17 | public slots: 18 | void doWork(); 19 | 20 | private: 21 | QString m_name; 22 | QSemaphore *m_sem; 23 | }; 24 | 25 | #endif // WORKER_H 26 | -------------------------------------------------------------------------------- /SimpleHttpServer/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project create a simple server of HTTP. -------------------------------------------------------------------------------- /SimpleHttpServer/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /SimpleHttpServer/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QTcpServer; 8 | class QTcpSocket; 9 | QT_END_NAMESPACE 10 | 11 | namespace Ui { 12 | class Widget; 13 | } 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit Widget(QWidget *parent = 0); 21 | ~Widget(); 22 | 23 | 24 | protected slots: 25 | void newConnectionSlot(); 26 | void errorStringSlot(); 27 | void sendMsg(); 28 | 29 | private: 30 | Ui::Widget *ui; 31 | QTcpServer *m_tcpServer; 32 | QTcpSocket *m_tcpSocket; 33 | }; 34 | 35 | #endif // WIDGET_H 36 | -------------------------------------------------------------------------------- /SimpleHttpServer/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /SpritesOfQML/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This sprites about QML. -------------------------------------------------------------------------------- /SpritesOfQML/img/bg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/SpritesOfQML/img/bg.jpeg -------------------------------------------------------------------------------- /SpritesOfQML/img/soldier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/SpritesOfQML/img/soldier.png -------------------------------------------------------------------------------- /SpritesOfQML/img/soldier.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Item { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /SpritesOfQML/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | if (engine.rootObjects().isEmpty()) 13 | return -1; 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /SpritesOfQML/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.9 2 | import QtQuick.Window 2.2 3 | 4 | Window { 5 | visible: true 6 | width: 640 7 | height: 480 8 | title: qsTr("Sprite Demo") 9 | 10 | Image { 11 | id: bg 12 | source: "qrc:/img/bg.jpeg" 13 | fillMode: Image.Pad 14 | } 15 | 16 | Soldier{ 17 | 18 | id : soldier 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SpritesOfQML/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | img/soldier.png 5 | Soldier.qml 6 | img/bg.jpeg 7 | 8 | 9 | -------------------------------------------------------------------------------- /StaticMetaObjectDemo/StaticMetaObjectDemo.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 console 4 | CONFIG -= app_bundle 5 | 6 | # You can make your code fail to compile if it uses deprecated APIs. 7 | # In order to do so, uncomment the following line. 8 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 9 | 10 | SOURCES += \ 11 | main.cpp 12 | 13 | # Default rules for deployment. 14 | qnx: target.path = /tmp/$${TARGET}/bin 15 | else: unix:!android: target.path = /opt/$${TARGET}/bin 16 | !isEmpty(target.path): INSTALLS += target 17 | 18 | HEADERS += \ 19 | TestClass.h 20 | -------------------------------------------------------------------------------- /StaticMetaObjectDemo/TestClass.cpp: -------------------------------------------------------------------------------- 1 | #include "TestClass.h" 2 | 3 | TestClass::TestClass(QObject *parent) : QObject(parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /TestFieldOfQML/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | the testField of QML. -------------------------------------------------------------------------------- /TestFieldOfQML/MyTextField.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Controls.Styles 1.2 3 | import QtQuick.Controls 1.2 4 | 5 | Item { 6 | 7 | Image{ 8 | 9 | width: parent.width 10 | source: "qrc:/img/textfield_2.png" 11 | 12 | TextField{ 13 | 14 | anchors { 15 | 16 | left: parent.left 17 | leftMargin: 45 18 | top: parent.top 19 | topMargin: 20 20 | } 21 | 22 | width: parent.width - 90 23 | 24 | font.pointSize: 20 25 | 26 | style: TextFieldStyle{ 27 | 28 | background: BorderImage { 29 | 30 | } 31 | 32 | 33 | } 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /TestFieldOfQML/MyTextField2.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import QtQuick.Controls.Styles 1.2 3 | import QtQuick.Controls 1.2 4 | 5 | Item { 6 | 7 | Image{ 8 | 9 | source: "qrc:/img/textfield_3.png" 10 | width: 420 11 | height: 300 12 | 13 | TextField{ 14 | 15 | id: textField 16 | anchors { 17 | 18 | left: parent.left 19 | leftMargin: 40 20 | top: parent.top 21 | topMargin: 155 22 | } 23 | 24 | rotation: -8 25 | width: parent.width - 170 26 | font.pointSize: 32 27 | 28 | smooth: true 29 | antialiasing: true 30 | 31 | style: TextFieldStyle{ 32 | 33 | background: BorderImage { 34 | 35 | } 36 | 37 | 38 | } 39 | } 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /TestFieldOfQML/TestFieldOfQML.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/TestFieldOfQML/TestFieldOfQML.lnk -------------------------------------------------------------------------------- /TestFieldOfQML/img/textfield_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/TestFieldOfQML/img/textfield_1.png -------------------------------------------------------------------------------- /TestFieldOfQML/img/textfield_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/TestFieldOfQML/img/textfield_2.png -------------------------------------------------------------------------------- /TestFieldOfQML/img/textfield_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/TestFieldOfQML/img/textfield_3.png -------------------------------------------------------------------------------- /TestFieldOfQML/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | if (engine.rootObjects().isEmpty()) 13 | return -1; 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /TestFieldOfQML/mytextfield.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /TestFieldOfQML/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | img/textfield_1.png 5 | img/textfield_2.png 6 | img/textfield_3.png 7 | MyTextField.qml 8 | MyTextField2.qml 9 | 10 | 11 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that the redirection of HTTP. -------------------------------------------------------------------------------- /TheRedirectOfHTTP/httpserver/httpglobal.cpp: -------------------------------------------------------------------------------- 1 | #include "httpglobal.h" 2 | 3 | const char* getQtWebAppLibVersion() 4 | { 5 | return "1.7.8"; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/httpserver/httpglobal.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file 3 | @author Stefan Frings 4 | */ 5 | 6 | #ifndef HTTPGLOBAL_H 7 | #define HTTPGLOBAL_H 8 | 9 | #include 10 | 11 | // This is specific to Windows dll's 12 | #if defined(Q_OS_WIN) 13 | #if defined(QTWEBAPPLIB_EXPORT) 14 | #define DECLSPEC Q_DECL_EXPORT 15 | #elif defined(QTWEBAPPLIB_IMPORT) 16 | #define DECLSPEC Q_DECL_IMPORT 17 | #endif 18 | #endif 19 | #if !defined(DECLSPEC) 20 | #define DECLSPEC 21 | #endif 22 | 23 | /** Get the library version number */ 24 | DECLSPEC const char* getQtWebAppLibVersion(); 25 | 26 | 27 | #endif // HTTPGLOBAL_H 28 | 29 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/httpserver/httprequesthandler.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | @file 3 | @author Stefan Frings 4 | */ 5 | 6 | #include "httprequesthandler.h" 7 | 8 | using namespace stefanfrings; 9 | 10 | HttpRequestHandler::HttpRequestHandler(QObject* parent) 11 | : QObject(parent) 12 | {} 13 | 14 | HttpRequestHandler::~HttpRequestHandler() 15 | {} 16 | 17 | void HttpRequestHandler::service(HttpRequest& request, HttpResponse& response) 18 | { 19 | qCritical("HttpRequestHandler: you need to override the service() function"); 20 | qDebug("HttpRequestHandler: request=%s %s %s",request.getMethod().data(),request.getPath().data(),request.getVersion().data()); 21 | response.setStatus(501,"not implemented"); 22 | response.write("501 not implemented",true); 23 | } 24 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/httpserver/myrequesthandler.cpp: -------------------------------------------------------------------------------- 1 | #include "myrequesthandler.h" 2 | 3 | MyRequestHandler::MyRequestHandler(QObject *parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/httpserver/myrequesthandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MYREQUESTHANDLER_H 2 | #define MYREQUESTHANDLER_H 3 | 4 | 5 | class MyRequestHandler 6 | { 7 | public: 8 | MyRequestHandler(); 9 | }; 10 | 11 | #endif // MYREQUESTHANDLER_H 12 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "httpserver/httplistener.h" 4 | #include "myrequesthandler.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | 10 | QSettings *listenerSettings=new QSettings("E:\\Qt2019\\useQtWebAPP\\conf.ini", QSettings::IniFormat, &a); 11 | listenerSettings->beginGroup("listener"); 12 | new HttpListener(listenerSettings, new MyRequestHandler, &a); 13 | 14 | 15 | return a.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/myrequesthandler.cpp: -------------------------------------------------------------------------------- 1 | #include "myrequesthandler.h" 2 | #include 3 | #include 4 | #include 5 | 6 | MyRequestHandler::MyRequestHandler(QObject* parent): HttpRequestHandler(parent) 7 | { 8 | Q_UNUSED(parent) 9 | } 10 | 11 | void MyRequestHandler::service(HttpRequest &request, HttpResponse &response) 12 | { 13 | QByteArray path=request.getPath(); 14 | QString str(path); 15 | 16 | if(str == "/"){ 17 | 18 | response.setStatus(302); 19 | response.setHeader("Location", "/new"); 20 | } 21 | else{ 22 | 23 | response.setStatus(200); 24 | response.setHeader("Content-Type", "text/html"); 25 | response.write("

IT1995

"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/myrequesthandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MYREQUESTHANDLER_H 2 | #define MYREQUESTHANDLER_H 3 | 4 | #include "httpserver/httprequesthandler.h" 5 | using namespace stefanfrings; 6 | 7 | class MyRequestHandler: public HttpRequestHandler 8 | { 9 | Q_OBJECT 10 | public: 11 | MyRequestHandler(QObject* parent=nullptr); 12 | void service(HttpRequest& request, HttpResponse& response); 13 | }; 14 | 15 | #endif // MYREQUESTHANDLER_H 16 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/re/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | IT1995 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/re/pic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/TheRedirectOfHTTP/re/pic.jpg -------------------------------------------------------------------------------- /TheRedirectOfHTTP/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | re/index.html 4 | re/pic.jpg 5 | 6 | 7 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/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 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | 22 | #endif // WIDGET_H 23 | -------------------------------------------------------------------------------- /TheRedirectOfHTTP/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that the use QtWebApp frame to create HTTP server. -------------------------------------------------------------------------------- /UseQtWebAppFrame/httpserver/httpglobal.cpp: -------------------------------------------------------------------------------- 1 | #include "httpglobal.h" 2 | 3 | const char* getQtWebAppLibVersion() 4 | { 5 | return "1.7.8"; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/httpserver/httpglobal.h: -------------------------------------------------------------------------------- 1 | /** 2 | @file 3 | @author Stefan Frings 4 | */ 5 | 6 | #ifndef HTTPGLOBAL_H 7 | #define HTTPGLOBAL_H 8 | 9 | #include 10 | 11 | // This is specific to Windows dll's 12 | #if defined(Q_OS_WIN) 13 | #if defined(QTWEBAPPLIB_EXPORT) 14 | #define DECLSPEC Q_DECL_EXPORT 15 | #elif defined(QTWEBAPPLIB_IMPORT) 16 | #define DECLSPEC Q_DECL_IMPORT 17 | #endif 18 | #endif 19 | #if !defined(DECLSPEC) 20 | #define DECLSPEC 21 | #endif 22 | 23 | /** Get the library version number */ 24 | DECLSPEC const char* getQtWebAppLibVersion(); 25 | 26 | 27 | #endif // HTTPGLOBAL_H 28 | 29 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/httpserver/httprequesthandler.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | @file 3 | @author Stefan Frings 4 | */ 5 | 6 | #include "httprequesthandler.h" 7 | 8 | using namespace stefanfrings; 9 | 10 | HttpRequestHandler::HttpRequestHandler(QObject* parent) 11 | : QObject(parent) 12 | {} 13 | 14 | HttpRequestHandler::~HttpRequestHandler() 15 | {} 16 | 17 | void HttpRequestHandler::service(HttpRequest& request, HttpResponse& response) 18 | { 19 | qCritical("HttpRequestHandler: you need to override the service() function"); 20 | qDebug("HttpRequestHandler: request=%s %s %s",request.getMethod().data(),request.getPath().data(),request.getVersion().data()); 21 | response.setStatus(501,"not implemented"); 22 | response.write("501 not implemented",true); 23 | } 24 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/httpserver/myrequesthandler.cpp: -------------------------------------------------------------------------------- 1 | #include "myrequesthandler.h" 2 | 3 | MyRequestHandler::MyRequestHandler(QObject *parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/httpserver/myrequesthandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MYREQUESTHANDLER_H 2 | #define MYREQUESTHANDLER_H 3 | 4 | 5 | class MyRequestHandler 6 | { 7 | public: 8 | MyRequestHandler(); 9 | }; 10 | 11 | #endif // MYREQUESTHANDLER_H 12 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "httpserver/httplistener.h" 4 | #include "myrequesthandler.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | 10 | QSettings *listenerSettings=new QSettings("E:\\Qt2019\\useQtWebAPP\\conf.ini", QSettings::IniFormat, &a); 11 | listenerSettings->beginGroup("listener"); 12 | 13 | new HttpListener(listenerSettings, new MyRequestHandler, &a); 14 | 15 | return a.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/myrequesthandler.cpp: -------------------------------------------------------------------------------- 1 | #include "myrequesthandler.h" 2 | #include 3 | #include 4 | 5 | MyRequestHandler::MyRequestHandler(QObject* parent): HttpRequestHandler(parent) 6 | { 7 | Q_UNUSED(parent) 8 | } 9 | 10 | void MyRequestHandler::service(HttpRequest &request, HttpResponse &response) 11 | { 12 | QByteArray path=request.getPath(); 13 | qDebug() << path; 14 | 15 | QByteArray username("IT1995"); 16 | 17 | response.setHeader("Content-Type", "text/html; charset=ISO-8859-1"); 18 | 19 | response.write(""); 20 | response.write("

"); 21 | response.write("Hello "); 22 | response.write(username); 23 | response.write("

"); 24 | response.write(""); 25 | } 26 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/myrequesthandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MYREQUESTHANDLER_H 2 | #define MYREQUESTHANDLER_H 3 | 4 | #include "httpserver/httprequesthandler.h" 5 | using namespace stefanfrings; 6 | 7 | class MyRequestHandler: public HttpRequestHandler 8 | { 9 | Q_OBJECT 10 | public: 11 | MyRequestHandler(QObject* parent=nullptr); 12 | void service(HttpRequest& request, HttpResponse& response); 13 | }; 14 | 15 | #endif // MYREQUESTHANDLER_H 16 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/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 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | 22 | #endif // WIDGET_H 23 | -------------------------------------------------------------------------------- /UseQtWebAppFrame/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /WebEngineTest/WebEngineTest.pro: -------------------------------------------------------------------------------- 1 | QT += core gui webenginewidgets 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | TARGET = WebEngineTest 6 | TEMPLATE = app 7 | 8 | DEFINES += QT_DEPRECATED_WARNINGS 9 | 10 | SOURCES += main.cpp\ 11 | Widget.cpp 12 | 13 | HEADERS += Widget.h 14 | 15 | FORMS += Widget.ui 16 | -------------------------------------------------------------------------------- /WebEngineTest/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 | -------------------------------------------------------------------------------- /WebEngineTest/Widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = 0); 16 | ~Widget(); 17 | 18 | private: 19 | Ui::Widget *ui; 20 | }; 21 | 22 | #endif // WIDGET_H 23 | -------------------------------------------------------------------------------- /WebEngineTest/Widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /WebEngineTest/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Widget.h" 2 | #include 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | //Widget w; 9 | //w.show(); 10 | 11 | QWebEngineView view; 12 | view.load(QUrl("http://192.1.101.118:8888")); 13 | view.show(); 14 | 15 | return a.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /WindowsPipe/pipe_client/pipe_client.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 console 4 | CONFIG -= app_bundle 5 | 6 | # You can make your code fail to compile if it uses deprecated APIs. 7 | # In order to do so, uncomment the following line. 8 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 9 | 10 | SOURCES += \ 11 | main.cpp 12 | 13 | # Default rules for deployment. 14 | qnx: target.path = /tmp/$${TARGET}/bin 15 | else: unix:!android: target.path = /opt/$${TARGET}/bin 16 | !isEmpty(target.path): INSTALLS += target 17 | -------------------------------------------------------------------------------- /WindowsPipe/pipe_server/pipe_server.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 console 4 | CONFIG -= app_bundle 5 | 6 | # You can make your code fail to compile if it uses deprecated APIs. 7 | # In order to do so, uncomment the following line. 8 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 9 | 10 | SOURCES += \ 11 | main.cpp 12 | 13 | # Default rules for deployment. 14 | qnx: target.path = /tmp/$${TARGET}/bin 15 | else: unix:!android: target.path = /opt/$${TARGET}/bin 16 | !isEmpty(target.path): INSTALLS += target 17 | -------------------------------------------------------------------------------- /XorPic/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 | uchar *m_secPtr; 21 | uchar *m_xorPtr; 22 | uchar *m_retPtr; 23 | }; 24 | #endif // WIDGET_H 25 | -------------------------------------------------------------------------------- /XorPic/lbxx.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/XorPic/lbxx.jpeg -------------------------------------------------------------------------------- /XorPic/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 | -------------------------------------------------------------------------------- /XorPic/resource.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | lbxx.jpeg 4 | xor.png 5 | tghg.png 6 | 7 | 8 | -------------------------------------------------------------------------------- /XorPic/tghg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/XorPic/tghg.png -------------------------------------------------------------------------------- /XorPic/xor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/XorPic/xor.png -------------------------------------------------------------------------------- /checkPasswdOfOD/TraceMe.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/checkPasswdOfOD/TraceMe.exe -------------------------------------------------------------------------------- /checkPasswdOfOD/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /checkPasswdOfOD/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include 4 | #include 5 | 6 | Widget::Widget(QWidget *parent) : 7 | QWidget(parent), 8 | ui(new Ui::Widget) 9 | { 10 | ui->setupUi(this); 11 | connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(btnClicked())); 12 | } 13 | 14 | Widget::~Widget() 15 | { 16 | delete ui; 17 | } 18 | 19 | void Widget::btnClicked() 20 | { 21 | QString passwd = ui->lineEdit->text(); 22 | 23 | if(isOK(passwd)){ 24 | 25 | 26 | QMessageBox::information(this, "提示", "成功"); 27 | } 28 | else{ 29 | 30 | QMessageBox::information(this, "提示", "失败"); 31 | } 32 | } 33 | 34 | bool Widget::isOK(QString str) 35 | { 36 | if(str == "www.it1995.cn") 37 | return true; 38 | 39 | return false; 40 | } 41 | -------------------------------------------------------------------------------- /checkPasswdOfOD/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = nullptr); 16 | ~Widget(); 17 | 18 | protected slots: 19 | void btnClicked(); 20 | 21 | protected: 22 | bool isOK(QString str); 23 | 24 | private: 25 | Ui::Widget *ui; 26 | }; 27 | 28 | #endif // WIDGET_H 29 | -------------------------------------------------------------------------------- /getLANUser/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This program shows that some ip address has been used in LAN. -------------------------------------------------------------------------------- /getLANUser/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /getLANUser/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QHostInfo; 8 | QT_END_NAMESPACE 9 | 10 | namespace Ui { 11 | class Widget; 12 | } 13 | 14 | class Widget : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit Widget(QWidget *parent = 0); 20 | ~Widget(); 21 | 22 | protected slots: 23 | void lookUp(const QHostInfo &host); 24 | void btnClicked(); 25 | 26 | private: 27 | Ui::Widget *ui; 28 | }; 29 | 30 | #endif // WIDGET_H 31 | -------------------------------------------------------------------------------- /keyQMLDemo/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | Key Element about QML. -------------------------------------------------------------------------------- /keyQMLDemo/Rect.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | 5 | id: rectangle 6 | 7 | width: 50 8 | height: 50 9 | 10 | color: "green" 11 | 12 | focus: true 13 | Keys.onLeftPressed: rectangle.x -= 8 14 | Keys.onRightPressed: rectangle.x += 8 15 | Keys.onUpPressed: rectangle.y -= 8 16 | Keys.onDownPressed: rectangle.y +=8 17 | 18 | Keys.onPressed: { 19 | 20 | console.debug("preessed") 21 | 22 | switch(event.key){ 23 | 24 | case Qt.Key_PageUp: 25 | rectangle.scale += 0.2 26 | break 27 | case Qt.Key_PageDown: 28 | rectangle.scale -= 0.2 29 | break 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /keyQMLDemo/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengfanchen/Qt/a55b92bcfafd94022cb8194d2a03348656097b5c/keyQMLDemo/img/bg.jpg -------------------------------------------------------------------------------- /keyQMLDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); 7 | 8 | QGuiApplication app(argc, argv); 9 | 10 | QQmlApplicationEngine engine; 11 | engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); 12 | if (engine.rootObjects().isEmpty()) 13 | return -1; 14 | 15 | return app.exec(); 16 | } 17 | -------------------------------------------------------------------------------- /keyQMLDemo/main.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.9 2 | import QtQuick.Window 2.2 3 | 4 | Window { 5 | visible: true 6 | width: 800 7 | height: 600 8 | title: qsTr("CSDN IT1995") 9 | 10 | Image { 11 | anchors.fill: parent 12 | id: bg 13 | source: "qrc:/img/bg.jpg" 14 | } 15 | 16 | Rect{ 17 | 18 | id: keys 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /keyQMLDemo/qml.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | img/bg.jpg 5 | Rect.qml 6 | 7 | 8 | -------------------------------------------------------------------------------- /pagingTable/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that the how to show pages about some widgets. -------------------------------------------------------------------------------- /pagingTable/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /pagingTable/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class Widget; 9 | } 10 | 11 | class Widget : public QWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit Widget(QWidget *parent = nullptr); 17 | ~Widget(); 18 | 19 | protected: 20 | void setListWidget(const int ¤tPage); 21 | 22 | protected slots: 23 | void upBtnClicked(); 24 | void downBtnClicked(); 25 | 26 | private: 27 | Ui::Widget *ui; 28 | QVector m_vec; 29 | int m_pageCount; 30 | 31 | int m_currentPageNum; //当前页数 32 | int m_countPageNum; //总页数 33 | }; 34 | 35 | #endif // WIDGET_H 36 | -------------------------------------------------------------------------------- /probuffDemo/file: -------------------------------------------------------------------------------- 1 | 2 | Hello world₩N -------------------------------------------------------------------------------- /probuffDemo/probuffDemo.pro: -------------------------------------------------------------------------------- 1 | QT += core 2 | QT -= gui 3 | 4 | CONFIG += c++11 5 | 6 | 7 | 8 | TARGET = probuffDemo 9 | CONFIG += console 10 | CONFIG -= app_bundle 11 | 12 | TEMPLATE = app 13 | 14 | SOURCES += main.cpp \ 15 | TestProtocStruMsg.pb.cc 16 | 17 | DEFINES += QT_DEPRECATED_WARNINGS 18 | 19 | LIBS += -L/usr/local/lib -lprotobuf -lprotobuf-lite -lprotoc 20 | 21 | HEADERS += \ 22 | TestProtocStruMsg.pb.h 23 | 24 | -------------------------------------------------------------------------------- /sharedLibrariesDemo/callLib/callLib.cpp: -------------------------------------------------------------------------------- 1 | #include "callLib.h" 2 | #include "ui_callLib.h" 3 | #include 4 | #include 5 | 6 | callLib::callLib(QWidget *parent) 7 | : QWidget(parent) 8 | , ui(new Ui::callLib) 9 | { 10 | ui->setupUi(this); 11 | m_lib = new LibDemo; 12 | m_lib->showNewWidgets(); 13 | } 14 | 15 | callLib::~callLib() 16 | { 17 | m_lib->freeWidgets(); 18 | delete m_lib; 19 | delete ui; 20 | } 21 | 22 | -------------------------------------------------------------------------------- /sharedLibrariesDemo/callLib/callLib.h: -------------------------------------------------------------------------------- 1 | #ifndef CALLLIB_H 2 | #define CALLLIB_H 3 | 4 | #include 5 | 6 | class LibDemo; 7 | 8 | QT_BEGIN_NAMESPACE 9 | namespace Ui { class callLib; } 10 | QT_END_NAMESPACE 11 | 12 | class callLib : public QWidget 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | callLib(QWidget *parent = nullptr); 18 | ~callLib(); 19 | 20 | private: 21 | Ui::callLib *ui; 22 | LibDemo *m_lib; 23 | }; 24 | #endif // CALLLIB_H 25 | -------------------------------------------------------------------------------- /sharedLibrariesDemo/callLib/callLib.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | callLib 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | callLib 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sharedLibrariesDemo/callLib/main.cpp: -------------------------------------------------------------------------------- 1 | #include "callLib.h" 2 | 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QApplication a(argc, argv); 8 | callLib w; 9 | w.show(); 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /sharedLibrariesDemo/libDemo/LibDemo.cpp: -------------------------------------------------------------------------------- 1 | #include "LibDemo.h" 2 | #include 3 | 4 | LibDemo::LibDemo() 5 | { 6 | m_btn = Q_NULLPTR; 7 | } 8 | 9 | void LibDemo::showNewWidgets() 10 | { 11 | m_btn = new QPushButton("ABCD1234"); 12 | m_btn->show(); 13 | } 14 | 15 | void LibDemo::freeWidgets() 16 | { 17 | if(m_btn != Q_NULLPTR){ 18 | 19 | delete m_btn; 20 | m_btn = Q_NULLPTR; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /sharedLibrariesDemo/libDemo/LibDemo.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBDEMO_H 2 | #define LIBDEMO_H 3 | 4 | #include "libDemo_global.h" 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QWidget; 8 | QT_END_NAMESPACE 9 | 10 | class LIBDEMO_EXPORT LibDemo 11 | { 12 | public: 13 | LibDemo(); 14 | void showNewWidgets(); 15 | void freeWidgets(); 16 | 17 | private: 18 | QWidget *m_btn; 19 | }; 20 | 21 | #endif // LIBDEMO_H 22 | -------------------------------------------------------------------------------- /sharedLibrariesDemo/libDemo/libDemo.pro: -------------------------------------------------------------------------------- 1 | QT += widgets 2 | 3 | TEMPLATE = lib 4 | DEFINES += LIBDEMO_LIBRARY 5 | 6 | CONFIG += c++11 7 | 8 | SOURCES += \ 9 | LibDemo.cpp 10 | 11 | HEADERS += \ 12 | libDemo_global.h \ 13 | LibDemo.h 14 | 15 | unix { 16 | target.path = /usr/lib 17 | } 18 | 19 | !isEmpty(target.path): INSTALLS += target 20 | -------------------------------------------------------------------------------- /sharedLibrariesDemo/libDemo/libDemo_global.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBDEMO_GLOBAL_H 2 | #define LIBDEMO_GLOBAL_H 3 | 4 | #include 5 | 6 | #if defined(LIBDEMO_LIBRARY) 7 | # define LIBDEMO_EXPORT Q_DECL_EXPORT 8 | #else 9 | # define LIBDEMO_EXPORT Q_DECL_IMPORT 10 | #endif 11 | 12 | #endif // LIBDEMO_GLOBAL_H 13 | -------------------------------------------------------------------------------- /timestampDemo/FirstReadMe.txt: -------------------------------------------------------------------------------- 1 | This project shows that the timestamp about a day. -------------------------------------------------------------------------------- /timestampDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /timestampDemo/widget.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "ui_widget.h" 3 | #include 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 | startTimer(1000); 14 | } 15 | 16 | Widget::~Widget() 17 | { 18 | delete ui; 19 | } 20 | 21 | void Widget::timerEvent(QTimerEvent *event) 22 | { 23 | Q_UNUSED(event) 24 | uint currentDataInt = QDateTime::fromString(QDateTime::currentDateTime().toString("yyyy-M-dd"), "yyyy-M-dd").toTime_t(); 25 | uint currentTimeInt = QDateTime::currentDateTime().toTime_t(); 26 | qDebug() << "当天: " << currentDataInt; 27 | qDebug() << "现在: " << currentTimeInt; 28 | qDebug() << "目前写入点:" << (currentTimeInt - currentDataInt)/300; 29 | 30 | qDebug() << "-------------华丽的分割线-------------"; 31 | } 32 | -------------------------------------------------------------------------------- /timestampDemo/widget.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class Widget; 8 | } 9 | 10 | class Widget : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | public: 15 | explicit Widget(QWidget *parent = 0); 16 | ~Widget(); 17 | 18 | protected: 19 | void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; 20 | 21 | private: 22 | Ui::Widget *ui; 23 | }; 24 | 25 | #endif // WIDGET_H 26 | -------------------------------------------------------------------------------- /timestampDemo/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | Widget 3 | 4 | 5 | 6 | 0 7 | 0 8 | 400 9 | 300 10 | 11 | 12 | 13 | Widget 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /winscp_begin_in_Qt/ARPDemo.pro: -------------------------------------------------------------------------------- 1 | QT -= gui 2 | 3 | CONFIG += c++11 console 4 | CONFIG -= app_bundle 5 | 6 | DEFINES += QT_DEPRECATED_WARNINGS 7 | 8 | SOURCES += \ 9 | main.cpp 10 | 11 | qnx: target.path = /tmp/$${TARGET}/bin 12 | else: unix:!android: target.path = /opt/$${TARGET}/bin 13 | !isEmpty(target.path): INSTALLS += target 14 | 15 | INCLUDEPATH += D:/winscp/WpdPack/Include 16 | LIBS += -L D:/winscp/WpdPack/Lib/libpacket.a \ 17 | -L D:/winscp/WpdPack/Lib/libwpcap.a 18 | --------------------------------------------------------------------------------