/src/kandas-client/viewdelegate.h

http://kandas.googlecode.com/ · C Header · 46 lines · 22 code · 7 blank · 17 comment · 0 complexity · ddb317eaf6ce0a3dbe447c9de219783d MD5 · raw file

  1. /***************************************************************************
  2. * Copyright 2009 Stefan Majewsky <majewsky@gmx.net>
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. ***************************************************************************/
  18. #ifndef KANDAS_CLIENT_VIEWDELEGATE_H
  19. #define KANDAS_CLIENT_VIEWDELEGATE_H
  20. #include <kwidgetitemdelegate.h>
  21. namespace Kandas
  22. {
  23. namespace Client
  24. {
  25. class ViewDelegate : public KWidgetItemDelegate
  26. {
  27. Q_OBJECT
  28. public:
  29. ViewDelegate(QAbstractItemView *view, QObject *parent = 0);
  30. virtual QList<QWidget *> createItemWidgets() const;
  31. virtual void updateItemWidgets(const QList<QWidget *> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const;
  32. virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
  33. virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
  34. Q_SIGNALS:
  35. void actionTriggered(const QPersistentModelIndex &index, const QString &action);
  36. };
  37. }
  38. }
  39. #endif // KANDAS_CLIENT_VIEWDELEGATE_H