Files
86Box/src/qt/qt_models_common.cpp

33 lines
857 B
C++
Raw Normal View History

2022-02-07 15:00:02 +06:00
/*
2023-01-06 15:36:05 -05:00
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
2022-02-07 15:00:02 +06:00
*
2023-01-06 15:36:05 -05:00
* This file is part of the 86Box distribution.
2022-02-07 15:00:02 +06:00
*
2023-01-06 15:36:05 -05:00
* Common storage devices module.
2022-02-07 15:00:02 +06:00
*
*
*
2023-01-06 15:36:05 -05:00
* Authors: Joakim L. Gilje <jgilje@jgilje.net>
2022-02-07 15:00:02 +06:00
*
2023-01-06 15:36:05 -05:00
* Copyright 2021 Joakim L. Gilje
2022-02-07 15:00:02 +06:00
*/
2021-11-25 10:20:56 +01:00
#include "qt_models_common.hpp"
#include <QAbstractItemModel>
2022-11-19 08:49:04 -05:00
int
Models::AddEntry(QAbstractItemModel *model, const QString &displayRole, int userRole)
2021-11-25 10:20:56 +01:00
{
int row = model->rowCount();
model->insertRow(row);
auto idx = model->index(row, 0);
model->setData(idx, displayRole, Qt::DisplayRole);
model->setData(idx, userRole, Qt::UserRole);
return row;
}