I am using Qt 4.5 in Windows XP. My pro file has the variable VERSION = 1.0
. Now i need to read this variable and get its value (1.0
) from the source code. So that I don't have to maintain another variable for version inside my source code. I just read from the pro file and update it. So that the value remains consistent all over my project. Is it possible? Any pointers regarding this are welcome..
相关问题
- QML: Cannot read property 'xxx' of undefin
- QTextEdit.find() doesn't work in Python
- QT Layouts, how to make widgets in horizontal layo
- QT Layouts, how to make widgets in horizontal layo
- QT GUI freezes even though Im running in separate
相关文章
- ubuntu20.4中c#通过c++库调用python脚本
- Qt槽函数自动执行多遍
- Is there a non-java, cross platform way to launch
- How to get a settings storage path in a cross-plat
- How to set the font size of the label on pushbutto
- Why doesn't valgrind detect a memory leak in m
- QTreeView remove decoration/expand button for all
- qt界面拥挤
I'll elaborate on this a bit.
In the
YourApp.pro
:In the
main.cpp
:Wherever else in your sources, e.g. in the imaginary
controller.cpp
:Use somethings like this:
This will define a macro that you can use in C source code. Get rid of the backslashes and quotes if you want a number, not a string.