{"id":289,"date":"2009-07-09T19:45:37","date_gmt":"2009-07-10T02:45:37","guid":{"rendered":"http:\/\/thesmithfam.org\/blog\/?p=289"},"modified":"2019-08-12T07:15:47","modified_gmt":"2019-08-12T13:15:47","slug":"example-qt-chat-program","status":"publish","type":"post","link":"https:\/\/thesmithfam.org\/blog\/2009\/07\/09\/example-qt-chat-program\/","title":{"rendered":"Example Qt Chat Program"},"content":{"rendered":"<p>A few months ago I gave a <a href=\"http:\/\/uug.byu.edu\/events\/2009\/feb\/07\/qt-meeting\/\">presentation<\/a> to the <a href=\"http:\/\/uug.byu.edu\">BYU Unix Users Group<\/a> on Qt GUI development. During the meeting, we created a simple chat room program called <b>chatterbox<\/b>. At the time I promised to post my source code with comments, a promise on which I am now making good.<\/p>\n<p>Here is the code. Instructions for building and running it are below:<\/p>\n<p><a href=\"\/files\/chatterbox.zip\">The client source code (chatterbox.zip)<\/a><br \/>\n<a href=\"\/files\/chatterboxd.zip\">The server source code (chatterboxd.zip)<\/a><\/p>\n<h3>Build Instructions<\/h3>\n<p>You&#8217;ll need to install Qt for your operating system, at least version 4.3 or newer. Make sure &#8220;qmake&#8221;  is in your path. On Windows, you&#8217;ll also want Visual Studio 2008 Express. Then, download and unzip the two zip files above. I&#8217;ll wait here while you do that.<\/p>\n<h3>Building the Server<\/h3>\n<ol>\n<li>Open your favorite terminal (on Windows, use &#8220;Qt command prompt&#8221; in the start menu)<\/li>\n<li>cd into the <strong>chatterboxd<\/strong> directory<\/li>\n<li>Run <strong>qmake <\/strong>(you should see no output if it suceeds)<\/li>\n<li>Run <strong>make <\/strong>(or nmake on Windows &#8212; it will produce a lot of output and hopefully run error free)<\/li>\n<li>Run .<strong>\/chatterboxd<\/strong> (or <strong>debug\\chatterboxd.exe<\/strong> on Windows)<\/li>\n<li>It should print <strong>Ready<\/strong> when it&#8217;s ready to go.<\/li>\n<\/ol>\n<h3>Building the Client<\/h3>\n<p>Build the client the same way. Note, it&#8217;s the <strong>chatterbox<\/strong> (no &#8220;d&#8221; on the end) directory.<\/p>\n<h3>What it Looks Like<\/h3>\n<p>Here&#8217;s what the client looks like when you run it:<\/p>\n<p><img decoding=\"async\" src=\"\/images\/chatterbox-login.png\" \/><br \/>\n<img decoding=\"async\" src=\"\/images\/chatterbox-chat-room.png\" \/><\/p>\n<h3>Getting Help<\/h3>\n<p>If you can&#8217;t get this to build or are running into some other problem, just leave a comment below, and I&#8217;ll get to it as soon as possible.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few months ago I gave a presentation to the BYU Unix Users Group on Qt GUI development. During the meeting, we created a simple chat room program called chatterbox. At the time I promised to post my source code with comments, a promise on which I am now making good. Here is the code. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-289","post","type-post","status-publish","format-standard","hentry","category-code-and-cruft"],"_links":{"self":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/comments?post=289"}],"version-history":[{"count":11,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions"}],"predecessor-version":[{"id":1539,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/posts\/289\/revisions\/1539"}],"wp:attachment":[{"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/media?parent=289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/categories?post=289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thesmithfam.org\/blog\/wp-json\/wp\/v2\/tags?post=289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}