Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML equivalents to __FILE__, __LINE__ etc ?

QML equivalents to __FILE__, __LINE__ etc ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 461 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by
    #1

    In my debugging of QML I regularly have console log outputs reporting the QML file and line number, this requires adjustment after every edit, which can be quite time consuming, in C/C++ there are preprocessor macros like:

    __ FILE__ and __LINE__
    

    That are replaced at compile time with the fill path of the source file ad the line number, is there anything in QML that can be used to do the same?

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • kkoehneK Offline
      kkoehneK Offline
      kkoehne
      Moderators
      wrote on last edited by kkoehne
      #2

      Not a direct equivalent. But if you want to just the origin of logging messages, you can include file, line information in the logging output by calling qSetMessagePattern(), or setting the QT_MESSAGE_PATTERN environment variable.

      Director R&D, The Qt Company

      SPlattenS 1 Reply Last reply
      2
      • kkoehneK kkoehne

        Not a direct equivalent. But if you want to just the origin of logging messages, you can include file, line information in the logging output by calling qSetMessagePattern(), or setting the QT_MESSAGE_PATTERN environment variable.

        SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by
        #3

        @kkoehne thank you, will look into it.

        Kind Regards,
        Sy

        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