Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Guidance to create an AI plugin with Qt UI

Engaged ,
Jul 15, 2016 Jul 15, 2016

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?

TOPICS
SDK
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Engaged ,
Jul 25, 2016 Jul 25, 2016

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jul 26, 2016 Jul 26, 2016

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 26, 2022 Apr 26, 2022
LATEST

Hi, I am a beginner and encountered the same problem, can't callback from QT ui to AI. How can I solve it?

 

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines