Что такое формат файла PRI?
.pri is a file format associated with the Qt development environment. .pri files store compiler settings and qmake parameters - variable assignments such as SOURCES +=, HEADERS +=, INCLUDEPATH +=, and DEFINES that control how a project is built. .pri files also contain references to other project files and target system information. Although .pri files store information in plain text, such files should not be edited without a working knowledge of the Qt framework and qmake syntax.
A .pri file is a reusable build-script fragment, not a standalone project. It is pulled into a parent .pro project file via the include() directive, allowing shared build settings to be modularised and reused across multiple subprojects without duplicating code.
Qt is a software development environment and framework for building graphical user interfaces. Qt is a multi-platform tool that offers many advanced development tools, running on Windows, macOS, Linux, and embedded systems. It is available under open-source (LGPL) and commercial licences. Qt project build settings, including .pri include files, are stored in plain text and can be shared and reused across multiple projects.
Starting with Qt 6, CMake has become the recommended build system, and .pri files are gradually being phased out in favour of .cmake include files. Existing projects that use .pri files continue to work under qmake, which remains bundled with Qt 6.
Безопасность и защита
РИСК: LOWA .pri is a plain-text build script, so the file itself is harmless to open and read. The only caution applies when building untrusted source: qmake scripts can run shell commands (via system() or custom build steps), so do not build a downloaded project you do not trust without reviewing its .pro/.pri files first.
Детали формата
в двух словах- Windows Package Resource Index (resources.pri) - Compiled binary resource index in UWP/MSIX Windows apps, built by MakePRI - unrelated to Qt and not a text file.
- Oracle Primavera / 'priority' data files - Various unrelated apps use .pri for priority or project data; niche.
Программы, открывающие файлы PRI
Технические подробности
глубокая спецификация| Full name | Qt Project Include File |
| MIME type | text/plain |
| Encoding | UTF-8 or ASCII |
| Typical file size | Under 1 KB to a few KB |
| Key build variables | SOURCES, HEADERS, INCLUDEPATH, FORMS, RESOURCES, DEFINES |
| Inclusion mechanism | include(path/file.pri) directive inside a parent .pro file |
| Path reference syntax | $$PWD expands to the directory containing the current .pri file |
| Variable operator syntax | Supports =, +=, -=, *=, ~= assignment operators |
| Build system | qmake (bundled with Qt) |
| Developer / maintainer | The Qt Company (formerly Trolltech → Nokia → Digia) |
| Supported platforms | Windows, macOS, Linux, Android, iOS, embedded systems |
| File structure | Plain-text variable-assignment script; no binary sections or file header |
| Relation to .pro files | A .pri is a fragment; one .pro can include multiple .pri files |
| Typical use case | Sharing source lists, include paths, or feature flags across multiple subprojects |
| Editability | Readable and editable in any text editor or Qt Creator |
| Status in Qt 6 | Deprecated in favour of CMake; qmake and .pri files still supported for legacy projects |
| Выпущен | Early 2000s (qmake build system, part of Qt) |
| Последняя версия | Maintained alongside qmake in Qt 5.x / Qt 6.x (qmake being phased out in favour of CMake in Qt 6) |
| Открыть стандартное | Да · без роялти |
| Спецификация | doc.qt.io |
Конвертации PRI
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах PRI.