Qt delegate activating

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Elena_v
Posts: 18
Joined: Tue Jun 25, 2019 4:27 pm

Qt delegate activating

Post by Elena_v » Wed Dec 22, 2021 1:20 pm

Any ideas how to activate an QAbstractItemDelegate? I have in Spy TreeItem with Cell. In Qt it is an QAbstractItemDelegate, that under DoubleClick() open a QLineEdit for using. How to activate this QLineEdit without DoubleClick()? Something like myCell.As<QAbstractItemDelegate>().Edit....
P.s.: I don't use Qt legacy (plugin) and don't want to rewrite all my repos :)

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

Re: Qt delegate activating

Post by odklizec » Wed Dec 22, 2021 4:02 pm

Hi,

Could you please upload a Ranorex snapshot (NOT screenshot) of the element in question? Also, if you right click the problematic element in spy, check the available (perform) actions at bottom of the spy context menu.
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

Elena_v
Posts: 18
Joined: Tue Jun 25, 2019 4:27 pm

Re: Qt delegate activating

Post by Elena_v » Mon Dec 27, 2021 2:12 pm

Unfortunately, there's too much information stored in the snapshot. I can only send you a screenshot :)
You do not have the required permissions to view the files attached to this post.

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

Re: Qt delegate activating

Post by odklizec » Mon Dec 27, 2021 2:39 pm

Hi,

As mentioned before, screenshot is useless. Have you tried to right click the cell in Spy? Are there some actions at bottom of the context menu?
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

Elena_v
Posts: 18
Joined: Tue Jun 25, 2019 4:27 pm

Re: Qt delegate activating

Post by Elena_v » Mon Dec 27, 2021 6:13 pm

Thx, I know how to make a snapshot. But I have written above that it has a lot of info that I don't want to show. I described above what the element is.
I'm not even interested in this element (cell), but rather in opportunities of Ranorex +Qt in principle. I can't find any useful articles (internet) about using Ranorex for Qt test automation (incl. properties (Q_PROPERTY) and functions of Qt). But I can see that, for example, Squish (Froglogic) is developing more in this direction than Ranorex. I've been working with Ranorex for a long time. And I don't see much development with Qt...

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

Re: Qt delegate activating

Post by odklizec » Tue Dec 28, 2021 9:34 am

Hi,

Well the thing is, that Squish is a QT-based tool. So it may have somewhat better or advanced support for QT-based apps. I've tried it in the past and to be quite honest, it's no match to Ranorex Studio easiness and fast learning progress. Not to mention superb support of other UIs and technologies. And they still don't have a reasonable support forum! Even in 2021, they rely on an obsolete mailing lists :shock: I can't imagine working with a test automation tool without something that essential as community forum?

Anyway, to answer your question, Ranorex primarily interacts with apps using mouse and keyboard-based actions. However, there is also something called Invoke Actions. https://www.ranorex.com/help/latest/ran ... g-actions/
And this is why I asked for the list of actions, usually available at bottom of the Spy context menu. Simply right click the cell you are interested in (in Spy tree) and see the actions at bottom of the menu.
InvokeActions.png
You can use these via "Invoke Action" Ranorex action. Of course, the list of available actions depends on the app under test implementation. If there are no or very few actions available, then the app simply does not implement these actions and Ranorex cannot interact with the app this way.
You do not have the required permissions to view the files attached to this post.
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

Elena_v
Posts: 18
Joined: Tue Jun 25, 2019 4:27 pm

Re: Qt delegate activating

Post by Elena_v » Tue Dec 28, 2021 12:38 pm

Thank for you help! I appreciate it.
I tried:

Code: Select all

  Configuration.Current["plugins.qt.legacymode"] = true;  
then I have the following:
1) I see in Ranorex Spy in Advanced Properties:

Code: Select all

 UIAutomationValueIsReadOnly = false && UIAutomationValueValue = $value
I can edit $value in Spy, but don't know how to do it in code (*.cs).
2) If right-click on an item in Spy then I have UIAutomationInvokeInvoke(UIAutomationinvoke). If I call this method, nothing happens :D
3) Also, I see in code .InvokeAction(), but where I can find a list with aviable Invoke Actions for current TreeItem?

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

Re: Qt delegate activating

Post by odklizec » Tue Dec 28, 2021 1:07 pm

Hi,

As I mentioned, the list of available actions can be found at bottom of the context menu in Spy. Also, I would suggest you to check this post, where you can find some screenshots about Invoke Action usage.
viewtopic.php?f=16&t=12324&p=49511
If you are not sure how to use InvokeAction in code, the best way is to use InvokeAction in recording module and then convert the recording action to user code. This way you can learn how to use it in code.
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

Elena_v
Posts: 18
Joined: Tue Jun 25, 2019 4:27 pm

Re: Qt delegate activating

Post by Elena_v » Tue Dec 28, 2021 10:22 pm

Thank you very much for your help!