13 : QAbstractTableModel ( parent ),
14 HeaderList ( Headers )
32 return HeaderList.size();
48 if ( role != Qt::DisplayRole )
53 if ( orientation == Qt::Horizontal )
55 return HeaderList.at ( section );
63 if ( role == Qt::DisplayRole ) {
64 return Data.value(index.row()).value(index.column());
66 if (role == Qt::ForegroundRole) {
67 if (Data.value(index.row()).value(2).contains(
"Active")) {
70 if (Data.value(index.row()).value(1) ==
"RW" ) {
75 if (role == Qt::BackgroundRole) {
76 if (Data.value(index.row()).value(2).contains(
"Active")) {
79 if (Data.value(index.row()).value(1) ==
"RW" ) {
84 if (role == Qt::ToolTipRole) {
85 return Data.value(index.row()).value(0);
93 std::vector<std::string> SchemaFiles;
97 for ( std::string & FileName : SchemaFiles )
100 Row.append ( QString::fromStdString ( FileName ) );
111 std::string Status =
"";
112 if ( Modified.find( FileName ) != std::string::npos) {
115 if ( FileName == ActiveSchema) {
116 if ( !Status.empty() ) {
122 Row.append ( QString::fromStdString ( Status ) );
129 if ( !index.isValid() )
131 return QStringList();
134 return Data.at ( index.row() );
QStringList getRowFromIndex(QModelIndex &index)
QVariant headerData(int section, Qt::Orientation orientation, int role) const
QVariant data(const QModelIndex &index, int role) const
int columnCount(const QModelIndex &parent) const
int rowCount(const QModelIndex &parent) const
CustomFileModel(QStringList &Headers, QObject *parent=nullptr)
Including Schema Editor.
std::string GetActiveSchema() const
static KernelWrapper & GetInstance()
std::string ModifiedSchemaFiles() const
void GetSchemaFiles(std::vector< std::string > &SchemaFiles)
static QColor get_color(const QString &item, const QString &group)