Ignore:
Timestamp:
01/20/10 15:50:12 (12 years ago)
Author:
timkoma <timkoma@…>
Branches:
master, qt5
Children:
f2ef735
Parents:
b1a201a
Message:

temp commit for search tab

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    rb1a201a r990afd5  
    7171    actTreeView->setItemDelegate(new Delegate(actTreeView));
    7272
     73    // DAY EVENTS View
     74        searchTreeView->setHeaderHidden(true);
     75        searchTreeView->setRootIsDecorated(false);
     76        searchTreeView->setIndentation(0);
     77        searchTreeView->setAnimated(true);
     78        searchTreeView->setModel(new EventModel());
     79        searchTreeView->setItemDelegate(new Delegate(searchTreeView));
     80        searchTreeView->setVisible(false);
     81        searchDayNavigator->setVisible(false);
    7382    // event clicked
    7483    connect(dayTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    7584    connect(favTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
    7685    connect(actTreeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &)));
     86    connect(searchTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
    7787    // request for map to be displayed
    7888    connect(dayTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
    7989    connect(favTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
    8090    connect(actTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
    81 
     91    connect(searchTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     92    // event search button clicked
     93    connect(searchButton, SIGNAL(clicked()), SLOT(searchClicked()));
    8294
    8395    // TESTING: load some 'fav' data
     
    241253    window.exec();
    242254}
     255
     256void MainWindow::searchClicked()
     257{
     258    QList<QString> columns;
     259
     260    if( searchTitle->isChecked() )
     261        columns.append( "title" );
     262    if( searchAbstract->isChecked() )
     263        columns.append( "abstract" );
     264
     265    if( mSqlEngine->searchEvent( confId, columns, searchEdit->text() ) > 0 ){
     266        searchTreeView->setVisible(true);
     267        searchDayNavigator->setVisible(true);
     268    }
     269}
     270
Note: See TracChangeset for help on using the changeset viewer.