00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Pekka Nissinen - pekka.nissinen@ixonos.com 00006 00007 Situare is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 version 2 as published by the Free Software Foundation. 00010 00011 Situare is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Situare; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 00022 #ifndef IMAGEBUTTON_H 00023 #define IMAGEBUTTON_H 00024 00025 #include <QPushButton> 00026 00032 class ImageButton : public QPushButton 00033 { 00034 Q_OBJECT 00035 00036 public: 00045 ImageButton(const QString &normalIconPictureFileName = QString(), 00046 const QString &selectedIconPictureFileName = QString(), 00047 const QString &disabledIconPictureFileName = QString(), QWidget *parent = 0); 00048 00049 /******************************************************************************* 00050 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00051 ******************************************************************************/ 00052 protected: 00059 void paintEvent(QPaintEvent *event); 00060 00061 /******************************************************************************* 00062 * MEMBER FUNCTIONS AND SLOTS 00063 ******************************************************************************/ 00064 public: 00070 void setButtonIcon(const QPixmap &image); 00071 00072 private: 00079 void initButton(const QSize &size, const QIcon &icon); 00080 }; 00081 00082 #endif // IMAGEBUTTON_H