QtMvvm  1.1.0
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
Classes | Public Types | Public Member Functions | List of all members
QtMvvm::SettingsListNode< TType > Class Template Reference

A helper class used by the qsettingsgenerator to represent list nodes. More...

#include <settingsentry.h>

Classes

class  Deferred
 Entry container to make deferred creation of a new list element possible. More...
 
class  iterator_base
 The iterator class to iterate through the list nodes entries. More...
 

Public Types

using iterator = iterator_base< TType >
 Typedef for a read and write iterator.
 
using const_iterator = iterator_base< const TType >
 Typedef for a readonly iterator.
 

Public Member Functions

bool isSet () const
 Checks if the entry that represents the list node is stored in the settings.
 
QString key () const
 Returns the key this list node uses to access the settings.
 
int size () const
 Returns the current size of the list, as stored in the settings.
 
const TType & at (int index) const
 Returns a reference to the element at the given position in the list.
 
TType & at (int index)
 Returns a reference to the element at the given position in the list.
 
TType & push ()
 Appends a new element to the list and returns a reference to that entry.
 
Deferred push_deferred ()
 Creates a new element and returns it, but does not push it yet.
 
void pop (int count=1)
 Removes count elements from the back of the list from the settings.
 
void reset ()
 Removes the list and all of its elements from the settings.
 
TType & operator[] (int index)
 Returns a reference to the element at the given position in the list.
 
const TType & operator[] (int index) const
 Returns a reference to the element at the given position in the list.
 
iterator begin ()
 returns an iterator pointing to the beginning of the list
 
iterator end ()
 returns an iterator pointing after the end of the list
 
const_iterator begin () const
 returns an iterator pointing to the beginning of the list
 
const_iterator end () const
 returns an iterator pointing after the end of the list
 
const_iterator constBegin () const
 returns an iterator pointing to the beginning of the list
 
const_iterator constEnd () const
 returns an iterator pointing after the end of the list
 
void addChangeCallback (const std::function< void(int)> &callback)
 Adds a method to be called if the number of elements stored for the list change.
 
void addChangeCallback (QObject *scope, const std::function< void(int)> &callback)
 Adds a method to be called if the number of elements stored for the list change, as long as scope exists.
 

Detailed Description

template<typename TType>
class QtMvvm::SettingsListNode< TType >

A helper class used by the qsettingsgenerator to represent list nodes.

Definition at line 71 of file settingsentry.h.


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