Fix 'qt4test' test executable when only Qt4 is present

This always tries to load a 'qt5core_fr' translation file, when it is
actually named 'qtNcore_fr'(where N is the qt version).
pull/6529/head
Jon Turney 5 years ago committed by Nirbheek Chauhan
parent 2313753319
commit 00c1779bf3
  1. 1
      test cases/frameworks/4 qt/meson.build
  2. 2
      test cases/frameworks/4 qt/q5core.cpp

@ -83,6 +83,7 @@ foreach qt : ['qt4', 'qt5']
qtcore = dependency(qt, modules : 'Core', method : get_option('method')) qtcore = dependency(qt, modules : 'Core', method : get_option('method'))
qtcoreapp = executable(qt + 'core', 'q5core.cpp', qtcoreapp = executable(qt + 'core', 'q5core.cpp',
cpp_args: '-DQT="@0@"'.format(qt),
dependencies : qtcore) dependencies : qtcore)
test(qt + 'test', qtcoreapp) test(qt + 'test', qtcoreapp)

@ -15,7 +15,7 @@ int main(int argc, char **argv) {
app.installTranslator(&qtTranslator); app.installTranslator(&qtTranslator);
QTranslator myappTranslator; QTranslator myappTranslator;
if(!myappTranslator.load("qt5core_fr") ) if(!myappTranslator.load(QT "core_fr") )
return 1; return 1;
app.installTranslator(&myappTranslator); app.installTranslator(&myappTranslator);

Loading…
Cancel
Save