~noskcaj/ubuntu/wily/nootka/1.2

« back to all changes in this revision

Viewing changes to src/animations/tanimedtextitem.cpp

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2014-05-28 07:22:46 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140528072246-7m1u5qc24gqhqurg
Tags: 1.0.1-0ubuntu1
* Add a debian/watch file
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2012 by Tomasz Bojczuk                                  *
 
3
 *   tomaszbojczuk@gmail.com                                               *
 
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 3 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 *                                                                         *
 
10
 *   This program is distributed in the hope that it will be useful,       *
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
13
 *   GNU General Public License for more details.                          *
 
14
 *                                                                         *
 
15
 *  You should have received a copy of the GNU General Public License      *
 
16
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.  *
 
17
 ***************************************************************************/
 
18
 
 
19
#include "tanimedtextitem.h"
 
20
#include <QPen>
 
21
 
 
22
TanimedTextItem::TanimedTextItem() :
 
23
  QGraphicsSimpleTextItem()
 
24
{
 
25
  setAcceptHoverEvents(true);
 
26
}
 
27
 
 
28
TanimedTextItem::~TanimedTextItem()
 
29
{}
 
30
 
 
31
int TanimedTextItem::alpha() {
 
32
  return pen().color().alpha();
 
33
}
 
34
 
 
35
void TanimedTextItem::setAlpha(int al) {
 
36
  QColor cc = brush().color();
 
37
  cc.setAlpha(al);
 
38
  setBrush(cc);
 
39
}
 
40
 
 
41
 
 
42
void TanimedTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent* ) {
 
43
  hide();
 
44
}
 
45
 
 
46
 
 
47