parley
buttondelegate.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 Copyright 2008 Daniel Laidig <d.laidig@gmx.de> 00003 ***************************************************************************/ 00004 00005 /*************************************************************************** 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 ***************************************************************************/ 00013 00014 #ifndef BUTTONDELEGATE_H 00015 #define BUTTONDELEGATE_H 00016 00017 #include <kwidgetitemdelegate.h> 00018 00019 class WelcomeScreen; 00020 00021 class ButtonDelegate 00022 : public KWidgetItemDelegate 00023 { 00024 Q_OBJECT 00025 public: 00026 ButtonDelegate(QAbstractItemView *itemView, WelcomeScreen *parent); 00027 00028 virtual ~ButtonDelegate(); 00029 00030 QList<QWidget*> createItemWidgets() const; 00031 void updateItemWidgets(const QList<QWidget*> widgets, const QStyleOptionViewItem &option, const QPersistentModelIndex &index) const; 00032 00033 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; 00034 00035 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; 00036 00037 public slots: 00038 void slotEdit(); 00039 void slotPractice(); 00040 00041 private: 00042 mutable int m_rightMargin; 00043 mutable int m_buttonHeight; 00044 WelcomeScreen *m_welcomeScreen; 00045 }; 00046 00047 #endif
KDE 4.4 API Reference