KPeople

persondetailsdialog.cpp
1/*
2 Convenience dialog for displaying PersonDetailsView widgets
3 SPDX-FileCopyrightText: 2013 David Edmundson <davidedmundson@kde.org>
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
15using namespace KPeople;
16
17namespace KPeople
18{
19class PersonDetailsDialogPrivate
20{
21public:
23};
24}
25
26PersonDetailsDialog::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
43PersonDetailsDialog::~PersonDetailsDialog()
44{
45 delete d_ptr;
46}
47
48void PersonDetailsDialog::setPerson(PersonData *person)
49{
50 Q_D(PersonDetailsDialog);
51 d->view->setPerson(person);
52
53 setWindowTitle(person->name());
54}
55
56#include "moc_persondetailsdialog.cpp"
Allows to query the information about a given person.
Definition persondata.h:35
Use PersonDetailsView to integrate a person's information in the GUI.
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
void setStandardButtons(StandardButtons buttons)
typedef WindowFlags
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void setWindowTitle(const QString &)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.