how can I duplicate SwiftUI object - button

in SwiftUI can I see the tree structure of the ui? in the sense, view, button ... if I want to duplicate a button or something else what can I do? thank you .

Related

Update only new data from Firebase in SwiftUI

My question is very complex, and my English is not that well, so please excuse if you don't understand me.
I have a SwiftUI File, which builds for each Item in a folder on my firebase an special Button.
If I touch this Button, it will hide. The problem is, I want that if the SwiftUI File reloads, I want to see only these Buttons which I haven't tapped before. (I want to Store which Buttons are Tapped). The Problem is, each time I reload the SwiftUI File, It'll make new Buttons, which aren't tapped yet.
My Question is now, how can I create only for the new Items in my Folder (on the firebase) an Button. The old once should be displayed too, if they were not tapped.
You can store Bool in Firebase. Just load items which false and when you tap a button you make the value true.

Set enable/disable on menuitem depending on data modification

I am new on java and javafx. I made a simple application on javafx using mvc pattern. This application handles a person table and is structured in this way.
Model containing the persons data
View containing a menu
View containing the tableview of the persons, the detail of the selected person and three buttons (New --> add new person, Edit --> change a person, Delete --> cancel a person
View that allows to change contents of the selected person
All works fine, but I have a problem with the menu. I would like to handle the menuitem 'Save' changing the 'Disable' flag in the way that it set to 'false' or 'true' programmatically, depending on if the user changed the data or not, but I do not know how can pass it from a scene to another.
I have been searching a lot on this web site and on other sites without any result.
I have found a question on stackoverflow called 'Toggle enable/disable on Menuitem javafx from another scene?' that probably could solve my question, but unfortunately I did not understand the solution.
Is there somebody who can help me?
Thank you in advance.
Alberto

Loop over cards in the UI

Is there someone who can tell me how you loop over the contacts in the template "Vendor ratings" please ?
I give you a screenshot of the page. To reproduce, go to the "Contacts" page, add a new contact and see two contacts...
I want to do the same behavior for my application and I don't know how to loop...
When I create a single card with a label binding #datasource.item.name for example, I only have 1 card displayed although in my datasource I have two results...
Thanks a lot for your help.
You are looking for widgets that can render repetitive data: List, Accordion, Grid. You can build prototype row/cell inside such widget, bind it to array of items (datasource) and App Maker's runtime will take care about the rest for you:

Write test case for android listview click

I have Listview which contain multiples items. I like to click on 1st item of listview by using android test cases.
How can achieve this?
Please help me.
Listview hierarchy :-
MainActivity -> ListFragment -> Listview
Try this:
onData(hasToString(startsWith("item_name")))
.inAdapterView(withId(R.id.view_id)).atPosition(0)
.perform(click());
or
onData(hasToString(startsWith("item_name")))
.inAdapterView(withId(R.id.view_id))
.perform(click());
You can mention the position of the adapter view or no need, default it will take first position

Focusing on last data entry on Qtreewidget

I am trying to use Qtreewidget as listview (like in C#) to display some data. As seen on the image below, while new datas displayed during the runtime, the widget doesn't focus on the last entry.That is what I want but couldn't find a method to make it focus on the last entry. In other words, I want it to be scrolled down to the last entry. Is there any way to do it or do I have to use something another to handle this ?
Thanks in advance.
Maybe this code will helps you:
QTreeWidget *mytree = new QTreeWidget(this);
...
mytree->scrollToBottom();

Resources