Qt Building For Mac

5, the first use of the MAC is not suitable for, for example, can not find a direct cut operation, shortcut keys will not be used, it is recommended to see first, shortcut keys and cutting operations. Preparing for the QT development environment. Download the installation package under QT Mac and configure it accordingly. Sudo apt-get update sudo apt-get install cmake build-essential qt5-default libssl-dev qtscript5-dev libnm-gtk-dev qttools5-dev qttools5-dev-tools rpm lintian chmod a+x buildlinux.sh bash buildlinux.sh.

Mac OS X 10.9 (Mavericks) was released yesterday. And those nice people at Apple made it free, so you can be sure lots of people are downloading it. However Qt 4 apps look at bit strange on the new OS. Look at the text alignment in these buttons:

The text isn’t centre aligned. It doesn’t look like much of an issue out of context. But it looks wrong when you look at a whole UI. The good news is that there is a simple fix: Free screensavers for mac.

You need to place this code in your main() before creating your QApplication. For more details see this bug report.

With the fix the buttons look like this:

Much better! There are some console warnings:

For

I am not sure how how significant these are.

I have also found that updating to Qt 4.8.5 fixes a printing crash bug in my table plan software. This crash happened when rotated pixmaps were printed from Mac OS X 10.8.

I have seen on forums that Qt 5 is completely broken on 10.9. But I don’t know if that is true.

Downloading and Installing Qt

There are two ways to install Qt:

  1. through the Qt Installers - downloads and installs Qt
  2. through the Qt sources.

You can download the Qt 5 installers and sources from the Downloads page. For more information, visit the Getting Started with Qt page.

Building Qt 5 from Source

Below, you will find more information about building Qt from source.

  • Qt for macOS - Building from Source - building and installing from source

Note: Qt 5 uses Cocoa, therefore, building for Carbon is not possible.

macOS Versions

See Supported Platforms for the list of macOS versions supported by Qt.

Qt can be built for either x86 or x86_64. 64-bit is used by default. To select a 32-bit build, use the macx-clang-32 or macx-g++32 mkspec. This is selectable at configure time:

The Qt build system does not support building unversal binaries directly. Instead, use the lipo tool to glue two Qt builds together.

Note: Qt 5 does not support OS X on PowerPC.

Note: Static builds are not tested.

Additional Command-Line Options

On the command-line, applications can be built using qmake and make. Optionally, qmake can generate project files for Xcode with -spec macx-xcode. If you are using the binary package, qmake generates Xcode projects by default; use -spec macx-gcc to generate makefiles. For example:

Qt For Mac Download

Configuring with -spec macx-xcode generates an Xcode project file from project.pro. With qmake you do not have to worry about rules for Qt's preprocessors (moc and uic) since qmake automatically handles them and ensures that everything necessary is linked into your application.

Qt does not entirely interact with the development environment (for example plugins to set a file to 'mocable' from within the Xcode user interface).

The result of the build process is an application bundle, which is a directory structure that contains the actual application executable. The application can be launched by double-clicking it in Finder, or by referring directly to its executable from the command line, for example, myApp.app/Contents/MacOS/myApp.

If you wish to have a command-line tool that does not use the GUI for example, moc, uic or ls, you can tell qmake to disable bundle creation from the CONFIG variable in the project file:

Deploying Applications on macOS

In general, Qt supports building on one macOS version and deploying to earlier or later macOS versions. The recommended way is to build on the latest version and deploy to an earlier macOS version.

Qt mac address

macOS applications are typically deployed as self-contained application bundles. The application bundle contains the application executable as well as dependencies such as the Qt libraries, plugins, translations and other resources you may need. Third party libraries like Qt are normally not installed system-wide; each application provides its own copy.

A common way to distribute applications is to provide a compressed disk image (.dmg file) that the user can mount in Finder. The deployment tool, macdeployqt (available from the macOS installers), can be used to create the self-contained bundles, and optionally also create a .dmg archive. Applications can also be distributed through the Mac App Store. Qt 5 aims to stay within the app store sandbox rules. Free vpn connection for mac. macdeployqt (bin/macdeployqt) can be used as a starting point for app store deployment.

macOS Issues

The page below covers specific issues and recommendations for creating macOS applications.

Where to Go from Here

We invite you to explore the rest of Qt. We prepared overviews to help you decide which APIs to use and our examples demonstrate how to use our API.

Uninstall Qt Mac

  • Qt Overviews - list of topics about application development
  • Examples and Tutorials - code samples and tutorials
  • Qt Reference Pages - a listing of C++ and QML APIs

Qt Creator For Mac

Qt's vibrant and active community site, http://qt.io houses a wiki, a forum, and additional learning guides and presentations.