TextAutoGenerateTextMcpProtocolCore::McpServerModel Class
The McpServerModel class Author: Laurent Montel <montel@kde.org>. More...
| Header: | #include <TextAutoGenerateTextMcpProtocolCore/McpServerModel> |
| CMake: | find_package(KF6TextAutoGenerateTextMcpProtocolCore REQUIRED)target_link_libraries(mytarget PRIVATE KF6::TextAutoGenerateTextMcpProtocolCore) |
| Inherits: | QAbstractListModel |
Public Functions
| McpServerModel(QObject *parent = nullptr) | |
| virtual | ~McpServerModel() override |
| void | addMcpServer(const TextAutoGenerateTextMcpProtocolCore::McpServer &instance) |
| void | editMcpServer(const TextAutoGenerateTextMcpProtocolCore::McpServer &server) |
| bool | hasEnabledServer() const |
| TextAutoGenerateTextMcpProtocolCore::McpServer | mcpServer(const QByteArray &identifier) const |
| QList<TextAutoGenerateTextMcpProtocolCore::McpServer> | mcpServers() const |
| void | removeMcpServer(const QByteArray &identifier) |
| void | setMcpServers(QList<TextAutoGenerateTextMcpProtocolCore::McpServer> newServers) |
Reimplemented Public Functions
| virtual QVariant | data(const QModelIndex &index, int role) const override |
| virtual Qt::ItemFlags | flags(const QModelIndex &index) const override |
| virtual int | rowCount(const QModelIndex & = {}) const override |
| virtual bool | setData(const QModelIndex &index, const QVariant &value, int role) override |
Detailed Description
Member Function Documentation
[explicit] McpServerModel::McpServerModel(QObject *parent = nullptr)
Constructs a new McpServerModel object. parent The parent QObject
[override virtual noexcept] McpServerModel::~McpServerModel()
Destroys the McpServerModel object.
void McpServerModel::addMcpServer(const TextAutoGenerateTextMcpProtocolCore::McpServer &instance)
Adds an instance to the model. instance The instance to add
[override virtual] QVariant McpServerModel::data(const QModelIndex &index, int role) const
Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.
Returns the data at the given index for the specified role. index The model index role The data role Returns The data value
See also setData().
void McpServerModel::editMcpServer(const TextAutoGenerateTextMcpProtocolCore::McpServer &server)
editMcpServer server
[override virtual] Qt::ItemFlags McpServerModel::flags(const QModelIndex &index) const
Reimplements: QAbstractListModel::flags(const QModelIndex &index) const.
Returns the flags for the given index. index The model index Returns The item flags
bool McpServerModel::hasEnabledServer() const
Returns whether the model contains at least one enabled server. Returns true if a server is enabled, false otherwise
TextAutoGenerateTextMcpProtocolCore::McpServer McpServerModel::mcpServer(const QByteArray &identifier) const
mcpServer identifier Returns
QList<TextAutoGenerateTextMcpProtocolCore::McpServer> McpServerModel::mcpServers() const
Returns the list of mcp servers in the model. Returns The list of TextAutoGenerateTextMcpServer pointers
See also setMcpServers().
void McpServerModel::removeMcpServer(const QByteArray &identifier)
removeMcpServer identifier
[override virtual] int McpServerModel::rowCount(const QModelIndex & = {}) const
Reimplements: QAbstractItemModel::rowCount(const QModelIndex &parent) const.
Returns the number of rows in the model. Returns The row count
[override virtual] bool McpServerModel::setData(const QModelIndex &index, const QVariant &value, int role)
Reimplements: QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value, int role).
Sets the data at the given index for the specified role. index The model index value The value to set role The data role Returns true if successful, false otherwise
See also data().
void McpServerModel::setMcpServers(QList<TextAutoGenerateTextMcpProtocolCore::McpServer> newServers)
Sets the list of mcp servers in the model. newServers The servers to set
See also mcpServers().