- Timestamp:
- 01/21/10 15:12:57 (13 years ago)
- Branches:
- master, qt5
- Children:
- e493054
- Parents:
- 6a807e7
- Location:
- src/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/mainwindow.cpp
r6a807e7 r9d8946b 46 46 connect(trackDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateTracksView(const QDate &))); 47 47 connect(favouriteDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateFavouritesView(const QDate &))); 48 connect(searchDayNavigator, SIGNAL(dateChanged(const QDate &)), SLOT(updateSearchView(const QDate &))); 48 49 49 50 // DAY EVENTS View … … 78 79 searchTreeView->setModel(new EventModel()); 79 80 searchTreeView->setItemDelegate(new Delegate(searchTreeView)); 80 searchTreeView->setVisible(false); 81 searchDayNavigator->setVisible(false); 81 82 82 // event clicked 83 83 connect(dayTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); … … 117 117 connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateTab(int))); 118 118 119 searchTreeView->hide(); 120 searchDayNavigator->hide(); 121 119 122 // open dialog for given Event ID 120 123 // this is used in case Alarm Dialog request application to start … … 209 212 } 210 213 break; 214 case 3: //index 3 of tabWidget: searchTab 215 { 216 updateSearchView( searchDayNavigator->getCurrentDate() ); 217 } 218 break; 211 219 default: 212 220 { … … 228 236 favTreeView->reset(); 229 237 favouriteDayNavigator->show(); 238 } 239 240 void MainWindow::updateSearchView(const QDate &aDate) 241 { 242 searchTreeView->reset(); 243 int eventsCount = static_cast<EventModel*>(searchTreeView->model())->loadSearchResultEvents(aDate,confId); 244 if( eventsCount ){ 245 searchDayNavigator->show(); 246 searchTreeView->show(); 247 } 248 else{ 249 searchTreeView->hide(); 250 searchDayNavigator->hide(); 251 } 230 252 } 231 253 … … 270 292 columns.append( "abstract" ); 271 293 272 searchTreeView->reset(); 273 if( mSqlEngine->searchEvent( confId, columns, searchEdit->text() ) > 0 ){ 274 static_cast<EventModel*>(searchTreeView->model())->loadSearchResultEvents(Conference::getById(confId).start(),confId); 275 searchDayNavigator->show(); 276 searchTreeView->show(); 277 } 278 } 279 294 mSqlEngine->searchEvent( confId, columns, searchEdit->text() ); 295 updateSearchView( Conference::getById(confId).start() ); 296 } 297 -
src/gui/mainwindow.h
r6a807e7 r9d8946b 25 25 void updateTracksView(const QDate &aDate); 26 26 void updateFavouritesView(const QDate &aDate); 27 void updateSearchView(const QDate &aDate); 27 28 void itemClicked(const QModelIndex &aIndex); 28 29 void displayMap(const QModelIndex &aIndex); -
src/gui/mainwindow.ui
r6a807e7 r9d8946b 96 96 </attribute> 97 97 <layout class="QVBoxLayout" name="verticalLayout_3"> 98 <item> 99 <layout class="QFormLayout" name="formLayout"> 100 <property name="fieldGrowthPolicy"> 101 <enum>QFormLayout::AllNonFixedFieldsGrow</enum> 102 </property> 103 <item row="0" column="0"> 104 <widget class="QCheckBox" name="searchTitle"> 105 <property name="text"> 106 <string>Title</string> 107 </property> 108 </widget> 109 </item> 110 <item row="0" column="1"> 111 <layout class="QHBoxLayout" name="horizontalLayout"> 112 <item> 113 <widget class="QLineEdit" name="searchEdit"> 114 <property name="enabled"> 115 <bool>true</bool> 116 </property> 117 <property name="toolTip"> 118 <string>type a keyword to search</string> 119 </property> 120 </widget> 121 </item> 122 <item> 123 <widget class="QPushButton" name="searchButton"> 124 <property name="text"> 125 <string>Search</string> 126 </property> 127 <property name="checkable"> 128 <bool>false</bool> 129 </property> 130 <property name="autoDefault"> 131 <bool>false</bool> 132 </property> 133 <property name="default"> 134 <bool>true</bool> 135 </property> 136 <property name="flat"> 137 <bool>false</bool> 138 </property> 139 </widget> 140 </item> 141 </layout> 142 </item> 143 <item row="1" column="0"> 144 <widget class="QCheckBox" name="searchAbstract"> 145 <property name="text"> 146 <string>Abstract</string> 147 </property> 148 </widget> 149 </item> 150 </layout> 151 </item> 152 <item> 153 <widget class="DayNavigatorWidget" name="searchDayNavigator" native="true"> 154 <property name="maximumSize"> 155 <size> 156 <width>16777215</width> 157 <height>16777215</height> 158 </size> 159 </property> 160 </widget> 161 </item> 162 <item> 163 <widget class="TreeView" name="searchTreeView"> 164 <property name="maximumSize"> 165 <size> 166 <width>16777215</width> 167 <height>16777215</height> 168 </size> 169 </property> 170 </widget> 171 </item> 172 </layout> 98 <item> 99 <layout class="QFormLayout" name="searchHeadLayout"> 100 <property name="fieldGrowthPolicy"> 101 <enum>QFormLayout::AllNonFixedFieldsGrow</enum> 102 </property> 103 <item row="0" column="0"> 104 <widget class="QCheckBox" name="searchTitle"> 105 <property name="text"> 106 <string>Title</string> 107 </property> 108 </widget> 109 </item> 110 <item row="0" column="1"> 111 <layout class="QHBoxLayout" name="horizontalLayout"> 112 <item> 113 <widget class="QLineEdit" name="searchEdit"> 114 <property name="enabled"> 115 <bool>true</bool> 116 </property> 117 <property name="toolTip"> 118 <string>type a keyword to search</string> 119 </property> 120 </widget> 121 </item> 122 <item> 123 <widget class="QPushButton" name="searchButton"> 124 <property name="text"> 125 <string>Search</string> 126 </property> 127 <property name="checkable"> 128 <bool>false</bool> 129 </property> 130 <property name="autoDefault"> 131 <bool>false</bool> 132 </property> 133 <property name="default"> 134 <bool>true</bool> 135 </property> 136 <property name="flat"> 137 <bool>false</bool> 138 </property> 139 </widget> 140 </item> 141 </layout> 142 </item> 143 <item row="1" column="0"> 144 <widget class="QCheckBox" name="searchAbstract"> 145 <property name="text"> 146 <string>Abstract</string> 147 </property> 148 </widget> 149 </item> 150 </layout> 151 </item> 152 <item> 153 <layout class="QHBoxLayout" name="searchDayNavigatorHorizontalLayout"> 154 <item> 155 <spacer name="horizontalSpacer_2"> 156 <property name="orientation"> 157 <enum>Qt::Horizontal</enum> 158 </property> 159 <property name="sizeHint" stdset="0"> 160 <size> 161 <width>40</width> 162 <height>20</height> 163 </size> 164 </property> 165 </spacer> 166 </item> 167 <item> 168 <widget class="DayNavigatorWidget" name="searchDayNavigator" native="true"> 169 <property name="maximumSize"> 170 <size> 171 <width>16777215</width> 172 <height>16777215</height> 173 </size> 174 </property> 175 </widget> 176 </item> 177 <item> 178 <spacer name="horizontalSpacer"> 179 <property name="orientation"> 180 <enum>Qt::Horizontal</enum> 181 </property> 182 <property name="sizeHint" stdset="0"> 183 <size> 184 <width>40</width> 185 <height>20</height> 186 </size> 187 </property> 188 </spacer> 189 </item> 190 </layout> 191 </item> 192 <item> 193 <widget class="TreeView" name="searchTreeView"> 194 <property name="maximumSize"> 195 <size> 196 <width>16777215</width> 197 <height>16777215</height> 198 </size> 199 </property> 200 </widget> 201 </item> 202 </layout> 173 203 </widget> 174 204 <widget class="QWidget" name="mapTab" >
Note: See TracChangeset
for help on using the changeset viewer.