libschauer  0.0.1
Qt based library to access the Docker HTTP API.
Public Types | Public Member Functions | List of all members
Schauer::ContainerListModel Class Reference

List model providing availabel containers. More...

#include <Schauer/ContainerListModel>

Inheritance diagram for Schauer::ContainerListModel:
Inheritance graph
[legend]

Public Types

enum  Roles : int {
  IdRole = Qt::UserRole + 1, NamesRole, ImageRole, ImageIdRole,
  CommandRole, CreatedRole, StateRole, StatusRole,
  LabelsRole, SizeRwRole, SizeRootFsRole
}
 Roles used to access the model data. More...
 
- Public Types inherited from Schauer::AbstractBaseModel
enum  LoadMode : int { LoadAsync, LoadSync }
 Load mode for model. More...
 

Public Member Functions

 ContainerListModel (QObject *parent=nullptr)
 Conctructs a new ContainerListModel with the given parent. More...
 
 ~ContainerListModel () override
 Destrys the ContainerListModel object. More...
 
- Public Member Functions inherited from Schauer::AbstractContainerModel
 AbstractContainerModel (QObject *parent=nullptr)
 Constructs a new AbstractContainerModel object with the given parent. More...
 
 ~AbstractContainerModel () override
 Destroys the AbstractContainerModel object. More...
 
bool contains (const QString &idOrName) const
 Returns true if the model contains a container identified by idOrName. More...
 
bool contains (QLatin1String idOrName) const
 
bool containsImage (const QString &image) const
 Returns true if the model contains a container that is based on image. More...
 
bool containsImage (QLatin1String &image) const
 
bool containsImageId (const QString &imageId) const
 Returns true if the model contains a container that is based on imageId. More...
 
bool containsImageId (QLatin1String &imageId) const
 
void setShowAll (bool showAll)
 Setter function for the showAll property. More...
 
void setShowSize (bool showSize)
 Setter function for the showSize property. More...
 
bool showAll () const
 Getter function for the showAll property. More...
 
bool showSize () const
 Getter function for the showSize property. More...
 
- Public Member Functions inherited from Schauer::AbstractBaseModel
 AbstractBaseModel (QObject *parent=nullptr)
 Constructs a new AbstractBaseModel class with the given parent. More...
 
 ~AbstractBaseModel () override
 Destroys the AbstractBaseModel object. More...
 
AbstractConfigurationconfiguration () const
 Getter function for the configuraion property. More...
 
int error () const
 Returns the error code, if there has been an error. More...
 
QString errorString () const
 Returns the human-readable error message. More...
 
bool isLoading () const
 Returns true while the model is loading, otherwise returns false. More...
 
void setConfiguration (AbstractConfiguration *configuration)
 Setter function for the configuraion property. More...
 

Additional Inherited Members

- Properties inherited from Schauer::AbstractContainerModel
bool showAll
 Set this to true to show all containers. More...
 
bool showSize
 Set this to true to return size of the container. More...
 
- Properties inherited from Schauer::AbstractBaseModel
Schauer::AbstractConfiguration configuration
 Pointer to an object providing configuration data. More...
 
int error
 Error code. More...
 
QString errorString
 Human-readable error message. More...
 
bool isLoading
 Indicates loading state. More...
 
- Public Slots inherited from Schauer::AbstractBaseModel
bool load (Schauer::AbstractBaseModel::LoadMode mode=LoadAsync)
 Loads the model data. More...
 
- Signals inherited from Schauer::AbstractContainerModel
void showAllChanged (bool showAll)
 Notifier signal for the showAll property. More...
 
void showSizeChanged (bool showSize)
 Notifier signal for the showSize property. More...
 
- Signals inherited from Schauer::AbstractBaseModel
void configurationChanged (Schauer::AbstractConfiguration *configuration)
 Notifier signal for the configuration property. More...
 
void errorChanged (int error)
 Notifier signal for the error property. More...
 
void isLoadingChanged (bool isLoading)
 Notifier signal for the isLoading property. More...
 
void loaded ()
 Emitted to indicate model data loading has been finished. More...
 
- Protected Member Functions inherited from Schauer::AbstractContainerModel
void clear () override
 Clears the model data. More...
 

Detailed Description

List model providing availabel containers.

Member Enumeration Documentation

◆ Roles

Roles used to access the model data.

Mainly used to access the model data from QML.

Enumerator
IdRole 

The ID of the container. Accessor: id, Type: QString

NamesRole 

The names that the container has been given. Accessor: names, Type: QStringList

ImageRole 

The name of the image usedn when creating the container: Accessor: image, Type: QString

ImageIdRole 

The ID of the image that the container was created from. Accessor: imageId, Type: QString

CommandRole 

Command to run when starting the container: Accessor: command, Type: QString

CreatedRole 

When the container was created. Accessor: created, Type: QDateTIme

StateRole 

The state of the container (e.g. Exited). Accessor: state, Type: QString

StatusRole 

Additional human readable status of the container (e.g. Exit 0). Accessor: status, Type: QString

LabelsRole 

User defined key/value metadata for for the container. Accessor: labels, Type: QMap<QString,QString>

SizeRwRole 

The size of the files that have been created or changed by the container. Accessor: sizeRw, Type: quint64

SizeRootFsRole 

The total size of all the files in the container. Accessor: sizeRootFs, Type: quint64

Constructor & Destructor Documentation

◆ ContainerListModel()

ContainerListModel::ContainerListModel ( QObject parent = nullptr)
explicit

Conctructs a new ContainerListModel with the given parent.

◆ ~ContainerListModel()

ContainerListModel::~ContainerListModel ( )
overridedefault

Destrys the ContainerListModel object.


The documentation for this class was generated from the following files: