Add View::isNull()
ViewWrappers don't have ownership of the gui element. The gui element might have been deleted, leaving us with a stale wrapper For impl simply use a QPointer in the QtWidgets and QtQuick backends
This commit is contained in:
@@ -243,7 +243,7 @@ std::shared_ptr<ViewWrapper> ViewWrapper_qtwidgets::parentView() const
|
||||
|
||||
HANDLE ViewWrapper_qtwidgets::handle() const
|
||||
{
|
||||
return reinterpret_cast<HANDLE>(m_widget);
|
||||
return reinterpret_cast<HANDLE>(m_widget.data());
|
||||
}
|
||||
|
||||
void ViewWrapper_qtwidgets::grabMouse()
|
||||
@@ -270,3 +270,8 @@ QString ViewWrapper_qtwidgets::objectName() const
|
||||
{
|
||||
return m_widget->QWidget::objectName();
|
||||
}
|
||||
|
||||
bool ViewWrapper_qtwidgets::isNull() const
|
||||
{
|
||||
return m_widget.data() == nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user