• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • kdelibs
  • KDE Home
  • Contact Us
 

KDEUI

kcolorhelpers.cpp

Go to the documentation of this file.
00001 /*
00002  * This file is part of the KDE project.
00003  * Copyright © 2010 Christoph Feck <christoph@maxiom.de>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License version 2 as published by the Free Software Foundation.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this library; see the file COPYING.LIB.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #include "kcolorhelpers_p.h"
00021 
00022 #include <QtGui/QColor>
00023 #include <QtGui/QPainter>
00024 #include <QtGui/QPixmap>
00025 
00026 namespace KDEPrivate {
00027 
00028 void fillOpaqueRect(QPainter *painter, const QRect &rect, const QBrush &brush)
00029 {
00030     if (!brush.isOpaque()) {
00031         QPixmap chessboardPattern(16, 16);
00032         QPainter patternPainter(&chessboardPattern);
00033         patternPainter.fillRect(0, 0, 8, 8, Qt::black);
00034         patternPainter.fillRect(8, 8, 8, 8, Qt::black);
00035         patternPainter.fillRect(0, 8, 8, 8, Qt::white);
00036         patternPainter.fillRect(8, 0, 8, 8, Qt::white);
00037         patternPainter.end();
00038         painter->fillRect(rect, QBrush(chessboardPattern));
00039     }
00040     painter->fillRect(rect, brush);
00041 }
00042 
00043 } // namespace KDEPrivate

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal