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

ksquares

  • sources
  • kde-4.14
  • kdegames
  • ksquares
  • src
highlightanimation.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2006 by Paolo Capriotti <p.capriotti@gmail.com> *
3  * Copyright (C) 2010 by Stefan Majewsky <majewsky@gmx.net> *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  ***************************************************************************/
10 
11 #include "highlightanimation.h"
12 
13 #include "settings.h"
14 
15 #include <QPen>
16 #include <QPropertyAnimation>
17 #include <QSequentialAnimationGroup>
18 
19 HighlightAnimation::HighlightAnimation(const QLineF &line)
20  : QGraphicsLineItem(line)
21 {
22  setPen(QPen(Settings::highlightColor(), 8.0, Qt::SolidLine, Qt::RoundCap));
23 
24  QPropertyAnimation* animation = new QPropertyAnimation(this, "opacity", this);
25  animation->setStartValue(1.0);
26  animation->setEndValue(0.0);
27  QSequentialAnimationGroup* animGroup = new QSequentialAnimationGroup(this);
28  animGroup->addPause(1000);
29  animGroup->addAnimation(animation);
30  animGroup->start(QAbstractAnimation::DeleteWhenStopped);
31  connect(animGroup, SIGNAL(finished()), this, SLOT(deleteLater()));
32 }
33 
34 #include "highlightanimation.moc"
highlightanimation.h
Settings::highlightColor
static QColor highlightColor()
Get Highlight Color.
Definition: settings.h:192
QVariantAnimation::setStartValue
void setStartValue(const QVariant &value)
QSequentialAnimationGroup
QAnimationGroup::addAnimation
void addAnimation(QAbstractAnimation *animation)
QPropertyAnimation
HighlightAnimation::HighlightAnimation
HighlightAnimation(const QLineF &line)
Definition: highlightanimation.cpp:19
QGraphicsLineItem
QSequentialAnimationGroup::addPause
QPauseAnimation * addPause(int msecs)
QObject::deleteLater
void deleteLater()
QLineF
QGraphicsLineItem::setPen
void setPen(const QPen &pen)
settings.h
QVariantAnimation::setEndValue
void setEndValue(const QVariant &value)
QPen
QAbstractAnimation::start
void start(QAbstractAnimation::DeletionPolicy policy)
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

ksquares

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

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

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