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. Get file name, line number and function name in QML Javascript from C++. How?
Forum Update on Monday, May 27th 2025

Get file name, line number and function name in QML Javascript from C++. How?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 157 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 2 Feb 2021, 09:48 last edited by bogong 2 Feb 2021, 09:55
    #1

    Hello!
    I've got clear how to get file name, line number and function name in QML via Javascript function. The question is how to do the same but FROM C++, I need to get JavaScript file name, line number and function name in QML WITHOUT using JS directly. Just C++ code. Something like this:

    C++ header

    ...
    public slots:
    	void mGetStack(void);
    ...
    

    C++

    void SomeClass::mGetStack(void) {
    	... (some C++)
    }
    

    QML

    onCompleted: {
    	SomeClass.mGetStack()
    }
    

    What should be instead of "some C++"?

    1 Reply Last reply
    0

    1/1

    2 Feb 2021, 09:48

    • Login

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