- Timestamp:
- 01/27/10 13:06:32 (13 years ago)
- Branches:
- master, qt5
- Children:
- 6123b48
- Parents:
- ce59092
- Location:
- src/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/eventdialog.cpp
rce59092 r1bcd66f 7 7 #include <alarm.h> 8 8 #endif 9 10 DetailsContainer::DetailsContainer(QWidget *aParent)11 : QWidget(aParent)12 {13 mAbstract.setWordWrap(true);14 mDescription.setWordWrap(true);15 16 QFont f = QLabel().font();17 f.setBold(true);18 f.setItalic(true);19 mMainLayout = new QVBoxLayout(this);20 QLabel *persons = new QLabel("Persons:");21 persons->setFont(f);22 mMainLayout->addWidget(persons);23 mMainLayout->addWidget(&mPersons);24 mMainLayout->addWidget(new QLabel("")); // spacer25 QLabel *abstract = new QLabel("Abstract:");26 abstract->setFont(f);27 mMainLayout->addWidget(abstract);28 mMainLayout->addWidget(&mAbstract);29 mMainLayout->addWidget(new QLabel("")); // spacer30 QLabel *description = new QLabel("Description:");31 description->setFont(f);32 mMainLayout->addWidget(description);33 mMainLayout->addWidget(&mDescription);34 setLayout(mMainLayout);35 }36 37 void DetailsContainer::setPersons(const QStringList &aPersons)38 {39 mPersons.setText(aPersons.join(" and "));40 }41 42 void DetailsContainer::setAbstract(const QString &aAbstract)43 {44 mAbstract.setText(aAbstract);45 }46 47 void DetailsContainer::setDescription(const QString &aDescription)48 {49 mDescription.setText(aDescription);50 }51 9 52 10 EventDialog::EventDialog(const int &aEventId, QWidget *aParent) … … 63 21 64 22 title->setText(event.title()); 65 mDetails.setPersons(event.persons()); 66 mDetails.setAbstract(event.abstract()); 67 mDetails.setDescription(event.description()); 68 scrollArea->setWidget(&mDetails); 23 persons->setText(event.persons().join(" and ")); 24 abstract->setText(event.abstract()); 25 description->setText(event.description()); 69 26 70 27 connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked())); -
src/gui/eventdialog.h
rce59092 r1bcd66f 5 5 #include "ui_eventdialog.h" 6 6 #include <event.h> 7 8 class DetailsContainer : public QWidget9 {10 public:11 DetailsContainer(QWidget *aParent = NULL);12 void setPersons(const QStringList &aPersons);13 void setAbstract(const QString &aAbstract);14 void setDescription(const QString &aDescription);15 private:16 QBoxLayout *mMainLayout;17 QLabel mPersons;18 QLabel mAbstract;19 QLabel mDescription;20 };21 7 22 8 class EventDialog : public QDialog, Ui::EventDialog … … 33 19 private: 34 20 int mEventId; 35 DetailsContainer mDetails;36 21 }; 37 22 -
src/gui/eventdialog.ui
rce59092 r1bcd66f 7 7 <y>0</y> 8 8 <width>442</width> 9 <height>3 80</height>9 <height>391</height> 10 10 </rect> 11 11 </property> … … 62 62 <y>0</y> 63 63 <width>418</width> 64 <height> 294</height>64 <height>305</height> 65 65 </rect> 66 66 </property> 67 <layout class="QGridLayout" name="gridLayout_2" > 68 <item row="0" column="0" > 69 <widget class="QWidget" native="1" name="content" > 70 <layout class="QVBoxLayout" name="verticalLayout_2" > 71 <item> 72 <widget class="QLabel" name="label" > 73 <property name="font" > 74 <font> 75 <weight>75</weight> 76 <italic>true</italic> 77 <bold>true</bold> 78 </font> 79 </property> 80 <property name="text" > 81 <string>Persons:</string> 82 </property> 83 </widget> 84 </item> 85 <item> 86 <widget class="QLabel" name="persons" > 87 <property name="text" > 88 <string>PERSONS</string> 89 </property> 90 <property name="wordWrap" > 91 <bool>true</bool> 92 </property> 93 <property name="openExternalLinks" > 94 <bool>true</bool> 95 </property> 96 </widget> 97 </item> 98 <item> 99 <widget class="QLabel" name="spacer" > 100 <property name="text" > 101 <string/> 102 </property> 103 </widget> 104 </item> 105 <item> 106 <widget class="QLabel" name="label_2" > 107 <property name="font" > 108 <font> 109 <weight>75</weight> 110 <italic>true</italic> 111 <bold>true</bold> 112 </font> 113 </property> 114 <property name="text" > 115 <string>Abstract:</string> 116 </property> 117 </widget> 118 </item> 119 <item> 120 <widget class="QLabel" name="abstract" > 121 <property name="text" > 122 <string>ABSTRACT</string> 123 </property> 124 <property name="wordWrap" > 125 <bool>true</bool> 126 </property> 127 <property name="openExternalLinks" > 128 <bool>true</bool> 129 </property> 130 </widget> 131 </item> 132 <item> 133 <widget class="QLabel" name="spacer_2" > 134 <property name="text" > 135 <string/> 136 </property> 137 </widget> 138 </item> 139 <item> 140 <widget class="QLabel" name="label_4" > 141 <property name="font" > 142 <font> 143 <weight>75</weight> 144 <italic>true</italic> 145 <bold>true</bold> 146 </font> 147 </property> 148 <property name="text" > 149 <string>Description:</string> 150 </property> 151 </widget> 152 </item> 153 <item> 154 <widget class="QLabel" name="description" > 155 <property name="text" > 156 <string>DESCRIPTION</string> 157 </property> 158 <property name="wordWrap" > 159 <bool>true</bool> 160 </property> 161 <property name="openExternalLinks" > 162 <bool>true</bool> 163 </property> 164 </widget> 165 </item> 166 <item> 167 <widget class="QLabel" name="spacer_3" > 168 <property name="text" > 169 <string/> 170 </property> 171 </widget> 172 </item> 173 <item> 174 <widget class="QLabel" name="label_3" > 175 <property name="font" > 176 <font> 177 <weight>75</weight> 178 <italic>true</italic> 179 <bold>true</bold> 180 </font> 181 </property> 182 <property name="text" > 183 <string>Links:</string> 184 </property> 185 </widget> 186 </item> 187 <item> 188 <widget class="QLabel" name="links" > 189 <property name="text" > 190 <string>LINKS</string> 191 </property> 192 <property name="wordWrap" > 193 <bool>true</bool> 194 </property> 195 <property name="openExternalLinks" > 196 <bool>true</bool> 197 </property> 198 </widget> 199 </item> 200 </layout> 201 </widget> 202 </item> 203 <item row="1" column="0" > 204 <spacer name="verticalSpacer" > 205 <property name="orientation" > 206 <enum>Qt::Vertical</enum> 207 </property> 208 <property name="sizeHint" stdset="0" > 209 <size> 210 <width>20</width> 211 <height>40</height> 212 </size> 213 </property> 214 </spacer> 215 </item> 216 </layout> 67 217 </widget> 68 218 </widget>
Note: See TracChangeset
for help on using the changeset viewer.