OS Manuals

/usr/lib/qt5/bin/moc

Qt5 - QtBase components

From qt5-qtbase 5.15.19-r3 (os), captured 2026-11-05 by running moc --help (exit 0). permalink

Usage: /usr/lib/qt5/bin/moc [options] [header-file] [@option-file] [MOC generated json file]
Qt Meta Object Compiler version 67 (Qt 5.15.19)

Options:
  -h, --help                        Displays help on commandline options.
  --help-all                        Displays help including Qt specific
                                    options.
  -v, --version                     Displays version information.
  -o <file>                         Write output to file rather than stdout.
  -I <dir>                          Add dir to the include path for header
                                    files.
  -F <framework>                    Add Mac framework to the include path for
                                    header files.
  -E                                Preprocess only; do not generate meta
                                    object code.
  -D <macro[=def]>                  Define macro, with optional definition.
  -U <macro>                        Undefine macro.
  -M <key=value>                    Add key/value pair to plugin meta data
  --compiler-flavor <flavor>        Set the compiler flavor: either "msvc" or
                                    "unix".
  -i                                Do not generate an #include statement.
  -p <path>                         Path prefix for included file.
  -f <file>                         Force #include <file> (overwrite default).
  -b <file>                         Prepend #include <file> (preserve default
                                    include).
  --include <file>                  Parse <file> as an #include before the main
                                    source(s).
  -n <which>                        Do not display notes (-nn) or warnings
                                    (-nw). Compatibility option.
  --no-notes                        Do not display notes.
  --no-warnings                     Do not display warnings (implies
                                    --no-notes).
  --ignore-option-clashes           Ignore all options that conflict with
                                    compilers, like -pthread conflicting with
                                    moc's -p option.
  --output-json                     In addition to generating C++ code, create
                                    a machine-readable JSON file in a file that
                                    matches the output file and an extra .json
                                    extension.
  --collect-json                    Instead of processing C++ code, collect
                                    previously generated JSON output into a
                                    single file.
  --output-dep-file                 Output a Make-style dep file for build
                                    system consumption.
  --dep-file-path <file>            Path where to write the dep file.
  --dep-file-rule-name <rule name>  The rule name (first line) of the dep file.

Arguments:
  [header-file]                     Header file to read from, otherwise stdin.
  [@option-file]                    Read additional options from option-file.
  [MOC generated json file]         MOC generated json output
Options (25)
OptionDescriptionSource
-h, --helpDisplays help on commandline options.help
--help-allDisplays help including Qt specific options.help
-v, --versionDisplays version information.help
-o fileWrite output to file rather than stdout.help
-I dirAdd dir to the include path for header files.help
-F frameworkAdd Mac framework to the include path for header files.help
-EPreprocess only;help
-D macro[=defDefine macro, with optional definition.help
-U macroUndefine macro.help
-M key=valueAdd key/value pair to plugin meta datahelp
--compiler-flavor flavorSet the compiler flavor: either "msvc" or "unix".help
-iDo not generate an #include statement.help
-p pathPath prefix for included file.help
-f fileForce #include <file> (overwrite default).help
-b filePrepend #include <file> (preserve default include).help
--include fileParse <file> as an #include before the main source(s).help
-n whichDo not display notes (-nn) or warnings (-nw).help
--no-notesDo not display notes.help
--no-warningsDo not display warnings (implieshelp
--ignore-option-clashesIgnore all options that conflict with compilers, like -pthread conflicting with moc's -p option.help
--output-jsonIn addition to generating C++ code, create a machine-readable JSON file in a file that matches the output file and an extra .json extension.help
--collect-jsonInstead of processing C++ code, collect previously generated JSON output into a single file.help
--output-dep-fileOutput a Make-style dep file for build system consumption.help
--dep-file-path filePath where to write the dep file.help
--dep-file-rule-name ruleThe rule name (first line) of the dep file.help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.