I don't see anything bad even in redefining the "qApp" macro itself (inclusion guards in Qt headers will protect your redefinition from being reverted) instead of inventing your "myApp" one.
On 03/20/2014 10:58 PM, Andrej Kacian wrote: > Hello all, > > I was wondering, if I subclass QApplication for my program, is it a good idea > to just copy and adjust the definition of "qApp" macro if I want to use a > similar macro to refer to my subclass from anywhere? > > E.g.: > #if defined(myApp) > #undef myApp > #endif > #define myApp (static_cast<MyApplication *>(QCoreApplication::instance())) > > (taken from Qt 4.8 source code) > > Is this a proper way, or will it bring some problems along the way? > > Thanks
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest