Hi
I'm developing a plugin for AI CS5 and AI CS6 for Windows and MacOSX.
I use Qt instead of ADM which is now not supported.
I'm trying to use Qt 4.8.1 on Windows 7 with Illustrator CS 5. When I quit Illustrator, the application crashes. If I remove the instanciation of the QApplication, Illustrator closes properly.
Is it possible to share some small example which runs on Windows and MacOS X ?
I've tested on MacOS X to use Qt in a panel and indeed it doesn't work well.
When I use Qt to make dialog boxes on MacOS X, it works properly but there seem less integrated for the final user. (We lose some default behaviours provided by the panel).
Is it possible to have a look on the example you posted in the developer prerelase ? Where will be the updated example, in a new SDK release or by a download link in this forum ?
Can you post the crash log? Does it crash on both platforms?
The sample I had was to help others set up the project to include Qt, the actual Qt code was just to show a dialog. The hardest part for most people seems to be the qt project setup. If you have Qt set up in your project, you are way farther along than most.
The Qt code itself was showing Qt at it's most basic, modifying TwirlFilter example by pasting this at the top of
TwirlGetParms() function:
if (!QCoreApplication::instance()) {
QApplication::setAttribute(Qt::AA_MacPluginApplication);
int argc = 0;
/*somePointerToDeleteLater = */ new QApplication(argc, 0); // normally, one would track that they did or did not allocate the qapp and delete it accordingly.
}
QWidget* parent = 0; // on mac a null parent works best
#ifndef MAC_ENV
AIWindowRef windowRefParent;
AIErr error = sAppContext->GetPlatformAppWindow(&windowRefParent);
assert(windowRefParent);
QWinWidget winParent(windowRefParent); // on pc, the app window wrapped in a qwinwidget works best
parent = &winParent;
#endif
QString text = QInputDialog::getText(parent, "Tester", "Something:");
I used the example named Tutorial. In the tutorial.cpp, I've declared the following variables
static bool g_ownApplication = false;
static QApplication* g_application = 0;
static int g_argc = 0; /
and I've put the following code in the StartupPlugin function. The following code is executed only once
if (!g_application){
g_ownApplication = (QCoreApplication::instance() == 0); // To know if we own the object, if yes we must delete it when AI closes
if (g_ownApplication)
g_application = new QApplication(g_argc, 0);
else
g_application = qobject_cast<QApplication*>(QCoreApplication::instance());
}
If I delete or not the QApplication object, AI crashes, it crashes in the DispatchHookW function.
When you tested Qt, which version did you use ?
I don't know if it will help you, I have something like this when AI closes
| ntdll.dll!_ZwRaiseException@12() + 0x12 octets | ||
| ntdll.dll!_ZwRaiseException@12() + 0x12 octets | ||
| ntdll.dll!ExecuteHandler2@20() + 0x26 octets | ||
| ntdll.dll!ExecuteHandler@20() + 0x24 octets | ||
| ntdll.dll!_RtlDispatchException@8() + 0xd3 octets | ||
| ntdll.dll!_KiUserExceptionDispatcher@8() + 0xf octets | ||
| 5bbb56c0() | ||
| user32.dll!_DispatchHookW@16() + 0x38 octets | ||
| 0018fd00() | ||
| ntdll.dll!_KiUserCallbackDispatcher@12() + 0x2e octets | ||
| user32.dll!_NtUserGetMessage@16() + 0x15 octets | ||
| user32.dll!_GetMessageW@16() + 0x2b octets | ||
| Illustrator.exe!004c4dd1() | ||
| [Les frames ci-dessous sont peut-être incorrects et/ou manquants, aucun symbole chargé pour Illustrator.exe] | ||
| Illustrator.exe!004fa3df() | ||
| Illustrator.exe!0054da2a() | ||
| Illustrator.exe!005bf4dd() | ||
| > | msvcr90.dll!_getptd_noexit() Ligne 616 + 0x7 octets | C |
| Illustrator.exe!00c27b2c() | ||
| kernel32.dll!@BaseThreadInitThunk@12() + 0x12 octets | ||
| ntdll.dll!___RtlUserThreadStart@8() + 0x27 octets | ||
| ntdll.dll!__RtlUserThreadStart@8() + 0x1b octets |
I will try with Qt 4.7.4
North America
Europe, Middle East and Africa
Asia Pacific