diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-05-07 21:52:08 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-05-07 21:52:08 +0200 |
commit | db3dfd03c603589463ee44c0ed14dda0a16ee5cf (patch) | |
tree | de74f46dbdaf66715ca0c55bb47243187e7a6528 /bin | |
parent | aa566e72972fd3b56f1c004153eb53792bdbfb10 (diff) |
small script to fix Qt4 include headers
The script goes through all includes of the style of
and changes them to <QtWidget/QAction>
Simply run over your source code to get most compile
errors due to classes that moved between different
Qt libraries fixed.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/fixqt4headers | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/fixqt4headers b/bin/fixqt4headers new file mode 100755 index 0000000000..8546815e74 --- /dev/null +++ b/bin/fixqt4headers @@ -0,0 +1,20 @@ +#!/bin/bash + +modules=`ls $QTDIR/include` + +files=`find * -name '*.h' -or -name '*.cpp' -or -name '*.C'` + +echo $files + +for module in $modules; do +# once we change other things, change the line from == "QtWidgets" to != "Qt" to get everything fixed + if [ $module == "QtWidgets" ]; then + echo $module ":" + includes=`ls $QTDIR/include/$module` + for i in $includes; do +# echo " fixing " $i + perl -pi -e "s,^#include +<.+/$i>,#include <$module/$i>," $files; +# perl -pi -e 's,^#include +".+/$i",#include "$module/$i",' $files; + done; + fi; +done; |