]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/mvc/delegate.h
Add .pro.user.* to svn:ignore and remove it in the release target.
[toast/confclerk.git] / src / mvc / delegate.h
index 67ea55ba6e32331ddf3e0c95d372cb1f296369a1..0859b563fd3c828b3cf2b8d8eb98d757e5058940 100644 (file)
@@ -1,27 +1,26 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
+ * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
- * This file is part of fosdem-schedule.
+ * This file is part of ConfClerk.
  *
- * fosdem-schedule is free software: you can redistribute it and/or modify it
+ * ConfClerk is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation, either version 2 of the License, or (at your option)
  * any later version.
  *
- * fosdem-schedule is distributed in the hope that it will be useful, but
+ * ConfClerk is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
+ * ConfClerk.  If not, see <http://www.gnu.org/licenses/>.
  */
 #ifndef DELEGATE_H
 #define DELEGATE_H
 
-#include <QItemDelegate>
-#include <QTreeView>
-#include <QPointer>
+#include <QtGui>
 
 class Delegate : public QItemDelegate
 {
@@ -36,7 +35,6 @@ class Delegate : public QItemDelegate
             FavouriteControlOff,
             AlarmControlOn,
             AlarmControlOff,
-            MapControl,
             WarningControl
         };
 
@@ -53,6 +51,8 @@ class Delegate : public QItemDelegate
                 }
                 void paint(QPainter* painter, const QRect rect);
 
+                bool enabled() const { return mEnabled; }
+                void setEnabled(bool v) { mEnabled = v; }
             private:
                 inline QPoint drawPoint(const QRect &aRect = QRect()) const // for painter to draw Control
                 {
@@ -65,6 +65,7 @@ class Delegate : public QItemDelegate
                 ControlId mId;
                 QImage *mImage;
                 QPoint mDrawPoint; // relative 'start-drawing' position (may hold negative values)
+                bool mEnabled;
         };
 
         Delegate(QTreeView *aParent); // the delegate 'owner' has to be specified in the constructor - it's used to obtain visualRect of selected item/index