Copy link to clipboard
Copied
Hi All,
I am developing a plugin for AI CC 2015 that requires UI to be done in Qt. I have Qt 5.5.
Although, I have come across several discussions in the forum where the discussions always start with how they have a C++ plugin with Qt UI and the problems they face is after the creation of this combination.
What I am looking for is how to create a plugin like that. And, I have found nothing so far.
Is there any help available for this, since people have been doing this for years now. There should be.
Can anyone guide me here please?
Copy link to clipboard
Copied
I have not used QT for UI, but I did briefly use Cocoa during the ADM days.
The general process is to catch the event you're looking for, eg a menu item selection.
In response to that, instead of calling into the Illustrator suite functions, load your own dialog.
Send whatever data you need back to the plugin.
I can't help with the specifics of setting up and loading a QT dialog.
Copy link to clipboard
Copied
So far I have tried this,
AIPanelPlatformWindow panelPlatfromWindow = NULL;
sAIPanel->GetPlatformWindow(fPanel, panelPlatfromWindow);
int argc = 0;
// Get the instance of QApplication
QApplication* _Application = static_cast<QApplication *>(QApplication::instance());
_Application = new QApplication(argc, 0, true);
viewerWidget = new QWidget();
viewerWidget->move(10, 50);
viewer = new Ui::Viewer;
viewer->setupUi(viewerWidget);
SetWindowLong((HWND)viewerWidget->winId(), GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
SetParent((HWND)viewerWidget->winId(), panelPlatfromWindow);
viewerWidget->show();
::SetPropA((HWND)(panelPlatfromWindow), "TPNL", this);
fDefaultWindProc = reinterpret_cast<WNDPROC>(SetWindowLongPtr((HWND)(panelPlatfromWindow), GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(MyPlugin::NewWindowProc)));
However, I was having issues in getting callbacks from Qt UI to C++ plugin. I found that QWinWidget was recommended for this. So I tried the following,
QWinWidget win(panelPlatfromWindow);
HWND winId = (HWND)win.winId();
// Qt UI
int argc = 0;
// Get the instance of QApplication
QApplication* _Application = static_cast<QApplication *>(QApplication::instance());
_Application = new QApplication(argc, 0, true);
viewerWidget = new QWidget();
viewerWidget->move(10, 50);
viewer = new Ui::Viewer;
viewer->setupUi(viewerWidget);
SetParent((HWND)viewerWidget->winId(), winId);
viewerWidget->show();
// Set the panel property
::SetPropA(winId, "TPNL", this);
fDefaultWindProc = reinterpret_cast<WNDPROC>(SetWindowLongPtr(winId, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(MyPlugin::NewWindowProc)));
But in this case, the executions just breaks down at QWinWidget win(panelPlatfromWindow);
No exceptions, nothing...
Please guide.. Anyone?
Copy link to clipboard
Copied
Hi, I am a beginner and encountered the same problem, can't callback from QT ui to AI. How can I solve it?
Thanks!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now