~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kinfocenter/Modules/infosummary/defaultboxwidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/*
 
3
 *  defaultboxwidget.cpp
 
4
 *
 
5
 *  Copyright (C) 2010 David Hubner <hubnerd@ntlworld.com>
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; either version 2 of the License, or
 
10
 *  (at your option) any later version.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU General Public License
 
18
 *  along with this program; if not, write to the Free Software
 
19
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
20
 *
 
21
 */
 
22
 
 
23
#include "defaultboxwidget.h"
 
24
 
 
25
DefaultBoxWidget::DefaultBoxWidget()
 
26
{
 
27
  setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
 
28
  setObjectName( QLatin1String("OuterFrame" ));
 
29
  
 
30
  m_layout = new QGridLayout(this);
 
31
  m_layout->setAlignment(Qt::AlignTop|Qt::AlignLeft);
 
32
  m_layout->setSpacing(10);
 
33
  
 
34
  createDisplay();
 
35
}
 
36
 
 
37
void DefaultBoxWidget::createDisplay() 
 
38
{
 
39
  m_iconLabel = new QLabel();
 
40
  m_iconLabel->setAlignment(Qt::AlignCenter);
 
41
  m_iconLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
 
42
  
 
43
  QFont bFont;
 
44
  bFont.setBold(true);
 
45
  
 
46
  m_info0Label = new QLabel();
 
47
  m_info0Label->setFont(bFont);
 
48
  m_info0NameLabel = new QLabel();
 
49
  
 
50
  m_info1Label = new QLabel();
 
51
  m_info1Label->setFont(bFont);
 
52
  m_info1NameLabel = new QLabel();
 
53
 
 
54
  m_info2Label = new QLabel();
 
55
  m_info2Label->setFont(bFont);
 
56
  m_info2NameLabel = new QLabel();
 
57
  
 
58
  m_layout->addWidget(m_iconLabel,1,1,3,1,Qt::AlignCenter);
 
59
  
 
60
  m_layout->addWidget(m_info0Label,1,2,1,1);
 
61
  m_layout->addWidget(m_info0NameLabel,1,3,1,1);
 
62
  
 
63
  m_layout->addWidget(m_info1Label,2,2,1,1);
 
64
  m_layout->addWidget(m_info1NameLabel,2,3,1,1);
 
65
  
 
66
  m_layout->addWidget(m_info2Label,3,2,1,1);
 
67
  m_layout->addWidget(m_info2NameLabel,3,3,1,1);
 
68
}
 
69
 
 
70
void DefaultBoxWidget::setLabelTitles(const QString &first, const QString &second, const QString &third)
 
71
{
 
72
  m_info0Label->setText(first);
 
73
  m_info1Label->setText(second);
 
74
  m_info2Label->setText(third);
 
75
}
 
76
 
 
77
void DefaultBoxWidget::setIcon(const KIcon &icon) 
 
78
{
 
79
  m_iconLabel->setPixmap(icon.pixmap(64));
 
80
}
 
81
 
 
82
void DefaultBoxWidget::setLabelOne(const QString &info) 
 
83
{
 
84
  m_info0NameLabel->setText(info);
 
85
}
 
86
 
 
87
void DefaultBoxWidget::setLabelTwo(const QString &info) 
 
88
{
 
89
  m_info1NameLabel->setText(info);
 
90
}
 
91
 
 
92
void DefaultBoxWidget::setLabelThree(const QString &info) 
 
93
{
 
94
  m_info2NameLabel->setText(info);
 
95
}