forked from qt-creator/qt-creator
CodeAssist: use shared pointer to pass around proposal models
Task-number: QTCREATORBUG-17752 Change-Id: Ia41f169b86ead209830e6f15764062389ced2b67 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -102,7 +102,7 @@ struct FunctionHintProposalWidgetPrivate
|
||||
|
||||
const QWidget *m_underlyingWidget = nullptr;
|
||||
CodeAssistant *m_assistant = nullptr;
|
||||
IFunctionHintProposalModel *m_model = nullptr;
|
||||
FunctionHintProposalModelPtr m_model;
|
||||
QPointer<Utils::FakeToolTip> m_popupFrame;
|
||||
QLabel *m_numberLabel = nullptr;
|
||||
QLabel *m_hintLabel = nullptr;
|
||||
@@ -161,7 +161,6 @@ FunctionHintProposalWidget::FunctionHintProposalWidget()
|
||||
|
||||
FunctionHintProposalWidget::~FunctionHintProposalWidget()
|
||||
{
|
||||
delete d->m_model;
|
||||
delete d;
|
||||
}
|
||||
|
||||
@@ -181,9 +180,9 @@ void FunctionHintProposalWidget::setUnderlyingWidget(const QWidget *underlyingWi
|
||||
d->m_underlyingWidget = underlyingWidget;
|
||||
}
|
||||
|
||||
void FunctionHintProposalWidget::setModel(IAssistProposalModel *model)
|
||||
void FunctionHintProposalWidget::setModel(ProposalModelPtr model)
|
||||
{
|
||||
d->m_model = static_cast<IFunctionHintProposalModel *>(model);
|
||||
d->m_model = model.staticCast<IFunctionHintProposalModel>();
|
||||
}
|
||||
|
||||
void FunctionHintProposalWidget::setDisplayRect(const QRect &rect)
|
||||
|
||||
Reference in New Issue
Block a user