X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/blobdiff_plain/ffd878fa8441b0bb1c4350a78b569c02e28cfc3f..699d5b8b1b53e8b3866150d59799d8cd96a53d63:/src/mvc/delegate.h diff --git a/src/mvc/delegate.h b/src/mvc/delegate.h index 5d7adac..98bef42 100644 --- a/src/mvc/delegate.h +++ b/src/mvc/delegate.h @@ -18,7 +18,9 @@ class Delegate : public QItemDelegate FavouriteControlOff, AlarmControlOn, AlarmControlOff, - MapControl + MapControl, + WarningControlOn, + WarningControlOff }; class Control @@ -62,6 +64,14 @@ class Delegate : public QItemDelegate bool isLast( const QModelIndex &index ) const; bool isExpanded( const QModelIndex &index ) const; void defineControls(); + // TODO: the better place for these methods would be 'eventmodel' + // they are used in 'paint' method and so it's better to obtain number of + // favourities/alarms once when the data has changed and not to call + // these methods which iterate over all Events in corresponding group + // every time it requires them + int numberOfFavourities(const QModelIndex &index) const; + int numberOfAlarms(const QModelIndex &index) const; + bool hasTimeConflict(const QModelIndex &index, const QModelIndex &parent) const; private: QPointer mViewPtr;