Skip to content

Commit

Permalink
Fix crash in completion popup constructor (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanoHao authored Dec 5, 2024
1 parent 8591c23 commit b53742c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion RedPandaIDE/widgets/codecompletionpopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ CodeCompletionPopup::CodeCompletionPopup(QWidget *parent) :
QWidget(parent),
mMutex()
{
setWindowFlags(Qt::Popup);
mListView = new CodeCompletionListView(this);
mModel=new CodeCompletionListModel(&mCompletionStatementList);
mDelegate = new CodeCompletionListItemDelegate(mModel,this);
Expand All @@ -58,6 +57,9 @@ CodeCompletionPopup::CodeCompletionPopup(QWidget *parent) :

mHideSymbolsStartWithTwoUnderline = false;
mHideSymbolsStartWithUnderline = false;

// may trigger font change event, place it after member initialization
setWindowFlags(Qt::Popup);
}

CodeCompletionPopup::~CodeCompletionPopup()
Expand Down
4 changes: 3 additions & 1 deletion RedPandaIDE/widgets/headercompletionpopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

HeaderCompletionPopup::HeaderCompletionPopup(QWidget* parent):QWidget(parent)
{
setWindowFlags(Qt::Popup);
mListView = new CodeCompletionListView(this);
mModel=new HeaderCompletionListModel(&mCompletionList, 0);
QItemSelectionModel *m=mListView->selectionModel();
Expand All @@ -47,6 +46,9 @@ HeaderCompletionPopup::HeaderCompletionPopup(QWidget* parent):QWidget(parent)
mCurrentFile = "";
mPhrase = "";
mIgnoreCase = false;

// may trigger font change event, place it after member initialization
setWindowFlags(Qt::Popup);
}

HeaderCompletionPopup::~HeaderCompletionPopup()
Expand Down

0 comments on commit b53742c

Please sign in to comment.