{"id":221065,"date":"2020-11-22T21:50:22","date_gmt":"2020-11-22T13:50:22","guid":{"rendered":"http:\/\/4563.org\/?p=221065"},"modified":"2020-11-22T21:50:22","modified_gmt":"2020-11-22T13:50:22","slug":"pyqt-%e7%95%8c%e9%9d%a2%e5%b4%a9%e6%ba%83%e6%97%b6%ef%bc%8c%e8%83%bd%e5%90%a6%e6%89%a7%e8%a1%8c%e5%88%ab%e7%9a%84%e5%8a%a8%e4%bd%9c","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=221065","title":{"rendered":"pyqt \u754c\u9762\u5d29\u6e83\u65f6\uff0c\u80fd\u5426\u6267\u884c\u522b\u7684\u52a8\u4f5c"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  pyqt \u754c\u9762\u5d29\u6e83\u65f6\uff0c\u80fd\u5426\u6267\u884c\u522b\u7684\u52a8\u4f5c               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : HITMengbin <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u8bf7\u6559\u5404\u4f4d\uff0c\u56e0\u4e3a\u9700\u8981\u8fde\u63a5\u4e00\u4e2a com \u53e3\u8bfb\u53d6\u4fe1\u606f\uff0ccom \u53e3\u7ecf\u5e38\u6d88\u5931\uff0c\u5bfc\u81f4 pyqt \u7684\u754c\u9762\u5b58\u5728\u5d29\u6e83\u7684\u60c5\u51b5\uff0c\u60f3\u6dfb\u52a0\u4e00\u4e2a\u529f\u80fd\uff0c\u5728\u7a0b\u5e8f\u51fa\u73b0\u95ee\u9898\uff0c\u754c\u9762\u51c6\u5907\u5d29\u6e83\u7684\u65f6\u5019\uff0c\u4f1a\u6267\u884c\u8fd9\u4e2a\u529f\u80fd\uff0c\u8bf7\u95ee\u8fd9\u4e2a\u60f3\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u5417\uff1f\u5982\u4f55\u5b9e\u73b0\u5462\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4451912\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tanranran <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             sys.excepthook                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451913\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Vegetable <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/docs.python.org\/zh-cn\/3\/library\/atexit.html <br \/>\u4e5f\u8bb8\u80fd\u89e3\u51b3\u4f60\u7684\u95ee\u9898\uff0c\u8fd9\u4e2a\u6a21\u5757\u53ef\u4ee5\u6ce8\u518c\u51fd\u6570\uff0c\u5728\u7a0b\u5e8f\u9000\u51fa\u4e4b\u524d\u81ea\u52a8\u6267\u884c\u3002\u4f60\u63cf\u8ff0\u7684\u573a\u666f\u5e94\u8be5\u5c5e\u4e8e\u4e00\u822c\u7684 error\uff0c\u5728\u5c04\u7a0b\u4e4b\u5185\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451914\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DoctorCat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5d29\u6e83\u4e86\u6015\u662f\u4e0d\u884c\uff0cQt native \u5e93\u662f\u975e\u6258\u7ba1\u7684\uff0c\u5df2\u7ecf\u8fdb\u5165\u7cfb\u7edf\u7ba1\u8f96\u7684\u5f02\u5e38\u94fe\u4e86\u3002Python VM \u5c42\u9762\u65e0\u6cd5 catch \u5230\u7684\u3002Qt \u7684\u52a8\u6001\u5e93\u91cc\u770b\u770b\u6709\u6ca1\u6709\u4ec0\u4e48\u65b9\u6cd5\u80fd\u6355\u83b7\u3002<\/p>\n<p>@tanranran <br \/>@Vegetable                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451915\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : HITMengbin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @tanranran \u6211\u73b0\u5728\u53ea\u662f\u5728\u6bcf\u4e2a\u67e5\u8be2\u7aef\u53e3\u90a3\u91cc\u52a0 try \u5224\u65ad\uff0c\u603b\u611f\u89c9\u8fd9\u6837\u592a\u4e0d\u65b9\u4fbf\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451916\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : HITMengbin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Vegetable \u597d\u7684\uff0c\u6211\u770b\u770b\uff0c\u8c22\u8c22                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451917\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : HITMengbin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @DoctorCat QT \u672c\u8eab\u6709 event \u5224\u5b9a\uff0c\u4f46\u662f\u5c31\u662f\u5d29\u6e83\u4e86\uff0c\u5bf9\u4e8b\u4ef6\u5224\u5b9a\u4e0d\u77e5\u9053\u8fd8\u80fd\u4e0d\u80fd\u884c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451918\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gainsurier <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             breakpad \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451919\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : HITMengbin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @gainsurier \u53ea\u662f\u6293\u53d6\u5d29\u6e83\u62a5\u544a\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451920\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wuwukai007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             def excepthook(exc_type, exc_value, exc_tb):<br \/> tb = &#8220;&#8221;.join(traceback.format_exception(exc_type, exc_value, exc_tb))<br \/> logging.info(&#8220;error message:n%s&#8221;, tb)<br \/> # QtWidgets.QApplication.quit()<\/p>\n<p> sys.excepthook = excepthook<br \/> ret = app.exec_()<br \/> sys.exit(ret)                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451921\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : andthen255 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u867d\u7136\u6211\u7528\u7684\u662f qt \u4e0d\u662f pyqt\uff0c\u5d29\u6e83\u4e86\u662f\u4e3b\u7ebf\u7a0b\u963b\u585e\u5361\u6b7b\u4e86\u5427\uff1f exec \u672c\u8d28\u662f\u4e00\u4e2a\u5faa\u73af\u4e00\u76f4\u62ff\u4e8b\u4ef6\u961f\u5217\u91cc\u7684\u4e8b\u4ef6\u5904\u7406\uff0c\u5361\u6b7b\u5c31\u4e0d\u4f1a\u5904\u7406\u4e8b\u4ef6\u4e86\uff0c\u5f53\u7136\u4e5f\u4e0d\u4f1a\u6267\u884c\u4ec0\u4e48\u529f\u80fd\u3002\u6211\u90fd\u662f\u5f00\u4e2a\u7ebf\u7a0b\u5904\u7406 COM\uff0c\u6bcf\u6b21\u64cd\u4f5c\u7684\u65f6\u5019\u5224\u65ad\u72b6\u6001                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4451922\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : RealMadrid <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u662f qt \u7684\u8bdd\uff0cqtcreator \u6e90\u7801\u4e2d\u6709\u4e00\u4e2a qtcrashhandler \u7684\u5de5\u5177\u3002\u5f53 qtcreator \u5d29\u6e83\u65f6\uff0c\u4f1a\u5f39\u51fa\u4e00\u4e2a\u7a97\u53e3\uff0c\u6253\u5370\u5954\u6e83\u7684 back trace.<br \/>\u5177\u4f53\u5b9e\u73b0\u539f\u7406\uff0c\u5c31\u662f\u6ce8\u518c sigaction, \u5f53\u8f6f\u4ef6\u53d1\u751f\u9519\u8bef\u65f6\uff0c\u8fdb\u5165\u6ce8\u518c\u7684\u51fd\u6570\u3002\u5728\u51fd\u6570\u91cc fork \u4e2a\u8fdb\u7a0b\uff0c\u5bf9\u539f\u8fdb\u7a0b\u8fdb\u884c gdb \u5206\u6790\uff0c\u518d\u542f\u52a8\u53e6\u4e00\u4e2a dialog, \u663e\u793a\u51fa\u6765                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>pyqt \u754c\u9762\u5d29\u6e83\u65f6\uff0c\u80fd\u5426\u6267\u884c\u522b\u7684&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/221065"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=221065"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/221065\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=221065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=221065"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=221065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}