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. QT_DEBUG define is not working in Header files
Forum Updated to NodeBB v4.3 + New Features

QT_DEBUG define is not working in Header files

Scheduled Pinned Locked Moved Solved General and Desktop
qtdebug
3 Posts 2 Posters 2.8k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    ManhNT
    wrote on last edited by SGaist
    #1

    Hello Everyone, I'm using Qt 4.8.6 on Windows 7 32bit and this seems strange that I can't use
    QT_DEBUG define in header files, but it still works in my .cpp file of the same project (under the Debug configurations)
    Screenshot: http://s24.postimg.org/vt588quac/image.jpg
    Does anyone know how to fix the problem?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You should #include <QtGlobal> if you don't have any other Qt related includes in your header file.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4
      • M Offline
        M Offline
        ManhNT
        wrote on last edited by ManhNT
        #3

        Ah, that actually works. My header didn't include anything from Qt but my source file did, that was why it only worked with .cpp file. Thank you :)

        1 Reply Last reply
        0

        • Login

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