Repository navigation
feat(ui): show version, commit and OS in --version and About - #55
Merged
Merged
Conversation
- CMake generates version.h from the project version and git metadata (commit hash and commit date), falling back to "unknown" outside git - --version prints version, commit, commit date, Qt version and OS before QApplication starts - Help menu contains an About action; Qt moves it to the application menu on macOS (AboutRole), which is the native location - add an app_version CTest case and a HasHelpMenu GUI test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #19: the application now reports its version, commit and OS.
CMake generates
build/generated/version.hfromPROJECT_VERSIONplusgit rev-parse --short HEADandgit log -1 --format=%cs; outside a git checkout the values fall back tounknown.--versionprints beforeQApplicationis created, so it works without a display:Help -> About Digital Image Analyzer shows the same data. On macOS Qt moves this action to the application menu (
QAction::AboutRole), which is the native placement (follow-up Add a Help menu with usage information and links #54 covers adding real Help content).New tests:
app_version(CTest) andMainWindowTest.HasHelpMenu.Verification
ctest: 64/64 pass../build/DigitalImageAnalyzer.app/Contents/MacOS/DigitalImageAnalyzer --versionprints the expected block../test/tools/tidy.sh main.cpp mainwindow.cpp mainwindow.h: 0 issues.Fixes #19