Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Global #define in Qt project. How?
Forum Updated to NodeBB v4.3 + New Features

Global #define in Qt project. How?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 171 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote on 24 Aug 2023, 15:14 last edited by
    #1

    Hello!

    Got totally forgotten how to #define SOME_VALUE globally in Qt. Need to check this define in different header files and CPP files. Is there any way to make make it possible globally without adding to every header file in project? Qt Creator project settings? Or in *.pro file?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bogong
      wrote on 24 Aug 2023, 15:17 last edited by
      #2

      Solution found. Issue closed.
      In *.pro file:

      DEFINES += SOME_VALUE
      

      Here full explanation https://stackoverflow.com/questions/3348711/add-a-define-to-qmake-with-a-value

      1 Reply Last reply
      0
      • B bogong has marked this topic as solved on 24 Aug 2023, 15:17

      1/2

      24 Aug 2023, 15:14

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved