- Timestamp:
- 05/28/13 22:08:35 (10 years ago)
- Branches:
- master, qt5
- Children:
- 055231b
- Parents:
- e84ed04
- Location:
- src/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/eventdialog.cpp
re84ed04 r1aede9a 37 37 Event event = Event::getById(mEventId, mConferenceId); 38 38 39 title->setText(event.title()); 40 persons->setText(event.persons().join(" and ")); 41 abstract->setText(event.abstract()); 42 description->setText(event.description()); 43 QStringList linksText = static_cast<QStringList>(event.links().values()); 44 for (QStringList::iterator linkIterator = linksText.begin(); linkIterator != linksText.end(); ++linkIterator) 45 *linkIterator = QString("<a href=\"%1\">%1</a>").arg(*linkIterator); 46 links->setText(linksText.join("<br/>")); 39 QString info; 40 // title 41 info.append(QString("<h1>%1</h1>\n").arg(event.title())); 42 43 // persons 44 info += QString("<h2>%1</h2>\n").arg(tr("Persons")); 45 info += QString("<p>%1</p>\n").arg(event.persons().join(", ")); 46 47 // abstract 48 info += QString("<h2>%1</h2>\n").arg(tr("Abstract")); 49 info += QString("<p>%1</p>\n").arg(event.abstract()); 50 51 // description 52 info += QString("<h2>%1</h2>\n").arg(tr("Description")); 53 info += QString("<p>%1</p>\n").arg(event.description()); 54 55 // links 56 info += QString("<h2>%1</h2>\n<ul>\n").arg(tr("Links")); 57 QMapIterator<QString, QString> i(event.links()); 58 while (i.hasNext()) { 59 i.next(); 60 QString url(i.value()); 61 QString name(i.key()); 62 if (url.isEmpty() || url == "http://") continue; 63 if (name.isEmpty()) name = url; 64 info += QString("<li><a href=\"%1\">%2</a></li>\n").arg(url, name); 65 } 66 info += QString("</ul>\n"); 67 eventInfoTextBrowser->setHtml(info); 47 68 48 69 connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked())); -
src/gui/eventdialog.ui
re84ed04 r1aede9a 7 7 <x>0</x> 8 8 <y>0</y> 9 <width> 485</width>10 <height> 368</height>9 <width>539</width> 10 <height>404</height> 11 11 </rect> 12 12 </property> … … 23 23 <bool>false</bool> 24 24 </property> 25 <layout class="QGridLayout" name="gridLayout"> 26 <item row="0" column="0"> 27 <layout class="QVBoxLayout" name="verticalLayout"> 25 <layout class="QVBoxLayout" name="verticalLayout"> 26 <item> 27 <widget class="QTextBrowser" name="eventInfoTextBrowser"> 28 <property name="openExternalLinks"> 29 <bool>true</bool> 30 </property> 31 </widget> 32 </item> 33 <item> 34 <layout class="QHBoxLayout" name="horizontalLayout"> 28 35 <item> 29 <widget class="QLabel" name="title"> 30 <property name="sizePolicy"> 31 <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> 32 <horstretch>0</horstretch> 33 <verstretch>0</verstretch> 34 </sizepolicy> 36 <widget class="QToolButton" name="alarmButton"> 37 <property name="text"> 38 <string>...</string> 35 39 </property> 36 <property name="font"> 37 <font> 38 <weight>75</weight> 39 <bold>true</bold> 40 <underline>true</underline> 41 </font> 40 <property name="icon"> 41 <iconset resource="../icons.qrc"> 42 <normaloff>:/icons/alarm-off.png</normaloff>:/icons/alarm-off.png</iconset> 42 43 </property> 43 <property name="text"> 44 <string>Title goes here</string> 44 <property name="iconSize"> 45 <size> 46 <width>32</width> 47 <height>32</height> 48 </size> 45 49 </property> 46 <property name="alignment"> 47 <set>Qt::AlignCenter</set> 48 </property> 49 <property name="wordWrap"> 50 <bool>true</bool> 50 <property name="shortcut"> 51 <string>CapsLock</string> 51 52 </property> 52 53 </widget> 53 54 </item> 54 55 <item> 55 <widget class="QScrollArea" name="scrollArea"> 56 <property name="sizePolicy"> 57 <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> 58 <horstretch>0</horstretch> 59 <verstretch>0</verstretch> 60 </sizepolicy> 56 <widget class="QToolButton" name="favouriteButton"> 57 <property name="text"> 58 <string>...</string> 61 59 </property> 62 <property name="widgetResizable"> 63 <bool>true</bool> 60 <property name="icon"> 61 <iconset resource="../icons.qrc"> 62 <normaloff>:/icons/favourite-off.png</normaloff>:/icons/favourite-off.png</iconset> 64 63 </property> 65 <widget class="QWidget" name="scrollAreaWidgetContents"> 66 <property name="geometry"> 67 <rect> 68 <x>0</x> 69 <y>-1</y> 70 <width>446</width> 71 <height>262</height> 72 </rect> 73 </property> 74 <layout class="QGridLayout" name="gridLayout_2"> 75 <item row="0" column="0"> 76 <widget class="QWidget" name="content" native="true"> 77 <property name="sizePolicy"> 78 <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> 79 <horstretch>0</horstretch> 80 <verstretch>0</verstretch> 81 </sizepolicy> 82 </property> 83 <layout class="QVBoxLayout" name="verticalLayout_2"> 84 <item> 85 <widget class="QGroupBox" name="personsGB"> 86 <property name="sizePolicy"> 87 <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> 88 <horstretch>0</horstretch> 89 <verstretch>0</verstretch> 90 </sizepolicy> 91 </property> 92 <property name="font"> 93 <font> 94 <weight>75</weight> 95 <bold>true</bold> 96 </font> 97 </property> 98 <property name="title"> 99 <string>Persons</string> 100 </property> 101 <layout class="QVBoxLayout" name="verticalLayout_3"> 102 <item> 103 <widget class="QLabel" name="persons"> 104 <property name="font"> 105 <font> 106 <weight>50</weight> 107 <bold>false</bold> 108 </font> 109 </property> 110 <property name="text"> 111 <string>PERSONS</string> 112 </property> 113 <property name="wordWrap"> 114 <bool>true</bool> 115 </property> 116 <property name="openExternalLinks"> 117 <bool>true</bool> 118 </property> 119 <property name="textInteractionFlags"> 120 <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> 121 </property> 122 </widget> 123 </item> 124 </layout> 125 </widget> 126 </item> 127 <item> 128 <widget class="QGroupBox" name="abstractGB"> 129 <property name="sizePolicy"> 130 <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> 131 <horstretch>0</horstretch> 132 <verstretch>0</verstretch> 133 </sizepolicy> 134 </property> 135 <property name="font"> 136 <font> 137 <weight>75</weight> 138 <bold>true</bold> 139 </font> 140 </property> 141 <property name="title"> 142 <string>Abstract</string> 143 </property> 144 <layout class="QVBoxLayout" name="verticalLayout_4"> 145 <item> 146 <widget class="QLabel" name="abstract"> 147 <property name="font"> 148 <font> 149 <weight>50</weight> 150 <bold>false</bold> 151 </font> 152 </property> 153 <property name="text"> 154 <string>ABSTRACT</string> 155 </property> 156 <property name="wordWrap"> 157 <bool>true</bool> 158 </property> 159 <property name="openExternalLinks"> 160 <bool>true</bool> 161 </property> 162 <property name="textInteractionFlags"> 163 <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> 164 </property> 165 </widget> 166 </item> 167 </layout> 168 </widget> 169 </item> 170 <item> 171 <widget class="QGroupBox" name="descriptionGB"> 172 <property name="font"> 173 <font> 174 <weight>75</weight> 175 <bold>true</bold> 176 </font> 177 </property> 178 <property name="title"> 179 <string>Description</string> 180 </property> 181 <layout class="QVBoxLayout" name="verticalLayout_5"> 182 <item> 183 <widget class="QLabel" name="description"> 184 <property name="sizePolicy"> 185 <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> 186 <horstretch>0</horstretch> 187 <verstretch>0</verstretch> 188 </sizepolicy> 189 </property> 190 <property name="font"> 191 <font> 192 <weight>50</weight> 193 <bold>false</bold> 194 </font> 195 </property> 196 <property name="text"> 197 <string>DESCRIPTION</string> 198 </property> 199 <property name="wordWrap"> 200 <bool>true</bool> 201 </property> 202 <property name="openExternalLinks"> 203 <bool>true</bool> 204 </property> 205 <property name="textInteractionFlags"> 206 <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> 207 </property> 208 </widget> 209 </item> 210 </layout> 211 </widget> 212 </item> 213 <item> 214 <widget class="QGroupBox" name="linksGB"> 215 <property name="font"> 216 <font> 217 <weight>75</weight> 218 <bold>true</bold> 219 </font> 220 </property> 221 <property name="title"> 222 <string>Links</string> 223 </property> 224 <layout class="QVBoxLayout" name="verticalLayout_6"> 225 <item> 226 <widget class="QLabel" name="links"> 227 <property name="sizePolicy"> 228 <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding"> 229 <horstretch>0</horstretch> 230 <verstretch>0</verstretch> 231 </sizepolicy> 232 </property> 233 <property name="font"> 234 <font> 235 <weight>50</weight> 236 <bold>false</bold> 237 </font> 238 </property> 239 <property name="text"> 240 <string>LINKS</string> 241 </property> 242 <property name="textFormat"> 243 <enum>Qt::RichText</enum> 244 </property> 245 <property name="wordWrap"> 246 <bool>true</bool> 247 </property> 248 <property name="openExternalLinks"> 249 <bool>true</bool> 250 </property> 251 <property name="textInteractionFlags"> 252 <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set> 253 </property> 254 </widget> 255 </item> 256 </layout> 257 </widget> 258 </item> 259 </layout> 260 </widget> 261 </item> 262 </layout> 263 </widget> 64 <property name="iconSize"> 65 <size> 66 <width>32</width> 67 <height>32</height> 68 </size> 69 </property> 264 70 </widget> 265 71 </item> 266 72 <item> 267 <spacer name=" verticalSpacer_2">73 <spacer name="horizontalSpacer"> 268 74 <property name="orientation"> 269 <enum>Qt::Vertical</enum> 270 </property> 271 <property name="sizeType"> 272 <enum>QSizePolicy::Minimum</enum> 75 <enum>Qt::Horizontal</enum> 273 76 </property> 274 77 <property name="sizeHint" stdset="0"> 275 78 <size> 276 <width> 20</width>277 <height> 10</height>79 <width>40</width> 80 <height>20</height> 278 81 </size> 279 82 </property> … … 281 84 </item> 282 85 <item> 283 <layout class="QHBoxLayout" name="horizontalLayout"> 284 <item> 285 <widget class="QToolButton" name="alarmButton"> 286 <property name="text"> 287 <string>...</string> 288 </property> 289 <property name="icon"> 290 <iconset resource="../icons.qrc"> 291 <normaloff>:/icons/alarm-off.png</normaloff>:/icons/alarm-off.png</iconset> 292 </property> 293 <property name="iconSize"> 294 <size> 295 <width>32</width> 296 <height>32</height> 297 </size> 298 </property> 299 <property name="shortcut"> 300 <string>CapsLock</string> 301 </property> 302 </widget> 303 </item> 304 <item> 305 <widget class="QToolButton" name="favouriteButton"> 306 <property name="text"> 307 <string>...</string> 308 </property> 309 <property name="icon"> 310 <iconset resource="../icons.qrc"> 311 <normaloff>:/icons/favourite-off.png</normaloff>:/icons/favourite-off.png</iconset> 312 </property> 313 <property name="iconSize"> 314 <size> 315 <width>32</width> 316 <height>32</height> 317 </size> 318 </property> 319 </widget> 320 </item> 321 <item> 322 <spacer name="horizontalSpacer"> 323 <property name="orientation"> 324 <enum>Qt::Horizontal</enum> 325 </property> 326 <property name="sizeHint" stdset="0"> 327 <size> 328 <width>40</width> 329 <height>20</height> 330 </size> 331 </property> 332 </spacer> 333 </item> 334 <item> 335 <widget class="QPushButton" name="okButton"> 336 <property name="text"> 337 <string>OK</string> 338 </property> 339 </widget> 340 </item> 341 </layout> 86 <widget class="QPushButton" name="okButton"> 87 <property name="text"> 88 <string>OK</string> 89 </property> 90 </widget> 342 91 </item> 343 92 </layout>
Note: See TracChangeset
for help on using the changeset viewer.