Merge pull request #2956 from jeandet/Qt_resource_in_subfolder

Qt resource in subfolder
pull/2949/merge
Jussi Pakkanen 7 years ago committed by GitHub
commit 22be11514d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      mesonbuild/modules/qt.py
  2. 3
      test cases/frameworks/4 qt/meson.build
  3. 10
      test cases/frameworks/4 qt/subfolder/main.cpp
  4. 4
      test cases/frameworks/4 qt/subfolder/meson.build
  5. 6
      test cases/frameworks/4 qt/subfolder/resources/stuff3.qrc
  6. BIN
      test cases/frameworks/4 qt/subfolder/resources/thing.png

@ -83,7 +83,7 @@ class QtBaseModule:
mlog.warning("malformed rcc file: ", os.path.join(state.subdir, fname))
break
else:
result.append(os.path.join(state.subdir, relative_part, child.text))
result.append(os.path.join(relative_part, child.text))
return result
except Exception:
return []

@ -92,5 +92,8 @@ foreach qt : ['qt4', 'qt5']
plugin = library(qt + 'plugin', 'plugin/plugin.cpp', pluginpreprocess,
include_directories : plugin_includes,
dependencies : qtcore)
if qt == 'qt5'
subdir('subfolder')
endif
endif
endforeach

@ -0,0 +1,10 @@
#include <QImage>
int main(int argc, char **argv) {
Q_INIT_RESOURCE(stuff3);
QImage qi(":/thing.png");
if(qi.width() != 640) {
return 1;
}
return 0;
}

@ -0,0 +1,4 @@
qresources = qtmodule.preprocess(qresources : 'resources/stuff3.qrc')
app = executable('subfolder', 'main.cpp', qresources, dependencies : qtdep)

@ -0,0 +1,6 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource>
<file>thing.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Loading…
Cancel
Save