title: Retrieving command line arguments in a Qt application
body: <p>I want to do something like from the Unix command prompt:</p>
  
  <pre><code>./countHats("red")   or 
  ./countHats "red"
  </code></pre>
  
  <p>and then the program runs and counts up red hats.</p>
  
  <p>How can I do that?</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      MainWindow w;
      w.show();
      w.setGeometry(QRect(QPoint(100,100), QSize(1000,500)));
  
      CHat *hat = new CHat();
      hat-&gt;color(argv[0]);//"red"   ????
  
      return a.exec();
  }
  </code></pre>