[Interest] Qt at iOS: Crash on null QWindow pointer in QIOSInputContext::scrollToCursor

Gustavsen Richard Richard.Gustavsen at theqtcompany.com
Tue Nov 10 11:26:17 CET 2015


Hi!

If it's the cut/copy/paste actions you mean, it's problematic to remove them fully, since we don't really know if the application needs them or not. If we did, then support for e.g cmd-c on a bluetooth keyboard (or copy button on the virtual keyboard), would be removed as well.

But after https://codereview.qt-project.org/#/c/124596/ we check if the application adds any actions with short-cut bindings to QKeySequence::StandardKey explicit (e.g QKeySequence::Copy). If so, we link the action directly to the corresponding native iOS menu item, including the button / shortcut on the keyboard.

-Richard

________________________________________
Fra: Robert Iakobashvili <coroberti at gmail.com>
Sendt: 10. november 2015 09:43
Til: Gustavsen Richard; interest at qt-project.org
Emne: Re: [Interest] Qt at iOS: Crash on null QWindow pointer in QIOSInputContext::scrollToCursor

Hi Richard,

I was using 5.4.2, and I see that it was fixed for 5.5

Unfortunately, in Qt-5.5  QPlatformMenu adds Apple's standard
MenuItems prior to my custom item, so I cannot
make my custom Editing Menu without Apple's standard;
this is the reason to continue with 5.4

Can we get rid from Apple's Menu Items in QPlatformMenu with Qt-5.5.1?
Thanks!

Regards,
Robert


On Tue, Nov 10, 2015 at 10:27 AM, Gustavsen Richard
<Richard.Gustavsen at theqtcompany.com> wrote:
> Which version on Qt are you using? It looks like this was fixed in 5.5:
>
> https://codereview.qt-project.org/#/c/109592/
>
>
> -Richard
>
>
> ________________________________
> Fra: Interest <interest-bounces at qt-project.org> på vegne av Robert
> Iakobashvili <coroberti at gmail.com>
> Sendt: 10. november 2015 06:49
> Til: interest at qt-project.org
> Emne: [Interest] Qt at iOS: Crash on null QWindow pointer in
> QIOSInputContext::scrollToCursor
>
> Gentlemen,
> My app was crashing on a null QWindow pointer
> from focusView() in QIOSInputContext::scrollToCursor
>
> Unfortunately, my attempt to create a reproducing example
> failed; thus, a formal bug-report is not an option.
>
> The scenario is:
> sending an email from a native popover over a Qt-widget app,
> it was crashing on appearance of
> Apple's Mail window.
>
> It could be work-arounded by checking the result of
> focusView() call prior to using it and not assuming that
> it for sure contains a valid QWindow:
>
> --- qiosinputcontext.mm.orig    2015-11-02 14:39:50.000000000 +0200
> +++ qiosinputcontext.mm    2015-11-02 14:45:43.000000000 +0200
> @@ -456,7 +456,10 @@
>
>      const int margin = 20;
>      QRectF translatedCursorPos = qApp->inputMethod()->cursorRectangle();
> -
> translatedCursorPos.translate(focusView().qwindow->geometry().topLeft());
> +    QWindow* qw = focusView().qwindow;
> +    if (! qw)
> +    return;
> +    translatedCursorPos.translate(qw->geometry().topLeft());
>
>      qreal keyboardY = [rootView convertRect:m_keyboardState.keyboardEndRect
> fromView:nil].origin.y;
>      int statusBarY = qGuiApp->primaryScreen()->availableGeometry().y();
>
>
> Hope, it helps to somebody.
>
> Take care,
>
> Regards,
> Robert


More information about the Interest mailing list