1 #include "eventdialog.h"
2 #include <appsettings.h>
6 DetailsContainer::DetailsContainer(QWidget *aParent)
9 mAbstract.setWordWrap(true);
10 mDescription.setWordWrap(true);
12 QFont f = QLabel().font();
15 mMainLayout = new QVBoxLayout(this);
16 QLabel *persons = new QLabel("Persons:");
18 mMainLayout->addWidget(persons);
19 mMainLayout->addWidget(&mPersons);
20 mMainLayout->addWidget(new QLabel("")); // spacer
21 QLabel *abstract = new QLabel("Abstract:");
23 mMainLayout->addWidget(abstract);
24 mMainLayout->addWidget(&mAbstract);
25 mMainLayout->addWidget(new QLabel("")); // spacer
26 QLabel *description = new QLabel("Description:");
27 description->setFont(f);
28 mMainLayout->addWidget(description);
29 mMainLayout->addWidget(&mDescription);
30 setLayout(mMainLayout);
33 void DetailsContainer::setPersons(const QStringList &aPersons)
35 mPersons.setText(aPersons.join(" and "));
38 void DetailsContainer::setAbstract(const QString &aAbstract)
40 mAbstract.setText(aAbstract);
43 void DetailsContainer::setDescription(const QString &aDescription)
45 mDescription.setText(aDescription);
48 EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
58 Event event = Event::getById(aEventId,AppSettings::confId());
60 title->setText(event.title());
61 mDetails.setPersons(event.persons());
62 mDetails.setAbstract(event.abstract());
63 mDetails.setDescription(event.description());
64 scrollArea->setWidget(&mDetails);