Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
ItemMarketViewModel Class Reference

The left-list VIEW of ItemMarketModel – the Buy or Sell slice. More...

#include <itemmarketviewmodel.h>

Inheritance diagram for ItemMarketViewModel:
Collaboration diagram for ItemMarketViewModel:

Public Member Functions

 ItemMarketViewModel (ItemMarketModel *source, QObject *parent=nullptr)

Protected Member Functions

bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override

Detailed Description

The left-list VIEW of ItemMarketModel – the Buy or Sell slice.

The unified market list holds BOTH the sell rows (your items) and the buy rows (the store) at once – one single-currency cart spanning both. The Buy/Sell strip only chooses which slice the left list shows; it must NOT rebuild or clear the cart. This proxy does that slicing: it accepts source rows whose viewTag matches the model's current isBuyMode (ViewBuy vs ViewSell), and re-filters live when the strip toggles. In Exchange mode the source is the separate exchange list, shown wholesale. The receipt reads the cart across both slices via ItemMarketCartModel.

Exposed as brg.marketViewModel; the left ListView binds to it. Roles pass through from the source unchanged.

See also
ItemMarketModel, ItemMarketCartModel.

Definition at line 37 of file itemmarketviewmodel.h.

Constructor & Destructor Documentation

◆ ItemMarketViewModel()

ItemMarketViewModel::ItemMarketViewModel ( ItemMarketModel * source,
QObject * parent = nullptr )
explicit

Definition at line 25 of file itemmarketviewmodel.cpp.

Member Function Documentation

◆ filterAcceptsRow()

bool ItemMarketViewModel::filterAcceptsRow ( int sourceRow,
const QModelIndex & sourceParent ) const
overrideprotected

The documentation for this class was generated from the following files: