{"id":136,"date":"2015-05-27T17:57:37","date_gmt":"2015-05-28T01:57:37","guid":{"rendered":"https:\/\/www.actinia.me\/?p=136"},"modified":"2016-04-10T17:55:03","modified_gmt":"2016-04-11T01:55:03","slug":"qtutils-is-a-useful-pack","status":"publish","type":"post","link":"https:\/\/www.actinia.me\/?p=136","title":{"rendered":"&#8220;Qtutils&#8221; is a useful pack"},"content":{"rendered":"<p>I come up with an problem:\u00a0http:\/\/stackoverflow.com\/questions\/30180046\/statusbar-doesnt-show-message-immediately-and-sometimes-crash<\/p>\n<p><em>I created an interface in pyqt4 designer, there is only a button and a status bar. I want to show a message in the status bar when I click the button. For some reason I have to put this action in a new thread.<\/em><\/p>\n<p><em>But when I click the button, nothing happened. The message didn&#8217;t appear until I drag the edge of the window. Sometimes the click action even cause the program to crash<\/em><\/p>\n<p>as <a href=\"http:\/\/stackoverflow.com\/users\/1994235\/three-pineapples\">three_pineapples<\/a>\u00a0answered :&#8221;<em>The crash happens because you are interacting with the Qt GUI from a secondary thread. You are only allowed to interact with the GUI from the main threa<\/em>d&#8221;.<\/p>\n<p>He provided a very useful pack &#8220;qtutils&#8221;.<\/p>\n<p>I define my interaction action as a new fuction, say <code>shili(self)<\/code>. When I want to interact with GUI from a secondary thread, I simply write :<\/p>\n<p><code>inmain(self.shili)<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I come up with an problem:\u00a0http:\/\/stackoverflow.com\/questions\/30180046\/statusbar-doesnt-show-message-immediately-and-sometimes-crash I created an interface in pyqt4 designer, there is only a button and a status bar. I want to show a message in the status bar when I click the button. For some reason I have to put this action in a new thread. But when I click the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/www.actinia.me\/index.php?rest_route=\/wp\/v2\/posts\/136"}],"collection":[{"href":"https:\/\/www.actinia.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.actinia.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.actinia.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.actinia.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=136"}],"version-history":[{"count":2,"href":"https:\/\/www.actinia.me\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":138,"href":"https:\/\/www.actinia.me\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions\/138"}],"wp:attachment":[{"href":"https:\/\/www.actinia.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.actinia.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.actinia.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}