Highlighted

macOS Qt QLineEdit/QTextBox Focus Issue

Community Beginner ,
Mar 05, 2019

Copy link to clipboard

Copied

Hello,

I am currently having an issue with my plugin on macOS using Qt. When selecting a text box (i.e. QLineEdit or QTextEdit) I can enter text but most times (sometimes it works?) I cannot use shortcuts to commands like cut, copy and insert text as it conflicts with the commands of Adobe Illustrator itself. This is my current code in my CustomPlugin::StartupPlugin() function:

customWidget = new CustomWidget();

[panelPlatformWindow setAutoresizesSubviews:YES];

NSView* customWidgetView = (__bridge NSView*)reinterpret_cast<void*>(customWidget->winId());

[customWidgetView setAutoresizingMask:NSViewWidthSizable | NSViewWidthSizable];

[customWidgetView setAutoresizesSubviews:YES];

[panelPlatformWindow setFrame:[customWidgetView frame]];

[panelPlatformWindow addSubview:customWidgetView positioned:NSWindowAbove relativeTo:nil];

customWidgetView->show();

Before initializing QApplication, Qt::AA_PluginApplication is set. I also tried it with QMacNativeWidget as it is described here​ but the behaviour is the same. I am using this approach because it scales the widget 1:1 to the panel. I also tried catching the QKeyEvent but it seems to not even arrive in Qt when it triggers the Adobe Illustrator shortcuts, e.g. inserting a text in the current document instead of inserting it in the currently focused QLIneEdit/QTextEdit.

I am using Qt 5.12.1, Adobe Illustrator SDK 2017, Xcode 7.3.1, macOS 10.13.

Any help is really welcome!

Kind regards,

Sebbo

TOPICS
SDK

Views

343

Likes

Translate

Translate

Report

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

macOS Qt QLineEdit/QTextBox Focus Issue

Community Beginner ,
Mar 05, 2019

Copy link to clipboard

Copied

Hello,

I am currently having an issue with my plugin on macOS using Qt. When selecting a text box (i.e. QLineEdit or QTextEdit) I can enter text but most times (sometimes it works?) I cannot use shortcuts to commands like cut, copy and insert text as it conflicts with the commands of Adobe Illustrator itself. This is my current code in my CustomPlugin::StartupPlugin() function:

customWidget = new CustomWidget();

[panelPlatformWindow setAutoresizesSubviews:YES];

NSView* customWidgetView = (__bridge NSView*)reinterpret_cast<void*>(customWidget->winId());

[customWidgetView setAutoresizingMask:NSViewWidthSizable | NSViewWidthSizable];

[customWidgetView setAutoresizesSubviews:YES];

[panelPlatformWindow setFrame:[customWidgetView frame]];

[panelPlatformWindow addSubview:customWidgetView positioned:NSWindowAbove relativeTo:nil];

customWidgetView->show();

Before initializing QApplication, Qt::AA_PluginApplication is set. I also tried it with QMacNativeWidget as it is described here​ but the behaviour is the same. I am using this approach because it scales the widget 1:1 to the panel. I also tried catching the QKeyEvent but it seems to not even arrive in Qt when it triggers the Adobe Illustrator shortcuts, e.g. inserting a text in the current document instead of inserting it in the currently focused QLIneEdit/QTextEdit.

I am using Qt 5.12.1, Adobe Illustrator SDK 2017, Xcode 7.3.1, macOS 10.13.

Any help is really welcome!

Kind regards,

Sebbo

TOPICS
SDK

Views

344

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mar 05, 2019 0
New Here ,
Oct 02, 2020

Copy link to clipboard

Copied

Hi Sebbo!

Did you get any answer here? I run into the same problem.

Best,

  Paul

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 02, 2020 0