Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>On OS X it's a good way to do a dynamic build and post-process the resulting ".app" with the <code>macdeployqt</code> tool which comes with Qt starting with 4.5.</p> <p>This will copy the Qt frameworks used by your application into the application bundle, which results in a larger package than building a static version of your application.</p> <p>Here is what you can do to make sure you get the smallest file size possibly in a dynamic build:</p> <ul> <li>First off, make sure you only include the stuff you need (in the project.pro file's <code>QT += core gui network xml</code> lines).</li> <li>Open the application bundle and remove any unneeded "Qt Plugins" from the bundle. <code>macdeployqt</code> automatically compies <em>all</em> the Qt plugins in there, which can be kind of bulky.</li> <li>Make sure you are building your application in <strong>release</strong> mode. Otherwise your application might be linked against the <em>debug libraries</em> of the Qt4 framework, and they are <em>really</em> big (for instance, well over 90 MB for the debug library vs. 16 MB of a release variant without debugging symbols). This might be what happened in your case.</li> <li>If you have a large application binary, you can use <a href="http://upx.sourceforge.net/" rel="nofollow noreferrer">UPX</a> to compress your executable file by 40-50%.</li> </ul> <p>Other than that, you should use compressed disk images to deploy your application.</p> <p>One of my projects uses <em>QtGui</em>, <em>QtNetwork</em>, <em>QtCore</em> and <em>QtXml</em> and the resulting bundle is about 16 MB in size.</p> <p>Hope that helps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload