-1

I can get a list of Qt .ui files like so:

D:\programing\qtproject\ui\designer>dir *.ui /B
main.ui
mainmenu.ui
mainwindow.ui

And what I do right now is that I manually run uic for every one of them, because IDE I'm using (QtCreator, ironically the one IDE that should be perfectly compatible with Qt) is not capable of that.

So can I run uic with a list of files obtained from dir *.ui /B? I would prefer if this worked recursively on all subdirectories.

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778

1 Answers1

0

Ok, I cracked it using some helpful answers:

@echo off
rem Runs uic command over all files in all subdirectories
rem For loop arguments explained here: http://stackoverflow.com/a/3433012/607407
rem start command arguments explained here: http://stackoverflow.com/a/154090/607407
rem       /B is why the start creates no additional windows: http://stackoverflow.com/a/324549/607407

for /f %%F in ('dir *.ui /S /B') do start "" /B "uic" %%F -o %%~dpFui_%%~nF.h

To disable the recursion (subdirectories), remove the /S parameter in the dir command.

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778