{"id":293619,"date":"2024-10-15T04:04:18","date_gmt":"2024-10-14T20:04:18","guid":{"rendered":"https:\/\/lrxjmw.cn\/qzczwqdkjmmy.html"},"modified":"2024-10-15T04:04:18","modified_gmt":"2024-10-14T20:04:18","slug":"qzczwqdkjmmy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/qzczwqdkjmmy.html","title":{"rendered":"Qt Creator\uff1a\u652f\u6301\u4e2d\u6587\u3001\u542f\u52a8\u5feb\u3001\u754c\u9762\u7f8e\uff0c\u4e0e Fcitx \u534f\u4f5c\u826f\u597d\u7684\u4ee3\u7801\u7f16\u8f91\u5668"},"content":{"rendered":"

QtCreator\u652f\u6301\u82f1\u6587linux \u4e0b\u8f7d\u5de5\u5177\uff0c\u542f\u52a8\u901f\u7387\u6bd4Eclipse\u3001Netbeans\u66f4\u5feb\uff0c\u754c\u9762\u4e5f\u66f4\u7f8e\u89c2\uff0c\u8ddf\u8f93\u5165\u6cd5Fcitx\u534f\u4f5c\u826f\u597d\uff08\u5149\u6807\u8ffd\u968f\uff09\u3002<\/p>\n

\u4f60\u65e2\u53ef\u4ee5\u628aQtCreator\u5f53\u4ee3\u7801\u7f16\u8f91\u5668\u4f5c\u4e3avim\u8f85\u52a9\uff0c\u7528\u5904\u5728\u4e8eQtCreator\u624d\u80fd\u624b\u52a8parse\u9879\u76ee\uff0c\u4ea7\u751f\u53cb\u597d\u5feb\u901f\u7684\u667a\u80fd\u63d0\u793a\uff0c\u5e76\u4e14\u4f60\u4e5f\u540c\u6837\u53ef\u4ee5\u4f7f\u7528QtCreator\u4e0a\u9762\u7684gdb\u540e\u7aef(\u4e0a\u56fe)\u548cvalgrind\u540e\u7aef(\u9ad8\u6e05\u5927\u56fe)\u5bf9\u9879\u76ee\u8fdb\u884c\u8c03\u8bd5\u548c\u663e\u5b58\u5256\u6790\uff0c\u4e0d\u8fc7Makefile\u5c31\u8981\u81ea\u5df1\u5199\u6216\u5219\u7528autotools\u751f\u6210\u4e86\uff0c\u8fd9\u5bf9\u4e8e\u4f7f\u7528vim\u8fdb\u884c\u7f16\u7a0b\u7684\u670b\u53cb\u6765\u8bf4\uff0c\u5e94\u5f53\u662f\u8f7b\u8f66\u719f\u8def\u7684\u3002\u5dee\u70b9\u5fd8\u4e86\uff0c\u8fde\u7eed\u6309\u4e24\u6b21Alt+V\u5feb\u6377\u952e\u5373\u53ef\u6b65\u5165VIM\u7f16\u8f91\u6a21\u5f0f(FakeVim)\uff0c\u8fd9\u5e94\u5f53\u5f88\u80fd\u5438\u5f15vim\u7528\u6237\u3002\u5176\u5b9e\uff0cQtCreator\u9ed8\u8ba4\u652f\u6301\u4e3b\u6d41\u7248\u672c\u63a7\u5236\u7cfb\u7edfgit\/hg\/svn\u7b49\u3002<\/p>\n

\u4f60\u4e5f\u53ef\u4ee5\u628aQtCreator\u5f53\u6210IDE\uff0c\u8fd9\u65f6\u53ef\u4ee5\u4f5c\u4e3aEclipseCDT\u3001NetbeansforC++\u8fd9\u79cd\u91cd\u91cf\u7ea7IDE\u7684\u4e00\u4e2a\u8f7b\u91cf\u4ee3\u66ff\u54c1\u3002\u4f60\u53ef\u4ee5\u76f4\u63a5\u5728QtCreator\u7684\u5411\u5bfc\u91cc\u65b0\u5efa\u4e00\u4e2a\u975eQt\u4f7f\u7528CMake\u624b\u52a8\u5efa\u7acb\u7684\u9879\u76ee\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u4e0d\u7528\u81ea\u5df1\u5199Makefile\uff0c\u4f60\u53ea\u8981\u5728QtCreator\u91cc\u201c\u6267\u884cCMake\u201d\u5c31\u80fd\u624b\u52a8\u751f\u6210\u3002\u5176\u5b9e\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5bfc\u51fa\u4e00\u4e2amake\u5efa\u7acb\u7684\u9879\u76ee\u5230QtCreator\u91cc\u7f16\u8bd1\u8c03\u8bd5\uff0c\u4f8b\u5982Nginx\u3002<\/p>\n

1\u3001\u5b89\u88c5QtCreator\u548c\u57fa\u7840\u5efa\u7acb\u73af\u5883(\u4ee5Ubuntu\u4e3a\u4f8b)\uff1a<\/p>\n

\u5b89\u88c5\u57fa\u7840\u7cfb\u7edf\u5efa\u7acb\u5de5\u5177\u5305\uff1a<\/p>\n

sudoapt-get-yinstallbuild-essentialgdbvalgrindcmake<\/p>\n

\u4e0b\u8f7d\u6700\u65b0\u7248\u4e8c\u8865\u7801QtCreator(\u5efa\u8bae\u4f7f\u7528\u57fa\u4e8eQt4\u5efa\u7acb\u76842.8\u7cfb\u5217\u7684QtCreator\uff0c\u80fd\u66f4\u597d\u5730\u517c\u5bb9Fcitx\u8f93\u5165\u6cd5)\uff1a<\/p>\n

\u4e0d\u8fdb\u884cGUI\u7f16\u7a0b\uff0c\u4e0d\u987b\u8981\u5b89\u88c5QtSDK\uff0c\u4e5f\u5c31\u6ca1\u6709qmake\u548c\u76f8\u5173Qt\u5f00\u53d1\u5e93linux qt\u5f00\u53d1<\/strong>\uff0c\u53ea\u7528\u4e0b\u8f7d\u90a3\u79cd60M\u7684QtCreator\u5c31\u597d\u4e86\uff0c\u4f8b\u5982\u6211\u4e0b\u7684\u662f\uff1a<\/p>\n

qt-creator-linux-x86_64-opensource-2.8.1.run<\/p>\n

\u4e0b\u8f7d\u540e\u7ed9\u4e0e\u6267\u884c\u6743\u9650linux qt\u5f00\u53d1<\/strong>\uff0c\u8fd0\u884c\u9009\u62e9\u5b89\u88c5\u76ee\u5f55\u5b89\u88c5\u5373\u53ef\uff0c\u53ef\u4ee5\u5b89\u88c5\u5728\u81ea\u5df1\u7684\u5bb6\u76ee\u5f55\u3002<\/p>\n

Windows\u4e0a\u5efa\u8bae\u4e0b\u8f7d\u81ea\u5e26MinGW\u7684Qt(300\u591aMB)\uff0c\u4e0d\u8fc7\u4e0d\u8fdb\u884cQt\u56fe\u5f62\u5316\u5f00\u53d1\uff0c\u5b89\u88c5\u65f6\u53ea\u5b89\u88c5QtCreator\u548cMinGW\u5373\u53ef\uff1a<\/p>\n

\u9879\u76ee\u914d\u7f6e\u9ed8\u8ba4\u50a8\u5b58\u4f4d\u7f6e~\/.config\/QtProject<\/p>\n

\u53ef\u4ee5\u901a\u8fc7\u53c2\u6570-settingspath\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u50a8\u5b58\u4f4d\u7f6e\uff0c\u4f8b\u5982\uff1a<\/p>\n

\/home\/eechen\/qtcreator-2.8.1\/bin\/qtcreator-settingspath\/home\/eechen\/qtcreator-2.8.1<\/p>\n

\u6ce8\u610f\uff1a\u5047\u5982\u4f60\u7528\u7684\u662f\u57fa\u4e8eQt5\u5efa\u7acb\u7684QtCreator3\u7cfb\u5217\uff0c\u5176\u9ed8\u8ba4\u96c6\u6210\u4e86iBus\u8f93\u5165\u6cd5\u63d2\u4ef6\uff0c\u800c\u5bf9\u4e8eFcitx\u63d2\u4ef6\uff0c\u5219\u987b\u8981\u81ea\u52a8\u5b89\u88c5\u5305fcitx-frontend-qt5\u67e5\u770b\u7cfb\u7edf\u7248\u672clinux\uff0c\u4e4b\u540e\u590d\u5236libfcitxplatforminputcontextplugin.so\u5230QtCreator3\u7684bin\/plugins\/platforminputcontexts\u76ee\u5f55\uff0c\u4f8b\u5982\uff1asudoapt-getinstallfcitx-frontend-qt5<\/p>\n

ln-s\/usr\/lib\/`arch`-linux-gnu\/qt5\/plugins\/platforminputcontexts\/libfcitxplatforminputcontextplugin.so\/png\/dev\/qtcreator-3.2.1\/bin\/plugins\/platforminputcontexts\/<\/p>\n

\u91cd\u542fQtCreator,\u5c31\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528Fcitx\u8f93\u5165\u6cd5\u4e86.<\/p>\n

\u5047\u5982\u4f9d\u7136\u4e0d\u80fd\u8c03\u7528Fcitx,\u8bf7\u770b\u8fd9\u7bc7\u6587\u7ae0:<\/p>\n

2\u3001\u628a\u624b\u52a8\u5b8c\u6210\u5feb\u6377\u952e\"Ctrl+\u7a7a\u683c\"\u6539\u4e3a\"Alt+\/\"\u6216\u5219\"Shift+Return\"(Return\u8868\u793aEnter\u952e)<\/p>\n

\u5de5\u5177-\u9009\u9879-\u73af\u5883-\u6309\u952e:\u9f20\u6807\u5feb\u6377\u952e\u8f93\u5165\"Ctrl+\u7a7a\u683c\",\u5728\u70ed\u952e\u6b21\u5e8f\u4e2d\u70b9\u51fbx\u5220\u6389\u539f\u5148\u7684\"Ctrl+\u7a7a\u683c\",\u8f93\u5165\u65b0\u7684\"Alt+\/\",\u786e\u5b9a\u9000\u51fa.<\/p>\n

3\u3001\u5728QtCreator\u4e2d\u4f7f\u7528make\u5efa\u7acb,\u8fd0\u884c,\u8c03\u8bd5\u901a\u7528C\/C++\u9879\u76ee<\/p>\n

\u6587\u4ef6-\u65b0\u5efa\u6587\u4ef6\u6216\u9879\u76ee-\u5bfc\u51fa\u9879\u76ee-\u5bfc\u51fa\u73b0\u6709\u9879\u76ee<\/p>\n

\u8fd9\u6837\u5bfc\u51fa\u7684\u9879\u76ee\u7528\u7684\u662fmake\u5efa\u7acb,\u987b\u8981\u81ea\u5df1\u5199\u597dMakefile\u6587\u4ef6\u540e\u624d\u4f1a\u5efa\u7acb,\u652f\u6301\u624b\u52a8\u5b8c\u6210,\u652f\u6301\u8c03\u8bd5\u548c\u663e\u5b58\u5256\u6790.<\/p>\n

4\u3001\u5728QtCreator\u4e2d\u4f7f\u7528cmake\u5efa\u7acb,\u8fd0\u884c,\u8c03\u8bd5\u901a\u7528C\/C++\u9879\u76ee<\/p>\n

\u6587\u4ef6-\u65b0\u5efa\u6587\u4ef6\u6216\u9879\u76ee-\u975eQt\u9879\u76ee:\u65b0\u5efa\u4e00\u4e2aCMake\u9879\u76ee<\/p>\n

\u5728\"\u6267\u884cCMake\"\u8fd9\u4e00\u6b65\u7684\u53c2\u6570\u4e2d\u586b\u5165-DCMAKE_BUILD_TYPE=Debug<\/p>\n

\u8fd9\u6837\u624d\u53ef\u4ee5\u5728QtCreator\u4e2d\u8c03\u8bd5\u7a0b\u5e8f,-DCMAKE_BUILD_TYPE\u7684\u503c\u53ef\u4ee5\u8bbe\u4e3aDebug\u6216\u5219Release\u6216\u5219RelWithDebInfo.<\/p>\n

cmake\u53ef\u4ee5\u624b\u52a8\u751f\u6210Makefile\u4fbf\u6377\u7528make\u5efa\u7acb\u9879\u76ee,\u4f46\u4f7f\u7528cmake\u5efa\u7acb\u9879\u76ee\u4e5f\u5fc5\u9700\u8981\u4f1a\u7f16\u64b0CMakeLists.txt\u6587\u4ef6.<\/p>\n

QtCreator\u652f\u6301\u4f7f\u7528qmake,make,cmake\u5efa\u7acb\u9879\u76ee,\u4f46\u4e0d\u80fd\u76f4\u63a5\u5f80cmake\u9879\u76ee\u91cc\u6dfb\u52a0\u6587\u4ef6,QtCreator\u5bf9CMake\u7684\u652f\u6301\u8fd8\u6709\u5f85\u6539\u8fdb.<\/p>\n

\u4e34\u65f6\u7684\u505a\u6cd5\u662f,\u5207\u6362\u5230\u6587\u4ef6\u7ba1\u7406\u5668\u6765\u6dfb\u52a0\u6587\u4ef6,\u4e4b\u540e\u53f3\u51fb\u9879\u76ee\"\u6267\u884cCMake\"\u4f7fparsing(\u53e5\u578b\u89e3\u6790)\u751f\u6548,\u5e76\u8f7d\u5165\u6587\u4ef6\u5230\u5728\u9879\u76ee.<\/p>\n

5\u3001QtCreator\u4f1a\u624b\u52a8\u8fa8\u8bc6\u7cfb\u7edf\u4e2d\u5b89\u88c5\u7684gcc\u3001g++\u3001gdb\u3001make\u3001cmake\u3001valgrind,\u4e5f\u53ef\u4ee5\u81ea\u5df1\u5230\u83dc\u5355\"\u5de5\u5177\"->\"\u9009\u9879\"\u91cc\u8fdb\u884c\u4e00\u4e9b\u81ea\u5b9a\u4e49\u914d\u7f6e.<\/p>\n

\u914d\u7f6evim\u5916\u90e8\u7f16\u8f91\u5668:<\/p>\n

\u5de5\u5177->\u9009\u9879->\u73af\u5883->\u5916\u90e8\u5de5\u5177->\u4f7f\u7528vi\u8fdb\u884c\u7f16\u8f91<\/p>\n

\u628axterm\u6539\u4e3akonsole\u6216\u5219gnome-terminal<\/p>\n

\u53c2\u6570\u6539\u4e3a-evim\"%{CurrentDocument:FilePath}\"<\/p>\n

linux\u4e0bqt\u5f00\u53d1_linux qt\u5f00\u53d1_qt\u5f00\u53d1linux\u684c\u9762<\/p>\n

\u914d\u7f6e\u7ec8\u7aef:<\/p>\n

\u5de5\u5177->\u9009\u9879->\u73af\u5883->\u6982\u8981<\/p>\n

KDE\u73af\u5883\u9ed8\u8ba4\u4e3a\/usr\/bin\/konsole-e<\/p>\n

\u5047\u5982\u8981\u7528gnome-terminal,\u5219\u8bbe\u4e3a\/usr\/bin\/gnome-terminal-x<\/p>\n

\u8bbe\u7f6e\u5728\u7ec8\u7aef\u8fd0\u884c\u7a0b\u5e8f:<\/p>\n

\u9879\u76ee(\u4fa7\u8fb9\u680f)-\u8fd0\u884c-\u52fe\u9009\"\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\"<\/p>\n

\u8c03\u8bd5(gdb)\u65f6\u51fa\u73b0\"ptraceoperationnotpermitted\"\u95ee\u9898\u89e3\u51b3\u529e\u6cd5:<\/p>\n

\u4e34\u65f6\u8bbe\u7f6e:sudosysctlkernel.yama.ptrace_scope=0<\/p>\n

\u6c38\u4e45\u8bbe\u7f6e:\u7f16\u8f91\/etc\/sysctl.d\/10-ptrace.conf\u6539\u4e3akernel.yama.ptrace_scope=0<\/p>\n

\u7cfb\u7edf\u9ed8\u8ba4\u8bbe\u4e3a1\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u5b89\u5168\uff0c\u907f\u514d\u7528\u6237\u7a0b\u5e8f(\u4f8b\u5982\u8fd9\u513f\u7684gdb)\u8bbf\u95ee\u5176\u4ed6\u8fdb\u7a0b(\u4f8b\u5982\u8fd9\u513f\u7684konsole,gnome-terminal)\u663e\u5b58\u7684\u6570\u636e.<\/p>\n

PS\uff1a\u9644\u4e00\u5f20\u56fe\uff0c\u5728QtCreator\u4e2d\u4f7f\u7528valgrind\u5256\u6790Nginx\u7684\u663e\u5b58\u4f7f\u7528\uff1a<\/p>\n","protected":false},"excerpt":{"rendered":"

Creator\u9ed8\u8ba4\u652f\u6301\u4e3b\u6d41\u7248\u672c\u63a7\u5236\u7cfb\u7edfgit\/hg\/svn\u7b49\u3002Creator\u4e2d\u4f7f\u7528make\u6784\u5efa,\u8fd0\u884c,\u8c03\u8bd5\u901a\u7528C\/C++\u9879\u76eeCreator\u4e2d\u4f7f\u7528cmake\u6784\u5efa,\u8fd0\u884c,\u8c03\u8bd5\u901a\u7528C\/C++\u9879\u76ee\u5de5\u5177->\u9009\u9879->\u73af\u5883->\u5916\u90e8\u5de5\u5177->\u4f7f\u7528vi\u8fdb\u884c\u7f16\u8f91<\/p>\n","protected":false},"author":1,"featured_media":293620,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[611,1253,3579,1170],"class_list":["post-293619","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-c","tag-f-5","tag-QtCreator","tag-srf"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/293619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=293619"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/293619\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/293620"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=293619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=293619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=293619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}