Macro in Ui file
-
I had defined a Macro in cmakeList.txt (e.g., MY_PROJECT = Abc), I want to use that macro in form file's object name (MY_PROJECT::MyTest). it is not taking value of macro, instead it creates ui_MyTest.h with that Macro itself.
namespace MY_PROJECT{
namespace Ui{
}
}I want to know, why it is not replacing MY_PROJECT with Abc. Is there any other way to achieve this.
-
I had defined a Macro in cmakeList.txt (e.g., MY_PROJECT = Abc), I want to use that macro in form file's object name (MY_PROJECT::MyTest). it is not taking value of macro, instead it creates ui_MyTest.h with that Macro itself.
namespace MY_PROJECT{
namespace Ui{
}
}I want to know, why it is not replacing MY_PROJECT with Abc. Is there any other way to achieve this.
@Jk25 said in Macro in Ui file:
I want to know, why it is not replacing MY_PROJECT with Abc. Is there any other way to achieve this.
Because uic does not handle any macros. It is not designed for such hacks.
-
@Jk25 said in Macro in Ui file:
I want to know, why it is not replacing MY_PROJECT with Abc. Is there any other way to achieve this.
Because uic does not handle any macros. It is not designed for such hacks.
@Christian-Ehrlicher Thanks for the info.
Is there any other way to achieve this. As, I'm trying to change at once place and whole project get those changes. -
@Christian-Ehrlicher Thanks for the info.
Is there any other way to achieve this. As, I'm trying to change at once place and whole project get those changes.@Jk25 said in Macro in Ui file:
I'm trying to change at once place and whole project get those changes.
Why is this needed?
One way would be to have a custom build step where you use *.ui template files to replace whatever you want to replace. But then you will also need to do it in source code where you use the generated header files. I really don't get the point to do such things.