public override uint Flags(Qyoto.QModelIndex index) { if (index.Column() == 0) { return (uint)Qt.ItemFlag.ItemIsUserCheckable | (uint)Qt.ItemFlag.ItemIsSelectable | (uint)Qt.ItemFlag.ItemIsEnabled; } else { return (uint)Qt.ItemFlag.ItemIsSelectable; } }
public override QVariant Data(Qyoto.QModelIndex index, int role) { Account account = (Account)index.InternalPointer(); if (index.Column() == 0) { if (role == (int)Qt.ItemDataRole.DisplayRole) { return account.Jid.ToString(); } else if (role == (int)Qt.ItemDataRole.CheckStateRole) { return (int)Qt.CheckState.Checked; } } else if (index.Column() == 1) { if (role == (int)Qt.ItemDataRole.DisplayRole) { return account.ConnectionState.ToString(); } } return new QVariant(); }