1
/* This file is part of the KDE project
2
Copyright (C) 2012 Jarosław Staniek <staniek@kde.org>
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library 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.
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 GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this program; see the file COPYING. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
* Boston, MA 02110-1301, USA.
20
#ifndef KEXILINKBUTTON_H
21
#define KEXILINKBUTTON_H
23
#include "kexiutils_export.h"
25
#include <QPushButton>
29
//! A flat icon-based button without background that behaves like a link
30
class KEXIUTILS_EXPORT KexiLinkButton : public QPushButton
34
explicit KexiLinkButton(QWidget* parent = 0);
36
explicit KexiLinkButton(const QIcon &icon, QWidget* parent = 0);
38
explicit KexiLinkButton(const KGuiItem &item, QWidget *parent = 0);
40
explicit KexiLinkButton(const QPixmap &pixmap, QWidget* parent = 0);
42
virtual ~KexiLinkButton();
44
/*! If true, foreground color of the current palette is always used for painting
45
the button's icon. This is done by replacing color.
46
The foreground color is QPalette::Text by default, and can be changed
47
using setForegroundRole().
48
The icon is expected to be monochrome.
49
Works well also after palette change.
51
void setUsesForegroundColor(bool set);
53
/*! @return true if foreground color of the current palette is always used for painting
55
bool usesForegroundColor() const;
57
void setIcon(const QIcon &icon);
60
virtual void changeEvent(QEvent* event);
64
void updateIcon(const QIcon &icon);