The ThreadList class provides a model for the chat threads.
More...
#include <thread_list.h>
|
| ThreadList (QObject *parent=nullptr) |
| Constructs a new ThreadList object.
|
|
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of rows under the given parent.
|
|
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Returns the data stored under the given role for the item referred to by the index.
|
|
QHash< int, QByteArray > | roleNames () const override |
| Returns the role names for the model.
|
|
const QList< Thread * > & | threads () const |
| Returns the list of threads.
|
|
Thread * | getThread (const QModelIndex &model_index) |
| Returns the thread at the given index.
|
|
Thread * | createNewThread () |
| Creates a new thread.
|
|
void | deleteThread (const QModelIndex &model_index) |
| Removes the thread at the given index.
|
|
void | deleteAllThreads () |
| Removes all the threads.
|
|
The ThreadList class provides a model for the chat threads.
◆ ThreadRoles
The data roles for the model.
Enumerator |
---|
TextRole | |
CreatedAtRole | |
◆ ThreadList()
llm_chat::ThreadList::ThreadList |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
◆ createNewThread()
Thread * llm_chat::ThreadList::createNewThread |
( |
| ) |
|
Creates a new thread.
This function creates a new thread and sets it as the active thread.
◆ data()
QVariant llm_chat::ThreadList::data |
( |
const QModelIndex & | index, |
|
|
int | role = Qt::DisplayRole ) const |
|
nodiscardoverride |
Returns the data stored under the given role for the item referred to by the index.
- Parameters
-
index | The model index. |
role | The data role. |
◆ deleteAllThreads()
void llm_chat::ThreadList::deleteAllThreads |
( |
| ) |
|
◆ deleteThread()
void llm_chat::ThreadList::deleteThread |
( |
const QModelIndex & | model_index | ) |
|
Removes the thread at the given index.
- Parameters
-
model_index | The index of the thread to remove. |
◆ getThread()
Thread * llm_chat::ThreadList::getThread |
( |
const QModelIndex & | model_index | ) |
|
|
nodiscard |
Returns the thread at the given index.
- Parameters
-
model_index | The index of the thread. |
- Returns
- The thread at the given index.
◆ roleNames()
QHash< int, QByteArray > llm_chat::ThreadList::roleNames |
( |
| ) |
const |
|
nodiscardoverride |
Returns the role names for the model.
- Returns
- The role names for the model.
◆ rowCount()
int llm_chat::ThreadList::rowCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
nodiscardoverride |
Returns the number of rows under the given parent.
- Parameters
-
◆ threads()
const QList< Thread * > & llm_chat::ThreadList::threads |
( |
| ) |
const |
|
inlinenodiscard |
Returns the list of threads.
- Returns
- The list of threads.
◆ threads
QList<Thread *> llm_chat::ThreadList::threads |
|
read |
The documentation for this class was generated from the following files: