View Full Version : QT and Maya API C++

03 March 2011, 01:02 AM
I tried the following command in Maya Plugin (C++ and QT)

QCoreApplication* app = qApp;

if (app)
cout << "Application name is '" << app->applicationName().toStdString() << "'" << endl;
The output is "Application name is '' "

Any ideas why this is returning NULL instead of something like “Maya-2011”?
I am using Maya 2011, Visual Studio 2010 and QT 4.7.2. The function gets call from within a plugin using a command. It executes but return NULL as application name. Any help is appreciated.


03 March 2011, 09:29 AM
It returns a NULL pointer because your maya plugins is linked against the qt 4.7 while maya 2011 uses qt 4.5.3, so your plugin will search for a qapplication started with qt 4.7.
Link your plugin with qt 4.5.3 and it will work fine.


CGTalk Moderation
03 March 2011, 09:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.