refactor: replace raw object pointers with SmartPointer in ObjectsContext and update dependent codebases
This commit is contained in:
@@ -426,15 +426,15 @@ void ReferencePropertyWidget::refreshCombo() {
|
||||
|
||||
if (m_Context) {
|
||||
const auto& objects = m_Context->GetObjects();
|
||||
for (auto* obj : objects) {
|
||||
if (m_RefProp->IsCompatible(obj)) {
|
||||
for (const auto& obj : objects) {
|
||||
if (m_RefProp->IsCompatible(obj.get())) {
|
||||
QString label = QString::fromStdString(obj->GetInstanceName());
|
||||
if (label.isEmpty()) {
|
||||
label = QString::fromStdString(std::string(obj->GetClassName()));
|
||||
}
|
||||
// Add index suffix if name is empty to disambiguate
|
||||
m_Combo->addItem(label, QVariant::fromValue((quintptr)obj));
|
||||
if (obj == currentRef) {
|
||||
m_Combo->addItem(label, QVariant::fromValue((quintptr)obj.get()));
|
||||
if (obj.get() == currentRef) {
|
||||
selectedIdx = m_Combo->count() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user