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. Tracking project versions using QDebug
Forum Updated to NodeBB v4.3 + New Features

Tracking project versions using QDebug

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 182 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by aha_1980
    #1

    I am using QDebug to track code execution.
    After recent mishap where edited files were not used by build I added
    qDebug FILE

    First line of "application output" ( in blue ) automatically identifies the project executable folder.

    I am curious where is it configured / activated.

    My question is
    can I identify the actual main project source folder in "application output" ?

    Using FILE works fine , but does to give full path. .

    Starting /home/f/build-TEST_PROJECT-Desktop-Debug/TEST_PROJECT...
    OK  Bluetooth local device detected  
    QDEBUG TRACE 
    file      ../QT_PROJECT/TEST_PROJECT _1/mainwindow.cpp
    function  MainWindow
    @line     87
    TEMPORARY EXIT 
    
    JonBJ 1 Reply Last reply
    0
    • A Anonymous_Banned275

      I am using QDebug to track code execution.
      After recent mishap where edited files were not used by build I added
      qDebug FILE

      First line of "application output" ( in blue ) automatically identifies the project executable folder.

      I am curious where is it configured / activated.

      My question is
      can I identify the actual main project source folder in "application output" ?

      Using FILE works fine , but does to give full path. .

      Starting /home/f/build-TEST_PROJECT-Desktop-Debug/TEST_PROJECT...
      OK  Bluetooth local device detected  
      QDEBUG TRACE 
      file      ../QT_PROJECT/TEST_PROJECT _1/mainwindow.cpp
      function  MainWindow
      @line     87
      TEMPORARY EXIT 
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @AnneRanch
      A number of macros, including __FILE__, are defined for convenience by the C++ compiler, rather than being a Qt feature. See e.g. https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html.

      There are a number of posts out there to play with it if you want to pick out a segment from __FILE__.

      I don't know though whether Qt provides any macro for "the actual main project source folder in "application output" ". I kind of think not, but stand to be corrected.

      You could probably pass a -DSOMETHING=/path from the makefile --- which might know where the source folder is --- as an argument in your compilation line so that you can use the symbol in your source code. But that's more work.

      1 Reply Last reply
      1

      • Login

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