83 fprintf(stderr,
"Unable to open %s: %s\n",
84 outFileName.
isEmpty() ? qPrintable(outFileName) :
"standard output",
124 for (
int i = 0;
i < depsList.size(); ++
i) {
142 parser.setApplicationDescription(
QLatin1String(
"Qt Resource Compiler version " QT_VERSION_STR));
144 parser.addVersionOption();
149 parser.addOption(outputOption);
154 parser.addOption(tempOption);
157 parser.addOption(nameOption);
160 parser.addOption(rootOption);
162 #if QT_CONFIG(zstd) && !defined(QT_NO_COMPRESS)
163 # define ALGOS "[zstd], zlib, none"
164 #elif QT_CONFIG(zstd)
165 # define ALGOS "[zstd], none"
166 #elif !defined(QT_NO_COMPRESS)
167 # define ALGOS "[zlib], none"
169 # define ALGOS "[none]"
171 const QString &algoDescription =
174 parser.addOption(compressionAlgoOption);
178 parser.addOption(compressOption);
181 parser.addOption(nocompressOption);
184 parser.addOption(noZstdOption);
187 parser.addOption(thresholdOption);
190 parser.addOption(binaryOption);
194 generatorOption.setValueName(
QStringLiteral(
"cpp|python|python2"));
195 parser.addOption(generatorOption);
198 parser.addOption(passOption);
201 parser.addOption(namespaceOption);
204 parser.addOption(verboseOption);
207 parser.addOption(listOption);
210 QStringLiteral(
"Only output a mapping of resource paths to file system paths defined in the .qrc file, do not generate code."));
211 parser.addOption(mapOption);
215 parser.addOption(depFileOption);
218 parser.addOption(projectOption);
221 parser.addOption(formatVersionOption);
232 if (
parser.isSet(formatVersionOption)) {
234 formatVersion =
parser.value(formatVersionOption).toUInt(&
ok);
237 }
else if (formatVersion < 1 || formatVersion > 3) {
243 if (
parser.isSet(nameOption))
245 if (
parser.isSet(rootOption)) {
247 if (
library.resourceRoot().isEmpty()
252 if (
parser.isSet(compressionAlgoOption))
256 if (
parser.isSet(nocompressOption))
258 if (
parser.isSet(noZstdOption))
264 if (
parser.isSet(thresholdOption))
265 library.setCompressThreshold(
parser.value(thresholdOption).toInt());
266 if (
parser.isSet(binaryOption))
268 if (
parser.isSet(generatorOption)) {
275 qWarning(
"Format python2 is no longer supported, defaulting to python.");
282 if (
parser.isSet(passOption)) {
290 if (
parser.isSet(namespaceOption))
292 if (
parser.isSet(verboseOption))
296 const bool map =
parser.isSet(mapOption);
297 const bool projectRequested =
parser.isSet(projectOption);
304 qWarning(
"%s: File does not exist '%s'", argv[0], qPrintable(
file));
313 if (projectRequested) {
317 if (filenamesIn.isEmpty())
321 fprintf(stderr,
"%s: %s\n", argv[0], qPrintable(
errorMsg));
329 errorDevice.
write(
"Qt resource compiler\n");
331 library.setInputFiles(filenamesIn);
357 _setmode(_fileno(stdout), _O_BINARY);
366 out.setFileName(outFilename);
369 .
arg(outFilename,
out.errorString());
378 for (
int i = 0;
i <
data.size(); ++
i) {
388 out.write(qPrintable(
it.key()));
423 .
arg(tempFilename,
out.errorString());
428 bool success =
library.output(
out, temp, errorDevice);
439 int main(
int argc,
char *argv[])
small capitals from c petite p scientific i
[1]
The QCommandLineOption class defines a possible command-line option. \inmodule QtCore.
void setDescription(const QString &description)
void setValueName(const QString &name)
The QCommandLineParser class provides a means for handling the command line options.
The QCoreApplication class provides an event loop for Qt applications without UI.
static void setApplicationVersion(const QString &version)
The QDir class provides access to directory structures and their contents.
static QString cleanPath(const QString &path)
The QFile class provides an interface for reading from and writing to files.
bool open(OpenMode flags) override
void setFileName(const QString &name)
QString fileName() const override
The QFileInfo class provides system-independent file information.
The QIODevice class is the base interface class of all I/O devices in Qt.
qint64 write(const char *data, qint64 len)
QString errorString() const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
The QString class provides a Unicode character string.
static QString fromLatin1(QByteArrayView ba)
static QString fromUtf8(QByteArrayView utf8)
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=QLatin1Char(' ')) const
The QStringList class provides a list of strings.
The QTextStream class provides a convenient interface for reading and writing text.
static CompressionAlgorithm parseCompressionAlgorithm(QStringView algo, QString *errorMsg)
int main(int argc, char **argv)
QMap< QString, QString > map
[6]
bool isOk(ResultWas::OfType resultType)
QList< QString > QStringList
EGLOutputLayerEXT EGLint EGLAttrib value
GLenum GLuint GLint level
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
int QT_PREPEND_NAMESPACE(QSharedMemoryPrivate)
#define QStringLiteral(str)
QT_BEGIN_NAMESPACE void dumpRecursive(const QDir &dir, QTextStream &out)
int runRcc(int argc, char *argv[])
void writeDepFile(QIODevice &iodev, const QStringList &depsList, const QString &targetName)
QString makefileEscape(const QString &filepath)
int createProject(const QString &outFileName)
QTextStream out(stdout)
[7]
QApplication app(argc, argv)
[0]
static Q_CORE_EXPORT void setDeterministicGlobalSeed()
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.