• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kde-runtime API Reference
  • KDE Home
  • Contact Us
 

PlasmaExtraComponents

  • sources
  • kde-4.14
  • kde-runtime
  • plasma
  • declarativeimports
  • plasmaextracomponents
appbackgroundprovider.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2011 Marco Martin <notmart@gmail.com>
3 
4  This library 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.
8 
9  This library 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.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "appbackgroundprovider_p.h"
21 
22 #include <QLatin1Literal>
23 #include <QPixmap>
24 #include <QSize>
25 
26 #include <KStandardDirs>
27 
28 #include <Plasma/Theme>
29 
30 AppBackgroundProvider::AppBackgroundProvider()
31  : QDeclarativeImageProvider(QDeclarativeImageProvider::Image)
32 {
33 }
34 
35 QImage AppBackgroundProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
36 {
37  Q_UNUSED(size)
38  Q_UNUSED(requestedSize)
39  QString search = QLatin1Literal("desktoptheme/") % Plasma::Theme::defaultTheme()->themeName() % QLatin1Literal("/appbackgrounds/") % id % ".png";
40  search = KStandardDirs::locate("data", search);
41  return QImage(search);
42 }
43 
AppBackgroundProvider::AppBackgroundProvider
AppBackgroundProvider()
Definition: appbackgroundprovider.cpp:30
appbackgroundprovider_p.h
QString
QSize
QImage
QDeclarativeImageProvider
AppBackgroundProvider::requestImage
virtual QImage requestImage(const QString &id, QSize *size, const QSize &requestedSize)
Definition: appbackgroundprovider.cpp:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:08:46 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

PlasmaExtraComponents

Skip menu "PlasmaExtraComponents"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kde-runtime API Reference

Skip menu "kde-runtime API Reference"
  • KCMShell
  • KNotify
  • Plasma Runtime
  •     PlasmaCore
  •     DragAndDrop
  •     PlasmaComponents
  •     PlasmaExtraComponents
  •     QtExtraComponents

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