File indexing completed on 2024-12-22 03:46:49

0001 /*
0002   This file is part of the KTextTemplate library
0003 
0004   SPDX-FileCopyrightText: 2010 Stephen Kelly <steveire@gmail.com>
0005 
0006   SPDX-License-Identifier: LGPL-2.1-or-later
0007 
0008 */
0009 
0010 #include "methodmodel.h"
0011 
0012 MethodModel::MethodModel(QObject *parent)
0013     : QStandardItemModel(parent)
0014 {
0015     setHorizontalHeaderLabels(QStringList() << "Access"
0016                                             << "virtual"
0017                                             << "Type"
0018                                             << "Name"
0019                                             << "Const");
0020 }
0021 
0022 ArgsModel::ArgsModel(QObject *parent)
0023     : QSortFilterProxyModel(parent)
0024 {
0025 }
0026 
0027 QVariant ArgsModel::headerData(int section, Qt::Orientation orientation, int role) const
0028 {
0029     if (role == Qt::DisplayRole && orientation == Qt::Horizontal) {
0030         switch (section) {
0031         case 0:
0032             return "Type";
0033         case 1:
0034             return "Name";
0035         case 2:
0036             return "Default";
0037         }
0038     }
0039     return QSortFilterProxyModel::headerData(section, orientation, role);
0040 }
0041 
0042 #include "moc_methodmodel.cpp"