I recently updated my Qt version from 5.12.3
to 5.15.2
. I rebuilt an application that uses a qt virtualkeyboard in QML using InputPanel {}
. The virtual keyboard is defined in main as qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
. Everything works in release mode but when I run in debug mode I get the following application output from qt creator:
Program: C:\Qt\5.15.2\msvc2019_64\bin\Qt5Cored.dll
Module: 5.15.2
File: qvirtualkeyboardinputcontext_p.cpp
Line: 221
ASSERT: "!this->inputPanel" in file qvirtualkeyboardinputcontext_p.cpp, line 221
I inspected the source file on Github for 5.15.2 and the line number points to method void QVirtualKeyboardInputContextPrivate::registerInputPanel(QObject *inputPanel)
with Q_ASSERT(!this->inputPanel);
. I wanted to compare this method with Github for 5.12.3 but it looks like this method was added after 5.12.3
hence why I didn't see the error before.
Now, my understanding is that Q_ASSERT(bool)
will call qFatal()
when the flag is false. If inputPanel
is of type QObject*
should the Q_ASSERT be Q_ASSERT(this->inputPanel)
? The Q_ASSERT should only trigger when the pointer is a nullptr. Or maybe I'm just confused?