title: QT: cannot access private member declared in class 'QByteArray'
body: <p>I've been trying to create a random phrase generator, which reads nouns from one text file and verbs from another text file. That all worked, but now I'm trying to write a method that capitalizes the first letter of the subject, but keep getting the errors</p>
  
  <p>error: C2248: 'QByteArray::operator QNoImplicitBoolCast' : cannot access private member declared in class 'QByteArray'</p>
  
  <p>see declaration of 'QByteArray::operator QNoImplicitBoolCast'</p>
  
  <p>see declaration of 'QByteArray'</p>
  
  <p>I'll post the code for the method (sorry if its not in proper format I'm new)</p>
  
  <pre><code>    void MainWindow::returnCap(QString sub){
  
          char *str;
          QByteArray ba;
          ba = sub.toLatin1();
          str = ba.data();
          QString firstLetter;
          firstLetter = str[0];
          QString cappedFirstLetter;
          cappedFirstLetter = firstLetter.toUpper();
          char flc; //firstLetterChar
          flc = cappedFirstLetter.toLatin1();
          str[0] = flc;
      }
  </code></pre>
  
  <p>Thanks for any help!</p>