Set SQT Slider Value to a specific value

Class library usage, coding and language questions.
tcalderwood
Posts: 8
Joined: Thu May 05, 2011 10:07 pm

Set SQT Slider Value to a specific value

Post by tcalderwood » Tue Dec 16, 2014 9:13 pm

I have a QT slider control that has a range from 0 to 100. I am looking for a way to change the value of the slider without relying on the mouse clicking on a screen position. For example, I want to set the value to 47. Is there a way to instruct the control to set itself at the value of 47? I tried using an answer from the forum using mouse.move but it has two issues. First, it does not work, the FindChild<Indicator>() function fails saying it cant find the Indicator. Second, it relies on mouse clicking. Any help is greatly appreciated.

Ranorex Version: 4.0.6
QT Version: 5.3.2
Timothy A Calderwood
Senior Engineer
PLEXSYS Interface Products Inc.
4900 NW Camas Meadows Drive
Camas, WA 98607
360.838.2500
360.838.2550 fax

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Set SQT Slider Value to a specific value

Post by krstcs » Tue Dec 16, 2014 10:11 pm

Timothy,

Let me start by saying that I don't test against Qt, so I don't know the exact abilities that Ranorex has in regards to Qt interface elements.

Having said that, there should be a way to set the value of the slider using direct manipulation with the Value property of the element in Ranorex. The problem is that this may not fire any events that are associated with the value being moved. Typically the slider being manipulated fires all of the events (they all listen for the onMove event of the slider). Since you aren't actually firing that event, other event handlers may not fire correctly.


A couple of other things:
1. Are you able to upgrade to the current version of Ranorex? There have been some additions specifically for Qt in 5.2. From the release notes for 5.2.0: "Added native support for Qt Widgets, Qt Quick, Qt WebKit, and Flash embedded in Qt controls". Updating my help with object identification.
2. Could you post a Ranorex Snapshot of your Qt application under test? See this page for information on creating a Ranorex Snapshot. If you can't post it here, you can send it to [email protected]. This will help us see the structure of the application and maybe help figure out what you can do to make it work.
Shortcuts usually aren't...

tcalderwood
Posts: 8
Joined: Thu May 05, 2011 10:07 pm

Re: Set SQT Slider Value to a specific value

Post by tcalderwood » Wed Dec 17, 2014 2:14 am

I just email a snapshot to [email protected] as it was to large to post. I wish we could update to version 5, but first I have to prove that Ranorex will work with our software before I can renew the support contact. I will continue playing around with it and if I come across a solution, I will post it here.

Thanks for your time krstcs....
Timothy A Calderwood
Senior Engineer
PLEXSYS Interface Products Inc.
4900 NW Camas Meadows Drive
Camas, WA 98607
360.838.2500
360.838.2550 fax

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3949
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Set SQT Slider Value to a specific value

Post by odklizec » Wed Dec 17, 2014 8:25 am

Hi,

You can still use the trial version of 5.2 and if you kindly ask, support folks can even extend the trial period for you! It's definitely worry a try.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Set SQT Slider Value to a specific value

Post by Support Team » Tue Dec 30, 2014 9:35 am

Hello guys,

as already discussed via e-mail, please use the value property of the QT slider element in order to change the position of slider.
QT_Slider.png
QT_Slider.png (20.46 KiB) Viewed 1341 times
Regards,
Robert
.
Image