diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-07-27 12:10:33 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-08-04 15:41:07 +0200 |
commit | 0a91ac627e84634993fc579d428e4bbc3d0b283a (patch) | |
tree | ec384db3536d69ebeea43ef6cdeaeb77350d4c46 /examples/linguist | |
parent | 819983972f3e8d7062c94d073b83ee7821a188ab (diff) | |
download | qttools-0a91ac627e84634993fc579d428e4bbc3d0b283a.tar.gz |
Check the return value from QTranslator::load()
Examples should exhibit good practice.
Change-Id: Ib1ec9c85ca4202ef6d0b5884aea101c64913507f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples/linguist')
-rw-r--r-- | examples/linguist/hellotr/main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/linguist/hellotr/main.cpp b/examples/linguist/hellotr/main.cpp index bf7effc46..24206f093 100644 --- a/examples/linguist/hellotr/main.cpp +++ b/examples/linguist/hellotr/main.cpp @@ -64,7 +64,8 @@ int main(int argc, char *argv[]) //! [5] QTranslator translator; //! [5] //! [6] - translator.load("hellotr_la"); + if (!translator.load("hellotr_la")) + return 1; //! [6] //! [7] app.installTranslator(&translator); //! [4] //! [7] |