Results 1 to 2 of 2

Thread: how can we convert __PRETTY_FUNCTION__ to a QString

  1. #1
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default how can we convert __PRETTY_FUNCTION__ to a QString

    I hope to log each function name by using __PRETTY_FUNCTION__. But I do not know how to convert it to a QString. Please give some helps!

    Thanks in advance!

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how can we convert __PRETTY_FUNCTION__ to a QString

    use Q_FUNC_INFO instead. It returns const char * and which is then automatically converted to QString when it is needed or you can convert it explicitly: QString(Q_FUNC_INFO)
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. How to convert from QString to string ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 1st December 2010, 01:50
  2. convert QString to int
    By mattia in forum Newbie
    Replies: 2
    Last Post: 4th January 2008, 09:10
  3. how to convert int to QString?
    By phillip_Qt in forum Newbie
    Replies: 2
    Last Post: 5th October 2007, 08:07
  4. How to convert Int to QString in QT4?
    By drake1983 in forum Newbie
    Replies: 2
    Last Post: 11th March 2007, 06:58
  5. How to convert from QString to quint16 ?
    By probine in forum Qt Programming
    Replies: 5
    Last Post: 31st March 2006, 09:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.