qtquick: Implement ViewWrapper::objectName()
This commit is contained in:
@@ -194,7 +194,7 @@ void ViewWrapper_qtquick::setFocus(Qt::FocusReason)
|
||||
|
||||
QString ViewWrapper_qtquick::objectName() const
|
||||
{
|
||||
return {};
|
||||
return m_item->objectName();
|
||||
}
|
||||
|
||||
QVariant ViewWrapper_qtquick::property(const char *) const
|
||||
|
||||
@@ -43,4 +43,14 @@ TEST_CASE("View::setParent")
|
||||
|
||||
delete r;
|
||||
delete r2;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("View::objectName")
|
||||
{
|
||||
auto rootView = Platform::instance()->tests_createView({})->asWrapper();
|
||||
|
||||
CHECK_EQ(rootView->objectName(), QString());
|
||||
const QString newName = QStringLiteral("name1");
|
||||
rootView->setObjectName(newName);
|
||||
CHECK_EQ(rootView->objectName(), newName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user