Building Qt examples

Before building Qt examples, set up your environment according to the instructions in Setting up your build environment.

Note: You must use the Visual Studio x64 Command Prompt to build Qt plug-ins on Windows.

  1. Extract the Qt headers.

  2. Locate the plug-in you want to build. Each Qt example is located in its own directory under the devkit's plug-ins directory: grabUV, helixQtCmd, qtAdskStyleProxy, qtForms, saveSwatchesCmd, and workspaceControlCmd.

  3. From the example's directory, run qmake on the pro file to generate a makefile. On Windows you will need to run qmake from the Visual Studio x64 command prompt.

For example, on Linux or macOS, run:

```sh
$DEVKIT_LOCATION/devkit/bin/qmake helixQtCmd.pro
```

And on Windows, run:

```sh
%DEVKIT_LOCATION%\devkit\qmake.exe helixQtCmd.pro
```

On macOS, the makefile will have the name of the project with the `.mak` extension added. For example, `helixQtCmd.mak`.

On Linux and Windows, the makefile will be named `Makefile` regardless of the name of the example.

> **Note:**  The `qmake` version distributed with Maya 2024 does not support the creation of universal binaries for macOS.
>
> To create a universal binary for macOS, you will need to create binaries for Intel86_64 and arm64 that you combine into a universal binary.
>
> Run `qmake` with `QMAKE_APPLE_DEVICE_ARCHS = x86_64` to create an Intel86_64 binary. 
>
> Run `qmake` with  `QMAKE_APPLE_DEVICE_ARCHS = arm64`  to create an arm64 binary. 
>
> Then use the  `lipo` tool supplied by Apple to combine the two builds into a universal build.

Build the plug-in using the makefile.

On Linux, run make –f Makefile.

On macOS, run make –f helixQtCmd.mak.

On Windows, run nmake /f Makefile from the Visual Studio x64 command prompt.