title: switch/case statement in C++ with a QString type
body: <p>I want to use switch-case in my program but the compiler gives me this error:</p>
  
  <pre><code>switch expression of type 'QString' is illegal
  </code></pre>
  
  <p>How can I use the <code>switch</code> statement with a <code>QString</code>?</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>bool isStopWord( QString word )
  {
  bool flag = false ;
  
  switch( word )
  {
  case "the":
      flag = true ;
      break ;
  case "at" :
      flag = true ;
      break ;
  case "in" :
      flag = true ;
      break ;
  case "your":
      flag = true ;
      break ;
  case "near":
      flag = true ;
      break ;
  case "all":
      flag = true ;
      break ;
  case "this":
      flag = true ;
      break ;
  }
  
  return flag ;
  }
  </code></pre>