title: C++ QList inheritance custom method problem
body: <p>I am creating a custom QList of type Account* called AccountList through inheritance.</p>
  
  <p>My interface declaration for AccountList is as follows:</p>
  
  <pre><code>class Client
  {
      public:
          Client(QString firstName, QString lastName, QString address1, QString address2, QString postalCode);
          QString toString();
  
      private:
          QString m_FirstName;
          QString m_LastName;
          QString m_Address1;
          QString m_Address2;
          QString m_PostalCode;
  };
  
  class Account
  {
      public:
          Account(unsigned acctNum, double balance, const Client owner);
          unsigned getAcctNum();
          double getBalance();
          Client getOwner();
          virtual ~Account();
  
      private:
          unsigned m_AcctNum;
          double m_Balance;
          Client m_Owner;
  };
  
  class AccountList : public QList&lt;Account*&gt;
  {
      public:
          QString toString() const;
          Account* findAccount(unsigned accNum) const;
          bool addAccount(const Account* acc) const;
          bool removeAccount(unsigned accNum) const;
  };
  </code></pre>
  
  <p>I am having a problem with implementation of AccountList, e.g. the findAccount method.</p>
  
  <pre><code>Account* AccountList::findAccount(unsigned accNum) const
  {
      Account foundAccount;
      foreach(Account* acc, this)
      {
          if (acc-&gt;getAcctNum() == accNum)
          {
              foundAccount = acc;
              break;
          }
      }
      return foundAccount;
  }
  </code></pre>
  
  <p>Hope the above method gives you an idea of what i am trying to accomplish. Seems pretty simple and straigh forward, but i can't get it to work. Qt Creator compiler gives me all sorts of strange errors on compiling.</p>
  
  <p>Any help would be appreciated.</p>