qt-ruby and custom widgets on QGraphicsScene - ruby

Im using qt-ruby and i want to add an Widget to the QGraphicsScene, using addWidget().
In return, I get an QGraphicsProxyWidget.
Later, when the user clicks the GraphicsScene, use itemAt() to find the Widget that was clicked. But itemAt() returns an QGraphicsItem.
How can i match the QGraphicsProxyWidget to the QGraphicsItem?
I solved this problem in C++ using qgraphicsitem_cast, but that seems to be unavailable in qt-ruby.
Please help!

Related

TrustPilot Slider widget data-template-id

Where can I get the data-template-ids for the TrustPilot widgets available?
https://assets.ctfassets.net/b7g9mrbfayuu/4HuCkQtie4gGkwgWGIiou0/53edaddeee043cc10cccfcd21dea24ff/TrustBox_Cutsheet_20_08_2018.pdf
I am particularly looking for the data-template-id for the slider widget.
Found the data-template-id for slider finally - 54ad5defc6454f065c28af8b
For anyone getting the console error: "Uncaught No templateId supplied for TrustBox", check that the container/div you added for the widget doesnt have a class of "trustpilot-widget". Once I changed that the widget was showing again.

xamarin forms webview.eval return type is voide . How to retrieve user input data?

I am working on xamarin.forms. I have a content page which contains one webview which load 3rd party url(www.xyz.com) site and one button in shell.
On button click event I am trying to get user input data using
webview.eval(javascript: var data = document.getElementById('first-name').value;alert(data)).
It works fine but due to void return type I could not store data in local variable and I have a customrender(webviewrender) but don't know on shell button click event how can I get userinput data from webview
Please suggest me how do I achieve this functionality.I do not want XLab-Hybridwebview.
You'll probably need to have the JavaScript code call out to the external code when the result is available. You could then wrap that whole process in a TaskCompletionSource to make everything nice and easy to use.

Testing autocomplete textview using espresso tool

I have an autocomplete textview and I am setting an Adapter view on it to show the list of suggestions. While testing on espresso, I want to select an item position from list of suggestions but, it does not identify the auto complete text view adapter on espresso.
I tried this answer from Stack overflow:
DropDown value selection using espresso android with dynamic element id's
But, this did not work for me. Any help on this would be great.
Thanks.
or you can try instead onData. Because onData not working for me
onView(withText("Your field name"))
.inRoot(withDecorView(not(is(getActivity().getWindow().getDecorView()))))
.perform(click());
I run into the same problem and this is how i did it:
onView(withId(R.id.sp_country/*auto complete textview*/)).perform(click());
onData(allOf(is(instanceOf(String.class)), is(COUNTRY/*selected value autocomplete collection*/)))
.inRoot(RootMatchers.withDecorView(not(is(activityActivityTestRule
.getActivity().getWindow().getDecorView()))))
.perform(click());

clicking on particular link without using qtp function

Can anybody help me out clicking on particular static link on webpage without using QTP function?
I tried using WebLink after browse.page.WebLink then operation.
Not sure the reason you don't want to use QTP's click function, but you can try to hit the object at the DOM level with Browser().Page().Link().object.click (which really is the same as the B.P.L.Click method but at a lower level).

MvvmCross : databinding programmatically

I think I need to bind data programmatically to solve my problem.
I use a TabHost which hosts 2 Tabs.
I need to load the MvxBindableListView in the second tab when TabHost appears and keep the first tab as default tab.
What I'm doing is starting the second tab activity without problem because I check the process using this code:
protected override void OnViewModelSet()
{
SetContentView(Resource.Layout.Page_ActivityView);
System.Diagnostics.Debug.WriteLine("activityView started");
MvxBindableListView mvxBindableListView = FindViewById<MvxBindableListView>(Resource.Id.mvxBindableListView);
mvxBindableListView.ChildViewAdded += new System.EventHandler<Android.Views.ViewGroup.ChildViewAddedEventArgs>(mvxBindableListView_ChildViewAdded);
}
"activityView started" is displayed in output debugger, but MvxBindableListView.ChildViewAdded event isn't raised, only when I click the second tab.
So I suppose that MvxBindableListView is not databound.
Thanks in advance to help me loading my second tab programmatically.
I think ChildViewAdded is an event that occurs when the ListView is rendered - at that time when it needs to 'draw list items', then it will ask its adapter for child Views for the screen. As you scroll down the list, it will then ask for more child views - but it will also reuse views - so for a simple list you should only ever (hopefully) get N+1 calls on ChildViewAdded for a list which shows N items at one time.
So it's perfectly possible for a list to be databound but never to call ChildViewAdded - that won't get called until the list is 'drawn'
Sadly the Xamarin docs aren't helpful here - http://docs.mono-android.net/monodoc.ashx?link=E%3AAndroid.Views.ViewGroup.ChildViewAdded
Note: if you do actually want to bind programatically, then you can do this to - using Bind() methods and extension methods. However, I haven't expanded on that here - as it doesn't sound like that's actually what you need!

Resources