title: Refactoring Qt Quick Cpp class into header and .cpp
body: <p>I have a Cpp Class which I want to refactor into a header and .cpp file. No problem normally, but when I try to do this Qt Quick one I can't get it to compile. It's fine if I put all of it in the header file, but otherwise I get various different errors depending on how I try to do it. Is there a proper way. I think it has to do with the Q_INVOKABLE bit, but not sure.</p>
  
  <p>Here is my code...</p>
  
  <pre><code>#ifndef APPLICATIONDATA_H
  #define APPLICATIONDATA_H
  
  #include &lt;QDateTime&gt;
  #include &lt;QObject&gt;
  
  class ApplicationData : public QObject
  {
      Q_OBJECT
  public:
      ApplicationData(){}
  
      Q_INVOKABLE QDateTime getCurrentDateTime() const{
          return QDateTime::currentDateTime();
      }
  
  };
  
  #endif // APPLICATIONDATA_H
  </code></pre>
  
  <p>Thanks for any pointers.</p>