Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!


OverviewFelgo 2 Support (Qt 5) › How to make a multi-column view with clickable rows and column headers

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #21429


    I have a ListModel I update from LocalStorage, it has a variable amount of columns and rows at run-time, I tried to use TableView, it is a Quick.Controls 1.x, and the 2.0 control is not out yet, and I could not figure out how to make the columns clickable with TableView, and I found examples of how to sort the columns, most use C++ to do this, and I did not want to do that, unless I can find no other way, I just want to be able to update a ListModel as a source to some control that can also list all the columns, and make the cells clickable, I do not need to edit them, but at least click on, so I can run an event, but I need the Header Columns to be clickable, so I can change the Model, which I clear it, and read it in from LocalStorage using Sqlite query, so all the data comes from Sql, but uses ListModel.append to populate the model, so it is doing a sort, without have to actually sort the list view, so I hope that someone has an example of doing something like this, TableView works now, I just cannot figure out how to capture header column clicks with it, if there is a way to use the delegate with an AppButton, that would be nice.

    I posted this as a Qml question, but help yet, this example uses two ListModel’s and a TableView and two push buttons to switch between the Model:

    and here at Qt, I have a lot of unanswered questions at that forum, so I posted it at StackOverflow also.

    Thanks for any help.



    Romha Korev on gave me this answer:

    onSortIndicatorColumnChanged: tableView.model = (sortIndicatorColumn == 0) ? myListModel1 : myListModel2
    onSortIndicatorOrderChanged: tableView.model = (sortIndicatorColumn == 0) ? myListModel1 : myListModel2
Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.