Links in events are now clickable (resolves ticket #4).
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 26 Jun 2011 18:49:44 +0000 (18:49 +0000)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 26 Jun 2011 18:49:44 +0000 (18:49 +0000)
src/gui/eventdialog.cpp
src/gui/eventdialog.ui

index a133d25..3b83451 100644 (file)
@@ -44,7 +44,10 @@ EventDialog::EventDialog(const int &aEventId, QWidget *aParent)
     persons->setText(event.persons().join(" and "));
     abstract->setText(event.abstract());
     description->setText(event.description());
     persons->setText(event.persons().join(" and "));
     abstract->setText(event.abstract());
     description->setText(event.description());
-    links->setText(static_cast<QStringList>(event.links().values()).join("\n"));
+    QStringList linksText = static_cast<QStringList>(event.links().values());
+    for (QStringList::iterator linkIterator = linksText.begin(); linkIterator != linksText.end(); ++linkIterator)
+        *linkIterator = QString("<a href=\"%1\">%1</a>").arg(*linkIterator);
+    links->setText(linksText.join("<br/>"));
 
     connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked()));
     connect(alarmButton, SIGNAL(clicked()), SLOT(alarmClicked()));
 
     connect(favouriteButton, SIGNAL(clicked()), SLOT(favouriteClicked()));
     connect(alarmButton, SIGNAL(clicked()), SLOT(alarmClicked()));
index c45b059..4eff409 100644 (file)
@@ -67,8 +67,8 @@
          <rect>
           <x>0</x>
           <y>0</y>
          <rect>
           <x>0</x>
           <y>0</y>
-          <width>463</width>
-          <height>270</height>
+          <width>461</width>
+          <height>276</height>
          </rect>
         </property>
         <layout class="QGridLayout" name="gridLayout_2">
          </rect>
         </property>
         <layout class="QGridLayout" name="gridLayout_2">
                  <property name="text">
                   <string>LINKS</string>
                  </property>
                  <property name="text">
                   <string>LINKS</string>
                  </property>
+                 <property name="textFormat">
+                  <enum>Qt::RichText</enum>
+                 </property>
                  <property name="wordWrap">
                   <bool>true</bool>
                  </property>
                  <property name="openExternalLinks">
                   <bool>true</bool>
                  </property>
                  <property name="wordWrap">
                   <bool>true</bool>
                  </property>
                  <property name="openExternalLinks">
                   <bool>true</bool>
                  </property>
+                 <property name="textInteractionFlags">
+                  <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
+                 </property>
                 </widget>
                </item>
               </layout>
                 </widget>
                </item>
               </layout>