KPeople

persondetailsdialog.cpp
1 /*
2  Convenience dialog for displaying PersonDetailsView widgets
3  SPDX-FileCopyrightText: 2013 David Edmundson <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 
8 #include "persondetailsdialog.h"
9 
10 #include <QDialogButtonBox>
11 #include <QVBoxLayout>
12 
13 #include "persondetailsview.h"
14 
15 using namespace KPeople;
16 
17 namespace KPeople
18 {
19 class PersonDetailsDialogPrivate
20 {
21 public:
22  PersonDetailsView *view;
23 };
24 }
25 
26 PersonDetailsDialog::PersonDetailsDialog(QWidget *parent, Qt::WindowFlags f)
27  : QDialog(parent, f)
28  , d_ptr(new PersonDetailsDialogPrivate)
29 {
30  Q_D(PersonDetailsDialog);
31  QVBoxLayout *layout = new QVBoxLayout(this);
32 
33  d->view = new PersonDetailsView(this);
34  layout->addWidget(d->view);
35 
36  QDialogButtonBox *buttons = new QDialogButtonBox(this);
38  layout->addWidget(buttons);
39 
40  connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
41 }
42 
43 PersonDetailsDialog::~PersonDetailsDialog()
44 {
45  delete d_ptr;
46 }
47 
48 void PersonDetailsDialog::setPerson(PersonData *person)
49 {
50  Q_D(PersonDetailsDialog);
51  d->view->setPerson(person);
52 
53  setWindowTitle(person->name());
54 }
Allows to query the information about a given person.
Definition: persondata.h:34
Use PersonDetailsView to integrate a person's information in the GUI.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setStandardButtons(QDialogButtonBox::StandardButtons buttons)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
typedef WindowFlags
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sun Aug 14 2022 04:09:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.