Originally Posted by
iswaryasenthilkumar
am having coding below
QString configpath("/home/ishwarya/display_images");
i should not use this path directly in coding , i have to give in macros.
can any one please guide to me to do macros.
Thanks in Advance
I suspect what you're looking for is something like this in a header file:
#define CONFIG_PATH "/home/ishwarya/display_images"
#define CONFIG_PATH "/home/ishwarya/display_images"
To copy to clipboard, switch view to plain text mode
and then in your cpp file:
QString configpath(CONFIG_PATH);
To copy to clipboard, switch view to plain text mode
This approach would allow you to reference the config path anywhere in your code and if you need to change it, you only need to change the define statement in the header file. That said, it really sounds like your config path should either be specified via user input or specified programattically rather than hard coded. There certainly is not a "/home/ishwarya/display_images" folder on anyone else's system.
Good luck.
Bookmarks