PDA

View Full Version : Retrieve Data from Project-File



mustermann.klaus@gmx.de
15th October 2020, 13:35
Hi there,

snippet of my pro-file as follows:



DEFINES += QT_NO_DEBUG_OUTPUT
CONFIG += release
TARGET = MyAppName
TEMPLATE = app


Can I somehow retrieve the TARGET (MyAppName) programmatically to use it on compile time to store it as a variable? The purpose could be to write it into a logfile on startup. I use it quite often hard coded to show it here and there at runtime. On every change on the desired target I have to search all the code to replace it.

Thank you all. Greetings, Lars

Lesiok
15th October 2020, 13:38
QCoreApplication::applicationName()

mustermann.klaus@gmx.de
15th October 2020, 14:30
Ahh, that easy. I'll try. Thank you.

Added after 19 minutes:

Works perfect. Thanks a lot.