forked from qt-creator/qt-creator
TextEditor: fix crash while request follow symbol and typing on mac
Use a qobject_cast to prevent accessing a not available function. Task-number: QTCREATORBUG-20910 Change-Id: If2aa6b7b120379681e9590db80904c45a6d9bd55 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -40,6 +40,7 @@ namespace CppTools {
|
||||
|
||||
class CPPTOOLS_EXPORT VirtualFunctionAssistProvider : public TextEditor::IAssistProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VirtualFunctionAssistProvider();
|
||||
|
||||
|
@@ -512,7 +512,7 @@ bool CodeAssistantPrivate::isDestroyEvent(int key, const QString &keyText)
|
||||
{
|
||||
if (keyText.isEmpty())
|
||||
return key != Qt::LeftArrow && key != Qt::RightArrow && key != Qt::Key_Shift;
|
||||
else if (auto *provider = dynamic_cast<CompletionAssistProvider *>(m_requestProvider))
|
||||
if (auto *provider = qobject_cast<CompletionAssistProvider *>(m_requestProvider))
|
||||
return !provider->isContinuationChar(keyText.at(0));
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user