Changeset 59c6cfe for src


Ignore:
Timestamp:
01/18/10 22:32:44 (13 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
446bce4
Parents:
c18cbd0
Message:

started work on displaying map

  • implemented mapwindow
  • map is hard-coded for now

TODO: finish getting map path from the event

Location:
src
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • src/gui/gui.pro

    rc18cbd0 r59c6cfe  
    2727         daynavigatorwidget.ui \
    2828         about.ui \
    29          eventdialog.ui
     29         eventdialog.ui \
     30         mapwindow.ui
    3031
    3132HEADERS += mainwindow.h \
    3233           daynavigatorwidget.h \
    33            eventdialog.h
     34           eventdialog.h \
     35           mapwindow.h
    3436
    3537SOURCES += mainwindow.cpp \
    3638           daynavigatorwidget.cpp \
    37            eventdialog.cpp
     39           eventdialog.cpp \
     40           mapwindow.cpp
    3841
    3942maemo {
  • src/gui/mainwindow.cpp

    rc18cbd0 r59c6cfe  
    1616#include "eventdialog.h"
    1717#include "daynavigatorwidget.h"
     18#include "mapwindow.h"
    1819
    1920MainWindow::MainWindow(QWidget *parent)
     
    6465    actTreeView->setItemDelegate(new Delegate(actTreeView));
    6566
     67    // event double clicked
    6668    connect(dayTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
    6769    connect(favTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
    6870    connect(actTreeView, SIGNAL(doubleClicked(const QModelIndex &)), SLOT(itemDoubleClicked(const QModelIndex &)));
     71    // request for map to be displayed
     72    connect(dayTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     73    connect(favTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     74    connect(actTreeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));
     75
    6976
    7077    // TESTING: load some 'fav' data
     
    113120    if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
    114121    {
    115         QString currPath = QDir::currentPath();
    116         qDebug() << "current path: " << currPath;
    117122        qDebug() << "can't open " << file.fileName();
    118123        return;
     
    192197}
    193198
     199void MainWindow::displayMap(const QModelIndex &aIndex)
     200{
     201    QPixmap map(":/maps/rooms/janson.png");
     202    MapWindow window(map,this);
     203    window.exec();
     204}
     205
  • src/gui/mainwindow.h

    rc18cbd0 r59c6cfe  
    2424    void updateActivitiesDayView(const QDate &aDate);
    2525    void itemDoubleClicked(const QModelIndex &aIndex);
     26    void displayMap(const QModelIndex &aIndex);
    2627private:
    2728    SqlEngine *mSqlEngine;
  • src/mvc/eventmodel.cpp

    rc18cbd0 r59c6cfe  
    6262            mGroups.last().mChildCount = i - mGroups.last().mFirstEventIndex;
    6363            mGroups << EventModel::Group(QString("activity %1").arg(activityId), 0);
    64             int nextActivityId = activityId;
     64            //int nextActivityId = activityId;
    6565        }
    6666        // add parent-child relation
     
    151151        Group group = mGroups[i];
    152152        beginRemoveRows(idx, 0, group.mChildCount - 1);
    153         bool ok = removeRows(0, group.mChildCount, idx);
     153        /*bool ok =*/ removeRows(0, group.mChildCount, idx);
    154154        endRemoveRows();
    155155        //qDebug() << "removing " << group.mChildCount << " events from group:" << i << idx.data() << ":" << ok;
  • src/mvc/treeview.cpp

    rc18cbd0 r59c6cfe  
    8080                // handle Alarm Control clicked
    8181                qDebug() << "MAP CLICKED: " << qVariantValue<QString>(aIndex.data());
     82                emit(requestForMap(aIndex));
    8283            }
    8384        break;
  • src/mvc/treeview.h

    rc18cbd0 r59c6cfe  
    44#include <QTreeView>
    55
    6 
    76class TreeView : public QTreeView
    87{
     8    Q_OBJECT
    99public:
    1010    TreeView(QWidget *aParent = NULL);
     
    1313    void mouseReleaseEvent(QMouseEvent *aEvent);
    1414    void testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint);
     15signals:
     16    void requestForMap(const QModelIndex &aIndex);
    1517};
    1618
Note: See TracChangeset for help on using the changeset viewer.