Ignore:
Timestamp:
01/18/10 20:42:57 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
46a5aba
Parents:
64122f1
Message:

implemented 'Event' dialog to display relevant
'Event's info

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    r64122f1 r707cd31  
    1414#include <QDialog>
    1515#include "ui_about.h"
     16#include "eventdialog.h"
    1617#include "daynavigatorwidget.h"
    1718
     
    5657
    5758    //ACTIVITIES View
    58     activityDayTreeView->setHeaderHidden(true);
    59     activityDayTreeView->setRootIsDecorated(false);
    60     activityDayTreeView->setIndentation(0);
    61     activityDayTreeView->setAnimated(true);
    62     activityDayTreeView->setModel(new EventModel());
    63     activityDayTreeView->setItemDelegate(new Delegate(activityDayTreeView));
     59    actTreeView->setHeaderHidden(true);
     60    actTreeView->setRootIsDecorated(false);
     61    actTreeView->setIndentation(0);
     62    actTreeView->setAnimated(true);
     63    actTreeView->setModel(new EventModel());
     64    actTreeView->setItemDelegate(new Delegate(actTreeView));
     65
     66    connect(dayTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
     67    connect(favTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
     68    connect(actTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
    6469
    6570    // TESTING: load some 'fav' data
     
    172177{
    173178    int confId = 1;
    174     static_cast<EventModel*>(activityDayTreeView->model())->loadEventsByActivities(aDate,confId);
    175     activityDayTreeView->reset();
     179    static_cast<EventModel*>(actTreeView->model())->loadEventsByActivities(aDate,confId);
     180    actTreeView->reset();
    176181    activityDayNavigator->show();
    177182}
     183
     184void MainWindow::itemDoubleClicked(const QModelIndex &aIndex)
     185{
     186    // have to handle only events, not time-groups
     187    if(!aIndex.parent().isValid()) // time-group
     188        return;
     189
     190    EventDialog dialog(aIndex,this);
     191    dialog.exec();
     192}
     193
Note: See TracChangeset for help on using the changeset viewer.