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

GroupingDesktop

  • sources
  • kde-4.14
  • workspace
  • kdeplasma-addons
  • containments
  • groupingdesktop
  • lib
spacer.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2010 by Giulio Camuffo <giuliocamuffo@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
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
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #include "spacer.h"
21 
22 #include <QtGui/QPainter>
23 
24 #include <Plasma/Theme>
25 #include <Plasma/PaintUtils>
26 
27 Spacer::Spacer(QGraphicsWidget *parent)
28  : QGraphicsWidget(parent)
29 {
30 
31 }
32 
33 Spacer::~Spacer()
34 {
35 
36 }
37 
38 void Spacer::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
39 {
40  Q_UNUSED(option)
41  Q_UNUSED(widget)
42 
43  //TODO: make this a pretty gradient?
44  painter->setRenderHint(QPainter::Antialiasing);
45  QPainterPath p = Plasma::PaintUtils::roundedRectangle(contentsRect(), 4);
46  QColor c = Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor);
47  c.setAlphaF(0.3);
48 
49  painter->fillPath(p, c);
50 }
51 
52 #include "spacer.moc"
QWidget
QPainter::setRenderHint
void setRenderHint(RenderHint hint, bool on)
spacer.h
QPainter::fillPath
void fillPath(const QPainterPath &path, const QBrush &brush)
QPainter
QGraphicsWidget
QColor
Spacer::paint
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: spacer.cpp:38
QPainterPath
Spacer::~Spacer
~Spacer()
Definition: spacer.cpp:33
QColor::setAlphaF
void setAlphaF(qreal alpha)
QStyleOptionGraphicsItem
QGraphicsLayoutItem::contentsRect
QRectF contentsRect() const
Spacer::Spacer
Spacer(QGraphicsWidget *parent)
Definition: spacer.cpp:27
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

GroupingDesktop

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

workspace API Reference

Skip menu "workspace API Reference"
  • kdeplasma-addons
  •       GroupingDesktop
  •     liblancelot

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal