Skip to content

Commit b53025d

Browse files
Andrii BoichukAndrii Boichuk
authored andcommitted
Fix seek command for quick2
1 parent 134daac commit b53025d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/webdriver/extension_qt/quick2_view_executor.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,10 +952,15 @@ void Quick2ViewCmdExecutor::SetPlayingPosition(const ElementId &element, double
952952
if (NULL == pItem)
953953
return;
954954

955-
QVariant positionVariant((int)(position * 1000));
956-
bool isPropertyAssigned = pItem->setProperty("position", positionVariant);
957955

958-
if(!isPropertyAssigned){
956+
double currentPosition = 0;
957+
GetPlayingPosition(element, &currentPosition, error);
958+
if(error)
959+
return;
960+
int positionOffset = (int)((position - currentPosition) * 1000);
961+
bool isMethodCalled = QMetaObject::invokeMethod(pItem,"seek", Q_ARG(int, positionOffset));
962+
963+
if(!isMethodCalled){
959964
(*error) = new Error(kUnknownError,
960965
std::string("Error while executing comand: There is no such member or the parameters did not match"));
961966
}

0 commit comments

Comments
 (0)