KPeople
19 #include "personpresentationwidget.h"
21 #include <QHBoxLayout>
25 PersonPresentationWidget::PersonPresentationWidget(
const QString &name,
const QIcon &avatar, QWidget *parent)
28 setLayout(
new QHBoxLayout(
this));
30 m_email =
new QLabel(
this);
31 m_phone =
new QLabel(
this);
32 m_name =
new QLabel(
this);
33 m_pixmap =
new QLabel(
this);
35 m_selected =
new QCheckBox(
this);
36 m_selected->setChecked(
true);
38 m_name->setText(name);
41 int pixmapHeight = m_name->fontMetrics().height() * 3;
42 QSize pixSize(pixmapHeight, pixmapHeight);
44 m_pixmap->setPixmap(avatar.pixmap(pixSize)
45 .scaled(pixSize, Qt::KeepAspectRatio, Qt::SmoothTransformation));
49 PersonPresentationWidget::~PersonPresentationWidget()
53 void PersonPresentationWidget::draw()
55 layout()->addWidget(m_pixmap);
56 layout()->addWidget(m_name);
57 layout()->addWidget(m_selected);
This file is part of the KDE documentation.
Documentation copyright © 1996-2015 The KDE developers.
Generated on Fri Feb 13 2015 15:16:39 by
doxygen 1.8.9.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.