Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. __FILE__ , __FUNCTION__ any similar macros to help identify subproject ?
Forum Updated to NodeBB v4.3 + New Features

__FILE__ , __FUNCTION__ any similar macros to help identify subproject ?

Scheduled Pinned Locked Moved Solved C++ Gurus
3 Posts 2 Posters 1.9k Views 2 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

    Question :
    Is there a similar macro to help identify sub project in SUBDIRS scheme?

    I like to be able to identify the actual "run"/ trace process in "SUBDIRS" execution.

    I am aware of "sequence" of "SUBDIIRS" as specified in main project .
    I like to trace the actual code execution via QDebug messages.

    So far "main " FILE and FUNCTION do not distinguish between projects.

    This is what I have so far
    #ifdef DEBUG
    // test QDebug
    qDebug() << "File "<< FILE;
    qDebug() << "Function @line "<< LINE << " __ " << FUNCTION ;
    qDebug() << "Date:" << QDate::currentDate();
    // qDebug() << "Types:" << QString("String") << QChar('x') << QRect(0, 10, 50, 40);
    #endif

    Maybe some kind of "custom #define subprojecX " would work ?
    But that would not identify the run sequence...

    #ifdef subprojectX
    qDebug () << " in ___FUNCTION __ in subproject X ";
    #elseif subroiject y

    ....

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

      Hi,

      No there's not.

      However you can use Q_FUNC_INFO that provides detailed informations so unless you have a lot of similar code, it should already help locate your issues more easily.

      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
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        Perfect,
        just modified Q_FUNC_INFO and added the subproject name.
        Better than silly preprocessor idea. Many thanks.

        QString funct_info =" btscanner main ";
        qDebug() << "Called " << funct_info << Q_FUNC_INFO ;

        PS
        There got to be "btscanner" as label / string /name somewhere....

        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