#include <alarm.h>
#endif
-DetailsContainer::DetailsContainer(QWidget *aParent)
- : QWidget(aParent)
-{
- mAbstract.setWordWrap(true);
- mDescription.setWordWrap(true);
-
- QFont f = QLabel().font();
- f.setBold(true);
- f.setItalic(true);
- mMainLayout = new QVBoxLayout(this);
- QLabel *persons = new QLabel("Persons:");
- persons->setFont(f);
- mMainLayout->addWidget(persons);
- mMainLayout->addWidget(&mPersons);
- mMainLayout->addWidget(new QLabel("")); // spacer
- QLabel *abstract = new QLabel("Abstract:");
- abstract->setFont(f);
- mMainLayout->addWidget(abstract);
- mMainLayout->addWidget(&mAbstract);
- mMainLayout->addWidget(new QLabel("")); // spacer
- QLabel *description = new QLabel("Description:");
- description->setFont(f);
- mMainLayout->addWidget(description);
- mMainLayout->addWidget(&mDescription);
- setLayout(mMainLayout);
-}
-
-void DetailsContainer::setPersons(const QStringList &aPersons)
-{
- mPersons.setText(aPersons.join(" and "));
-}
-
-void DetailsContainer::setAbstract(const QString &aAbstract)
-{
- mAbstract.setText(aAbstract);
-}
-
-void DetailsContainer::setDescription(const QString &aDescription)
-{
- mDescription.setText(aDescription);
-}
-
EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
: QDialog(aParent)
, mEventId(aEventId)
Event event = Event::getById(mEventId,AppSettings::confId());
title->setText(event.title());
- mDetails.setPersons(event.persons());
- mDetails.setAbstract(event.abstract());
- mDetails.setDescription(event.description());
- scrollArea->setWidget(&mDetails);
+ persons->setText(event.persons().join(" and "));
+ abstract->setText(event.abstract());
+ description->setText(event.description());
connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked()));
connect(alarmButton, SIGNAL(clicked()), SLOT(alarmClicked()));
#include "ui_eventdialog.h"
#include <event.h>
-class DetailsContainer : public QWidget
-{
-public:
- DetailsContainer(QWidget *aParent = NULL);
- void setPersons(const QStringList &aPersons);
- void setAbstract(const QString &aAbstract);
- void setDescription(const QString &aDescription);
-private:
- QBoxLayout *mMainLayout;
- QLabel mPersons;
- QLabel mAbstract;
- QLabel mDescription;
-};
-
class EventDialog : public QDialog, Ui::EventDialog
{
Q_OBJECT
void eventHasChanged(int aEventId); // emited when user changes some event details, eg. sets it Favourite
private:
int mEventId;
- DetailsContainer mDetails;
};
#endif /* EVENTDIALOG_H */
<x>0</x>
<y>0</y>
<width>442</width>
- <height>380</height>
+ <height>391</height>
</rect>
</property>
<property name="sizePolicy" >
<x>0</x>
<y>0</y>
<width>418</width>
- <height>294</height>
+ <height>305</height>
</rect>
</property>
+ <layout class="QGridLayout" name="gridLayout_2" >
+ <item row="0" column="0" >
+ <widget class="QWidget" native="1" name="content" >
+ <layout class="QVBoxLayout" name="verticalLayout_2" >
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="font" >
+ <font>
+ <weight>75</weight>
+ <italic>true</italic>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>Persons:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="persons" >
+ <property name="text" >
+ <string>PERSONS</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ <property name="openExternalLinks" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="spacer" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_2" >
+ <property name="font" >
+ <font>
+ <weight>75</weight>
+ <italic>true</italic>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>Abstract:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="abstract" >
+ <property name="text" >
+ <string>ABSTRACT</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ <property name="openExternalLinks" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="spacer_2" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="font" >
+ <font>
+ <weight>75</weight>
+ <italic>true</italic>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>Description:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="description" >
+ <property name="text" >
+ <string>DESCRIPTION</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ <property name="openExternalLinks" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="spacer_3" >
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_3" >
+ <property name="font" >
+ <font>
+ <weight>75</weight>
+ <italic>true</italic>
+ <bold>true</bold>
+ </font>
+ </property>
+ <property name="text" >
+ <string>Links:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="links" >
+ <property name="text" >
+ <string>LINKS</string>
+ </property>
+ <property name="wordWrap" >
+ <bool>true</bool>
+ </property>
+ <property name="openExternalLinks" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
</widget>
</widget>
</item>