No announcement yet.

Any example of ListView widget?

  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    It's pretty straightforward to make...
    Good examples are from


    Check for SAssetListView

    return SNew(SAssetListView)
    .SelectionMode( SelectionMode )
    .OnGenerateRow(this, &SAssetView::MakeListViewWidget)
    .OnItemScrolledIntoView(this, &SAssetView::ItemScrolledIntoView)
    .OnContextMenuOpening(this, &SAssetView::OnGetContextMenuContent)
    .OnMouseButtonDoubleClick(this, &SAssetView::OnListMouseButtonDoubleClick)
    .OnSelectionChanged(this, &SAssetView::AssetSelectionChanged)
    .ItemHeight(this, &SAssetView::GetListViewItemHeight);

    Some details

    -ListItemsSource obtains the array of Assets (in this case already filtered)
    - OnGenerateRow is called to generate a TSharedRef which is the view that will be displayed on the ListView
    - ItemHeight sets the height, it's a slate attribute, so you can set up a constant
    - OnContextMenuOpening is called when you right click, you can make a context menu here (default does nothing).

    All others are not mandatory, but OnSelectionChanged is used when you click on the listview

    There are more examples there, check it out

    Leave a comment:

  • replied
    I also couldn't find any info on how to do it

    Leave a comment:

  • started a topic Any example of ListView widget?

    Any example of ListView widget?

    cant found any docs and example about it