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:
@@ -168,7 +168,7 @@ std::shared_ptr<ViewWrapper> ViewWrapper_qtquick::parentView() const
|
||||
|
||||
HANDLE ViewWrapper_qtquick::handle() const
|
||||
{
|
||||
return reinterpret_cast<HANDLE>(m_item);
|
||||
return reinterpret_cast<HANDLE>(m_item.data());
|
||||
}
|
||||
|
||||
void ViewWrapper_qtquick::grabMouse()
|
||||
@@ -192,3 +192,8 @@ QString ViewWrapper_qtquick::objectName() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
bool ViewWrapper_qtquick::isNull() const
|
||||
{
|
||||
return m_item.data() == nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user