diff options
| author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-11-25 20:01:00 +0100 |
|---|---|---|
| committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-11-26 11:24:36 +0000 |
| commit | 9233fc6c9e95b00c5c79129a97030b8a11ba43d1 (patch) | |
| tree | 7dd6dc9432039e79c244f83eec6978baa6e0e19e | |
| parent | 1e624421eb89a45904a7fc7c170d4b9ef3b13ea3 (diff) | |
qsb: Print the Qt version alongside the app name
Serialization and deserialization of .qsb files is implemented in
QShader in QtGui. There is backwards, but not forward compatibility in
the serialization format: QShader in 5.15 is guaranteed to be able to
deserialize shaders from 5.14, but 5.14 is not compatible with serialized
data from 5.15.
Therefore, verifying what Qt version qsb is using at run time
(qVersion()) can be useful to help avoiding confusion when one has multiple
builds of shadertools against multiple qtbase versions.
Additionally, enable -v and --version. These will show the build time Qt
version (QT_VERSION_STR).
Task-number: QTBUG-80320
Change-Id: Id1ac92a022a5f066f1f4998456e21a89048ef47f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| -rw-r--r-- | tools/qsb/qsb.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/qsb/qsb.cpp b/tools/qsb/qsb.cpp index d8a502e..c59070a 100644 --- a/tools/qsb/qsb.cpp +++ b/tools/qsb/qsb.cpp @@ -296,8 +296,11 @@ int main(int argc, char **argv) QCoreApplication app(argc, argv); QCommandLineParser cmdLineParser; - cmdLineParser.setApplicationDescription(QObject::tr("Qt Shader Baker")); + const QString appDesc = QString::asprintf("Qt Shader Baker (using QShader from Qt %s)", qVersion()); + cmdLineParser.setApplicationDescription(appDesc); + app.setApplicationVersion(QLatin1String(QT_VERSION_STR)); cmdLineParser.addHelpOption(); + cmdLineParser.addVersionOption(); cmdLineParser.addPositionalArgument(QLatin1String("file"), QObject::tr("Vulkan GLSL source file to compile"), QObject::tr("file")); QCommandLineOption batchableOption({ "b", "batchable" }, QObject::tr("Also generates rewritten vertex shader for Qt Quick scene graph batching.")); cmdLineParser.addOption(batchableOption); |
