Changeset 395d6d3
- Timestamp:
- 01/19/10 20:44:23 (13 years ago)
- Branches:
- master, qt5
- Children:
- 9208bdb
- Parents:
- c53a3f4
- Location:
- src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/eventdialog.cpp
rc53a3f4 r395d6d3 1 1 #include "eventdialog.h" 2 3 #include <QDebug> 2 4 3 5 EventDialog::EventDialog(const QModelIndex &aIndex, QWidget *aParent) … … 6 8 { 7 9 setupUi(this); 10 11 abstract->setStyleSheet("background-color : transparent;"); 12 description->setStyleSheet("background-color : transparent;"); 13 8 14 Event *event = static_cast<Event *>(mIndex.internalPointer()); 9 15 title->setText(event->title()); 10 persons->setText( QString::number(event->id()));16 persons->setText(event->persons().join(" and ")); 11 17 abstract->setPlainText(event->abstract()); 12 18 description->setPlainText(event->description()); -
src/gui/eventdialog.ui
rc53a3f4 r395d6d3 6 6 <x>0</x> 7 7 <y>0</y> 8 <width> 339</width>9 <height>2 50</height>8 <width>445</width> 9 <height>298</height> 10 10 </rect> 11 11 </property> 12 12 <property name="windowTitle" > 13 13 <string>Dialog</string> 14 </property> 15 <property name="autoFillBackground" > 16 <bool>false</bool> 14 17 </property> 15 18 <layout class="QGridLayout" name="gridLayout" > … … 35 38 <widget class="QLabel" name="persons" > 36 39 <property name="text" > 37 <string> Here go persons</string>40 <string>persons go here</string> 38 41 </property> 39 42 </widget> … … 44 47 <string>Abstract:</string> 45 48 </property> 49 <property name="alignment" > 50 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 51 </property> 46 52 </widget> 47 53 </item> 48 54 <item row="2" column="2" > 49 <widget class="QPlainTextEdit" name="abstract" /> 55 <widget class="QPlainTextEdit" name="abstract" > 56 <property name="autoFillBackground" > 57 <bool>false</bool> 58 </property> 59 <property name="frameShape" > 60 <enum>QFrame::NoFrame</enum> 61 </property> 62 <property name="frameShadow" > 63 <enum>QFrame::Plain</enum> 64 </property> 65 <property name="lineWidth" > 66 <number>1</number> 67 </property> 68 <property name="readOnly" > 69 <bool>true</bool> 70 </property> 71 <property name="backgroundVisible" > 72 <bool>false</bool> 73 </property> 74 <property name="centerOnScroll" > 75 <bool>false</bool> 76 </property> 77 </widget> 50 78 </item> 51 79 <item row="3" column="1" > … … 54 82 <string>Description:</string> 55 83 </property> 84 <property name="alignment" > 85 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> 86 </property> 56 87 </widget> 57 88 </item> 58 89 <item row="3" column="2" > 59 <widget class="QPlainTextEdit" name="description" /> 90 <widget class="QPlainTextEdit" name="description" > 91 <property name="frameShape" > 92 <enum>QFrame::NoFrame</enum> 93 </property> 94 <property name="frameShadow" > 95 <enum>QFrame::Plain</enum> 96 </property> 97 <property name="readOnly" > 98 <bool>true</bool> 99 </property> 100 </widget> 60 101 </item> 61 102 </layout> -
src/gui/mainwindow.ui
rc53a3f4 r395d6d3 1 <?xml version="1.0" encoding="UTF-8"?> 2 <ui version="4.0"> 1 <ui version="4.0" > 3 2 <class>MainWindow</class> 4 <widget class="QMainWindow" name="MainWindow" >5 <property name="geometry" >3 <widget class="QMainWindow" name="MainWindow" > 4 <property name="geometry" > 6 5 <rect> 7 6 <x>0</x> … … 11 10 </rect> 12 11 </property> 13 <property name="minimumSize" >12 <property name="minimumSize" > 14 13 <size> 15 14 <width>400</width> … … 17 16 </size> 18 17 </property> 19 <property name="windowTitle" >18 <property name="windowTitle" > 20 19 <string>MainWindow</string> 21 20 </property> 22 <widget class="QWidget" name="centralwidget" >23 <layout class="QGridLayout" name="gridLayout" >24 <item row="0" column="0" >25 <widget class="QTabWidget" name="tabWidget" >26 <property name="currentIndex" >27 <number> 1</number>21 <widget class="QWidget" name="centralwidget" > 22 <layout class="QGridLayout" name="gridLayout" > 23 <item row="0" column="0" > 24 <widget class="QTabWidget" name="tabWidget" > 25 <property name="currentIndex" > 26 <number>0</number> 28 27 </property> 29 <widget class="QWidget" name="dayViewTab" >30 <attribute name="title" >28 <widget class="QWidget" name="dayViewTab" > 29 <attribute name="title" > 31 30 <string>Day View</string> 32 31 </attribute> 33 <layout class="QGridLayout" name="gridLayout_2" >34 <item row="0" column="0" >35 <layout class="QVBoxLayout" name="verticalLayout" >32 <layout class="QGridLayout" name="gridLayout_2" > 33 <item row="0" column="0" > 34 <layout class="QVBoxLayout" name="verticalLayout" > 36 35 <item> 37 <widget class="DayNavigatorWidget" na me="dayNavigator" native="true"/>36 <widget class="DayNavigatorWidget" native="1" name="dayNavigator" /> 38 37 </item> 39 38 <item> 40 <widget class="TreeView" name="dayTreeView" >41 <property name="maximumSize" >39 <widget class="TreeView" name="dayTreeView" > 40 <property name="maximumSize" > 42 41 <size> 43 42 <width>16777215</width> … … 51 50 </layout> 52 51 </widget> 53 <widget class="QWidget" name="favouritesTab" >54 <attribute name="title" >52 <widget class="QWidget" name="favouritesTab" > 53 <attribute name="title" > 55 54 <string>Favourites</string> 56 55 </attribute> 57 <layout class="QGridLayout" name="gridLayout_3" >58 <item row="0" column="0" >59 <layout class="QVBoxLayout" name="verticalLayout_2" >56 <layout class="QGridLayout" name="gridLayout_3" > 57 <item row="0" column="0" > 58 <layout class="QVBoxLayout" name="verticalLayout_2" > 60 59 <item> 61 <widget class="DayNavigatorWidget" na me="favouriteDayNavigator" native="true"/>60 <widget class="DayNavigatorWidget" native="1" name="favouriteDayNavigator" /> 62 61 </item> 63 62 <item> 64 <widget class="TreeView" name="favTreeView" />63 <widget class="TreeView" name="favTreeView" /> 65 64 </item> 66 65 </layout> … … 68 67 </layout> 69 68 </widget> 70 <widget class="QWidget" name="activitiesTab" >71 <attribute name="title" >69 <widget class="QWidget" name="activitiesTab" > 70 <attribute name="title" > 72 71 <string>Activities</string> 73 72 </attribute> 74 <layout class="QGridLayout" name="gridLayout_4" >75 <item row="0" column="0" >76 <layout class="QVBoxLayout" name="activitiesVerticalLayout" >73 <layout class="QGridLayout" name="gridLayout_4" > 74 <item row="0" column="0" > 75 <layout class="QVBoxLayout" name="activitiesVerticalLayout" > 77 76 <item> 78 <widget class="DayNavigatorWidget" na me="activityDayNavigator" native="true"/>77 <widget class="DayNavigatorWidget" native="1" name="activityDayNavigator" /> 79 78 </item> 80 79 <item> 81 <widget class="TreeView" name="actTreeView" >82 <property name="maximumSize" >80 <widget class="TreeView" name="actTreeView" > 81 <property name="maximumSize" > 83 82 <size> 84 83 <width>16777215</width> … … 92 91 </layout> 93 92 </widget> 94 <widget class="QWidget" name="searchTab" >95 <attribute name="title" >93 <widget class="QWidget" name="searchTab" > 94 <attribute name="title" > 96 95 <string>Search</string> 97 96 </attribute> 98 97 </widget> 99 <widget class="QWidget" name="mapTab" >100 <attribute name="title" >98 <widget class="QWidget" name="mapTab" > 99 <attribute name="title" > 101 100 <string>Map</string> 102 101 </attribute> … … 106 105 </layout> 107 106 </widget> 108 <widget class="QMenuBar" name="menubar" >109 <property name="geometry" >107 <widget class="QMenuBar" name="menubar" > 108 <property name="geometry" > 110 109 <rect> 111 110 <x>0</x> 112 111 <y>0</y> 113 112 <width>531</width> 114 <height>2 4</height>113 <height>22</height> 115 114 </rect> 116 115 </property> 117 <widget class="QMenu" name="menuFile" >118 <property name="title" >116 <widget class="QMenu" name="menuFile" > 117 <property name="title" > 119 118 <string>File</string> 120 119 </property> 121 <addaction name="actionImportSchedule" />122 <addaction name="actionQuit" />120 <addaction name="actionImportSchedule" /> 121 <addaction name="actionQuit" /> 123 122 </widget> 124 <widget class="QMenu" name="menuAbout" >125 <property name="title" >123 <widget class="QMenu" name="menuAbout" > 124 <property name="title" > 126 125 <string>Help</string> 127 126 </property> 128 <addaction name="actionAboutQt" />129 <addaction name="actionAboutApplication" />127 <addaction name="actionAboutQt" /> 128 <addaction name="actionAboutApplication" /> 130 129 </widget> 131 <addaction name="menuAbout" />132 <addaction name="menuFile" />130 <addaction name="menuAbout" /> 131 <addaction name="menuFile" /> 133 132 </widget> 134 <widget class="QStatusBar" name="statusbar" />135 <action name="actionImportSchedule" >136 <property name="text" >133 <widget class="QStatusBar" name="statusbar" /> 134 <action name="actionImportSchedule" > 135 <property name="text" > 137 136 <string>Import Schedule</string> 138 137 </property> 139 138 </action> 140 <action name="actionAboutQt" >141 <property name="text" >139 <action name="actionAboutQt" > 140 <property name="text" > 142 141 <string>About Qt</string> 143 142 </property> 144 143 </action> 145 <action name="actionAboutApplication" >146 <property name="text" >144 <action name="actionAboutApplication" > 145 <property name="text" > 147 146 <string>About application</string> 148 147 </property> 149 148 </action> 150 <action name="actionQuit" >151 <property name="text" >149 <action name="actionQuit" > 150 <property name="text" > 152 151 <string>Quit</string> 153 152 </property> … … 175 174 <slot>close()</slot> 176 175 <hints> 177 <hint type="sourcelabel" >176 <hint type="sourcelabel" > 178 177 <x>-1</x> 179 178 <y>-1</y> 180 179 </hint> 181 <hint type="destinationlabel" >180 <hint type="destinationlabel" > 182 181 <x>266</x> 183 182 <y>187</y> -
src/mvc/event.cpp
rc53a3f4 r395d6d3 73 73 { 74 74 QSqlQuery query; 75 // TODO: conference ID isn't used here 75 76 query.prepare("SELECT name FROM room WHERE id = (SELECT xid_room FROM event_room WHERE xid_event = :id)"); 76 77 query.bindValue(":id", id()); … … 84 85 } 85 86 87 QStringList Event::persons() const 88 { 89 QSqlQuery query; 90 // TODO: conference ID isn't used here 91 query.prepare("SELECT person.name FROM person INNER JOIN event_person ON person.id = event_person.xid_person AND event_person.xid_event = :id"); 92 query.bindValue(":id", id()); 93 query.exec(); 94 // TODO: handle qeury error 95 //qDebug() << query.lastError(); 96 97 QStringList persons; 98 while(query.next()) 99 persons.append(query.record().value("name").toString()); 100 101 return persons; 102 } 103 86 104 void Event::setRoom(const QString &room) 87 105 { 106 Q_UNUSED(room); 107 88 108 qWarning("WARINING: setRoom() is NOT IMPLEMENTED YET"); 89 109 // TODO: implement 90 110 } 91 111 112 void Event::setPersons(const QStringList &persons) 113 { 114 Q_UNUSED(persons); 115 116 qWarning("WARINING: setPersons() is NOT IMPLEMENTED YET"); 117 // TODO: implement 118 } 119 -
src/mvc/event.h
rc53a3f4 r395d6d3 49 49 // records from other tables associated with 'id' 50 50 QString room() const; 51 QStringList persons() const; 51 52 52 53 // Table 1 … … 68 69 // records from other tables associated with 'id' 69 70 void setRoom(const QString& room); 71 void setPersons(const QStringList &persons); 70 72 71 73 friend class EventTest;
Note: See TracChangeset
for help on using the changeset viewer.