title: deploying Qt/QML App with LocalStorage (Sqlite) on OS X
body: <p>I'm doing an app with QML that uses LocalStorage to store some informations.
  It's working fine when I run in debug mode.</p>
  
  <p>My <code>storage.js</code> that access the database is like that.</p>
  
  <pre><code>.import QtQuick.LocalStorage 2.0 as Sql
  
  // First, let's create a short helper function to get the database connection
  function getDatabase() {
       return Sql.LocalStorage.openDatabaseSync("MyApp", "0.1", "StorageDatabase", 100000);
  }
  </code></pre>
  
  <p>My Qt <code>.pro</code> file contains the Sql module:</p>
  
  <pre><code>QT += sql
  </code></pre>
  
  <p>And at first moment it runs fine in Release mode either.</p>
  
  <p>But when I try to deploy on OSX, running <code>macdeployqt</code> like that: </p>
  
  <pre><code>macdeployqt MyApp.app -dmg -qmldir=../MyApp/qml/
  </code></pre>
  
  <p>First I got one error, but I think that's ok because I don't use MySQL: ERROR: no file at </p>
  
  <pre><code>"/opt/local/lib/mysql55/lib/libmysqlclient.18.dylib"
  </code></pre>
  
  <p>I'm using sqlite via LocalStorage.</p>
  
  <p>Then trying to run in Release mode it doesn't work anymore, the database access doesn't work, not even the in the deployment it works... now when I try to run the app I got the error:</p>
  
  <pre><code>storage.js:5: ReferenceError: Sql is not defined
  </code></pre>
  
  <p>The <code>line 5</code> is this one:</p>
  
  <pre><code>return Sql.LocalStorage.openDatabaseSync("MyApp", "0.1", "StorageDatabase", 100000);
  </code></pre>
  
  <p>And the Sql name is defined in the first line:</p>
  
  <pre><code>.import QtQuick.LocalStorage 2.0 as Sql
  </code></pre>
  
  <p>Looking for this error in the internet I found some places telling to do exactly what I did, like here: <a href="https://qt-project.org/forums/viewthread/28371" rel="nofollow">https://qt-project.org/forums/viewthread/28371</a></p>
  
  <p>Any clue about this?</p>
  
  <p>I'm using <strong>Qt5.2, Quick 2.0, Qt Creator 3.01</strong></p>