Results 1 to 3 of 3

Thread: Is it possible to know if a application is running on debug or release inside QML?

  1. #1
    Join Date
    Jan 2013
    Posts
    17
    Thanks
    9

    Default Is it possible to know if a application is running on debug or release inside QML?

    At Qt/C++ there is QT_DEBUG define macro to know when it is compiled at debug or release, but at QML, is there any method to know if is the application running in debug o release mode?

    Thanks,

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,419
    Thanks
    37
    Thanked 1,546 Times in 1,496 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is it possible to know if a application is running on debug or release inside QML

    You could export that as a context property.

    Any specific reason why the QML code needs to know whether the C++ part is built in debug or release mode?

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    ricardodovalle (7th April 2014)

  4. #3
    Join Date
    Jan 2013
    Posts
    17
    Thanks
    9

    Default Re: Is it possible to know if a application is running on debug or release inside QML

    Because I want to hide some buttons and configurations from release mode.

    Thanks for your answer. Context property solved.


    Qt Code:
    1. #ifdef QT_DEBUG
    2. viewer.rootContext()->setContextProperty("debug", true);
    3. #else
    4. viewer.rootContext()->setContextProperty("debug", false);
    5. #endif
    To copy to clipboard, switch view to plain text mode 

    Quote Originally Posted by anda_skoa View Post
    You could export that as a context property.

    Any specific reason why the QML code needs to know whether the C++ part is built in debug or release mode?

    Cheers,
    _

Similar Threads

  1. Replies: 8
    Last Post: 26th September 2013, 19:35
  2. macros for x86/x64 and debug/release?
    By tuli in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2013, 23:55
  3. Replies: 1
    Last Post: 10th October 2012, 08:46
  4. Why not on release but debug
    By baray98 in forum Qt Programming
    Replies: 6
    Last Post: 10th August 2007, 09:08
  5. Debug and Release
    By paranoid_android in forum Qt Programming
    Replies: 5
    Last Post: 18th November 2006, 13:58

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.