Implemented ViewWrapper::window()

Implementation was missing for qtquick and add a bug for qtwidgets.
This commit is contained in:
Sergio Martins
2022-05-03 20:02:14 +01:00
parent dc9a0145e2
commit 0a1a783054
7 changed files with 43 additions and 9 deletions

View File

@@ -45,6 +45,22 @@ TEST_CASE("ViewWrapper::setParent")
delete r2;
}
TEST_CASE("ViewWrapper::windowHandle,rootView,Window::rootView")
{
auto r = Platform::instance()->tests_createView({});
auto rootView = r->asWrapper();
auto childView = Platform::instance()->tests_createView({ true }, r)->asWrapper();
auto window = rootView->window();
REQUIRE(window);
CHECK_EQ(window->handle(), childView->window()->handle());
CHECK(rootView->rootView()->equals(rootView));
CHECK(childView->rootView()->equals(rootView));
REQUIRE(window->rootView());
CHECK(window->rootView()->equals(rootView));
}
TEST_CASE("ViewWrapper::minSize")
{
const QSize sizeHint = {};