source: src/gui/eventdialog.cpp @ 183eecd

qt5
Last change on this file since 183eecd was 183eecd, checked in by pavelpa <pavelpa@…>, 12 years ago

GUI work on Event Details dialog

  • Property mode set to 100644
File size: 1.7 KB
Line 
1#include "eventdialog.h"
2#include <appsettings.h>
3
4#include <QScrollBar>
5
6DetailsContainer::DetailsContainer(QWidget *aParent)
7    : QWidget(aParent)
8{
9    mAbstract.setWordWrap(true);
10    mDescription.setWordWrap(true);
11
12    QFont f = QLabel().font();
13    f.setBold(true);
14    f.setItalic(true);
15    mMainLayout = new QVBoxLayout(this);
16    QLabel *persons = new QLabel("Persons:");
17    persons->setFont(f);
18    mMainLayout->addWidget(persons);
19    mMainLayout->addWidget(&mPersons);
20    mMainLayout->addWidget(new QLabel("")); // spacer
21    QLabel *abstract = new QLabel("Abstract:");
22    abstract->setFont(f);
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);
31}
32
33void DetailsContainer::setPersons(const QStringList &aPersons)
34{
35    mPersons.setText(aPersons.join(" and "));
36}
37
38void DetailsContainer::setAbstract(const QString &aAbstract)
39{
40    mAbstract.setText(aAbstract);
41}
42
43void DetailsContainer::setDescription(const QString &aDescription)
44{
45    mDescription.setText(aDescription);
46}
47
48EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
49    : QDialog(aParent)
50    , mEventId(aEventId)
51{
52    setupUi(this);
53
54#ifdef MAEMO
55    showFullScreen();
56#endif
57
58    Event event = Event::getById(aEventId,AppSettings::confId());
59
60    title->setText(event.title());
61    mDetails.setPersons(event.persons());
62    mDetails.setAbstract(event.abstract());
63    mDetails.setDescription(event.description());
64    scrollArea->setWidget(&mDetails);
65}
66
Note: See TracBrowser for help on using the repository browser.