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 214 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 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 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

      • Login

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