• Skip to content
  • Skip to link menu
KDE API Documentation - persondetailsdialog.cpp Source File (KPeople)
  • KDE Home
  • Contact Us
 

KPeople

  • frameworks
  • kpeople
  • src
  • widgets
persondetailsdialog.cpp
1 /*
2  * Convience dialog for displaying PersonDetailsView widgets
3  * Copyright 2013 David Edmundson <davidedmundson@kde.org>
4  *
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library 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 GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 #include "persondetailsdialog.h"
21 #include <QVBoxLayout>
22 #include <QDialogButtonBox>
23 
24 #include "persondetailsview.h"
25 
26 using namespace KPeople;
27 
28 namespace KPeople
29 {
30 class PersonDetailsDialogPrivate
31 {
32 public:
33  PersonDetailsView *view;
34 };
35 }
36 
37 PersonDetailsDialog::PersonDetailsDialog(QWidget *parent, Qt::WindowFlags f):
38  QDialog(parent, f),
39  d_ptr(new PersonDetailsDialogPrivate)
40 {
41  Q_D(PersonDetailsDialog);
42  QVBoxLayout *layout = new QVBoxLayout(this);
43 
44  d->view = new PersonDetailsView(this);
45  layout->addWidget(d->view);
46 
47  QDialogButtonBox *buttons = new QDialogButtonBox(this);
48  buttons->setStandardButtons(QDialogButtonBox::Ok);
49  layout->addWidget(buttons);
50 
51  connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
52 
53  setLayout(layout);
54 }
55 
56 PersonDetailsDialog::~PersonDetailsDialog()
57 {
58  delete d_ptr;
59 }
60 
61 void PersonDetailsDialog::setPerson(PersonData *person)
62 {
63  Q_D(PersonDetailsDialog);
64  d->view->setPerson(person);
65 
66  setWindowTitle(person->name());
67 }
68 
69 #include "persondetailsdialog.moc"
KPeople::PersonDetailsView
Use PersonDetailsView to integrate a person's information in the GUI.
Definition: persondetailsview.h:40
KPeople::PersonData
Allows to query the information about a given person.
Definition: persondata.h:44
KPeople
The KPeople namespace contains all the classes for Libkpeople.
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.

KPeople

Skip menu "KPeople"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • File List

Class Picker

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