Which is the right way to implement to show emp data on qml
-
Hi,
I have emp data in model. (name, age, manger,grade).
I want to show this information in GUI like rows wise. When model added/deleted new emp, should get update on gui. And, sorting also required when click on particular field.
GridView or ListView.
Any suggestions are welcome.
Thanks.
-
What is emp ? You should be clear when asking a question.
I think a more suitable option would be to use TableView. -
TreeView is not yet implemented in QML. Did you check TableView ?
-
Hi p3c0,
I thought TableView only. But, I mistakenly mentioned TreeView.
I had gone through http://qt-project.org/doc/qt-5/qml-qtquick-controls-tableview.html#details. But, I didn't find information about how to customize view with TreeView.
I have to display in customized view for row(TableView Element on GUI). The row view is with white background, no seperators, have to add other qml gui elements.
Any inputs?
Thanks.
-
Check "this":http://qt-project.org/doc/qt-5/qtquickcontrols-tableview-example.html example. It displays Rows, SortIndicator, Headers etc..
You can use delegates to customize rows. -
Thank you. I understand that example.
I don't want to show standard tableview.
I have created a component which will have labels, checkboxes, button, busyindicator. This is equal to one TableViewElement (employeename, age, manager, grade, workingstatus). These controls mapped to model data.
I want to show these components on GUI.
@empname age manger grade busyindicator button checkbox
Row1 --> Loader(Component with Row1 Details) --> this is customized view
Row2 --> Loader(Component with Row2 Details) --> this is customized view
Row1 --> Loader(Component with Row3 Details) --> this is customized view
Row1 --> Loader(Component with Row4 Details) --> this is customized view@
Can I achieve this with TableView?
-
I think yes. Set a custom delegate using "itemDelegate":http://qt-project.org/doc/qt-5/qml-qtquick-controls-tableview.html#itemDelegate-prop