1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:37:46 +00:00

Ladybird: Allow replacing underlying model of ModelTranslator

This commit is contained in:
MacDue 2022-12-18 00:49:28 +00:00 committed by Andrew Kaster
parent 419dea0996
commit 0313814d3b
2 changed files with 15 additions and 6 deletions

View file

@ -14,9 +14,15 @@ namespace Ladybird {
class ModelTranslator final : public QAbstractItemModel {
Q_OBJECT
public:
explicit ModelTranslator(NonnullRefPtr<GUI::Model>);
virtual ~ModelTranslator() override;
void set_underlying_model(RefPtr<GUI::Model> model)
{
beginResetModel();
m_model = model;
endResetModel();
}
virtual int columnCount(QModelIndex const& parent) const override;
virtual int rowCount(QModelIndex const& parent) const override;
virtual QVariant data(QModelIndex const&, int role) const override;