From 9d4250e10ada4e2410722951dbd406263b61041c Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 9 Apr 2008 20:12:43 +0000 Subject: Provide tooltips. Per default tooltips are turned off because the information sidebar is turned on already. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks a lot to Konstantin Heil and Fredrik Höglund for the code :-) CCMAIL: konst.heil@stud.uni-heidelberg.de CCMAIL: fredrik@kde.org svn path=/trunk/KDE/kdebase/apps/; revision=795324 --- src/kballoontipdelegate.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/kballoontipdelegate.h (limited to 'src/kballoontipdelegate.h') diff --git a/src/kballoontipdelegate.h b/src/kballoontipdelegate.h new file mode 100644 index 000000000..0baec17f4 --- /dev/null +++ b/src/kballoontipdelegate.h @@ -0,0 +1,40 @@ +/*************************************************************************** + * Copyright (C) 2008 by Fredrik Höglund * + * * + * This program 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. * + * * + * This program 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 this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef KBALLOONTIPDELEGATE_H +#define KBALLOONTIPDELEGATE_H + +#include "ktooltip.h" + +class KBalloonTipDelegate : public KToolTipDelegate +{ +public: + KBalloonTipDelegate() {} + ~KBalloonTipDelegate() {} + + QSize sizeHint(const KStyleOptionToolTip *option, const KToolTipItem *item) const; + void paint(QPainter *painter, const KStyleOptionToolTip *option, const KToolTipItem *item) const; + QRegion inputShape(const KStyleOptionToolTip *option) const; + QRegion shapeMask(const KStyleOptionToolTip *option) const; + +private: + QPainterPath createPath(const KStyleOptionToolTip *option, QRect *contentRect = 0) const; +}; + +#endif -- cgit v1.3