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

Plasma

  • sources
  • kde-4.14
  • kdelibs
  • plasma
  • animations
pendulumcurve.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Bruno Abinader <bruno.abinader@indt.org.br>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include "pendulumcurve_p.h"
19 
25 static qreal pendulumFunction(qreal progress)
26 {
27  if (progress <= 0.25) {
28  progress *= 4;
29  } else if (progress <= 0.50) {
30  progress -= 0.25;
31  progress *= 4;
32  progress = 1 - progress;
33  } else if (progress <= 0.75) {
34  progress -= 0.50;
35  progress *= -4;
36  } else {
37  progress -= 0.75;
38  progress *= 4;
39  progress = 1 - progress;
40  progress *= -1;
41  }
42  return progress;
43 }
44 
45 namespace Plasma
46 {
47 
48 PendulumCurve::PendulumCurve()
49  : QEasingCurve()
50 {
51  setCustomType(pendulumFunction);
52 }
53 
54 } // namespace Plasma
pendulumFunction
static qreal pendulumFunction(qreal progress)
This static method is used to create a custom easing curve type.
Definition: pendulumcurve.cpp:25
QEasingCurve
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • 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

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