25 #include <QAbstractTableModel>
26 #include <IceGrid/Admin.h>
34 public QAbstractTableModel
57 int rowCount(
const QModelIndex& parent = QModelIndex())
const override
63 int columnCount(
const QModelIndex& parent = QModelIndex())
const override
69 QVariant
data(
const QModelIndex&
index,
int role = Qt::DisplayRole)
const override
81 if (role == Qt::DisplayRole)
85 switch (
index.column())
95 case IceGrid::Inactive:
96 return QString(
"Inactive");
99 case IceGrid::Activating:
100 return QString(
"Activating");
103 case IceGrid::ActivationTimedOut:
104 return QString(
"ActivationTimedOut");
107 case IceGrid::Active:
108 return QString(
"Active");
111 case IceGrid::Deactivating:
112 return QString(
"Deactivating");
115 case IceGrid::Destroying:
116 return QString(
"Destroying");
119 case IceGrid::Destroyed:
120 return QString(
"Destroyed");
134 else if (role == Qt::CheckStateRole)
138 return (
serverInfo.at(
index.row()).enabled) ? Qt::Checked : Qt::Unchecked;
141 else if (role == Qt::BackgroundRole)
145 else if (role == Qt::EditRole)
147 return (
index.column() == 0);
156 if (role != Qt::DisplayRole)
161 if (orientation == Qt::Horizontal)
166 return QString(
"Enabled");
170 return QString(
"ID");
174 return QString(
"Status");
178 return QString(
"PID");
193 return (
index.column() ==
eServerInfo_Enabled) ? Qt::ItemFlags(Qt::ItemIsEnabled | Qt::ItemIsUserCheckable) : Qt::ItemFlags(Qt::ItemIsEnabled);
211 bool setData(IceGrid::ServerDynamicInfoSeq newInfo)