Ignore:
Timestamp:
01/16/10 16:31:15 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
c790268
Parents:
8860ff4
Message:

work on favourite

  • created 'favourite' column in EVENT table
  • modified 'ormrecord' for setting record's elements
  • favourities view not implemented
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/delegate.cpp

    r8860ff4 r680a4da  
    8484
    8585        // draw Controls
    86         painter->drawImage(mControls[FavouriteControl]->drawPoint(option.rect),*mControls[FavouriteControl]->image());
    87         painter->drawImage(mControls[AlarmControl]->drawPoint(option.rect),*mControls[AlarmControl]->image());
     86        if(static_cast<Event*>(index.internalPointer())->isFavourite())
     87            painter->drawImage(mControls[FavouriteControlOn]->drawPoint(option.rect),*mControls[FavouriteControlOn]->image());
     88        else
     89            painter->drawImage(mControls[FavouriteControlOff]->drawPoint(option.rect),*mControls[FavouriteControlOff]->image());
     90        painter->drawImage(mControls[AlarmControlOn]->drawPoint(option.rect),*mControls[AlarmControlOn]->image());
    8891        painter->drawImage(mControls[MapControl]->drawPoint(option.rect),*mControls[MapControl]->image());
    8992    }
     
    201204{
    202205    Control *control;
    203     // FAVOURITE ICON
    204     control = new Control(FavouriteControl,QString(":icons/favourite-on.png"));
     206    // FAVOURITE ICONs
     207    // on
     208    control = new Control(FavouriteControlOn,QString(":icons/favourite-on.png"));
    205209    control->setDrawPoint(QPoint(-control->image()->width()-SPACER,SPACER));
    206     mControls.insert(FavouriteControl,control);
    207 
    208     // ALARM ICON
    209     control = new Control(AlarmControl,QString(":icons/alarm-on.png"));
    210     control->setDrawPoint(QPoint(-mControls[FavouriteControl]->image()->width()-control->image()->width()-2*SPACER,SPACER));
    211     mControls.insert(AlarmControl,control);
     210    mControls.insert(FavouriteControlOn,control);
     211    // off
     212    control = new Control(FavouriteControlOff,QString(":icons/favourite-off.png"));
     213    control->setDrawPoint(QPoint(-control->image()->width()-SPACER,SPACER));
     214    mControls.insert(FavouriteControlOff,control);
     215
     216    // ALARM ICONs
     217    // on
     218    control = new Control(AlarmControlOn,QString(":icons/alarm-on.png"));
     219    control->setDrawPoint(QPoint(-mControls[FavouriteControlOn]->image()->width()-control->image()->width()-2*SPACER,SPACER));
     220    mControls.insert(AlarmControlOn,control);
     221    // off
     222    control = new Control(AlarmControlOff,QString(":icons/alarm-off.png"));
     223    control->setDrawPoint(QPoint(-mControls[FavouriteControlOff]->image()->width()-control->image()->width()-2*SPACER,SPACER));
     224    mControls.insert(AlarmControlOff,control);
    212225
    213226    // MAP ICON
    214227    control = new Control(MapControl,QString(":icons/compass.png"));
    215     control->setDrawPoint(QPoint(-mControls[AlarmControl]->image()->width()-control->image()->width()
    216                                  -mControls[FavouriteControl]->image()->width()-3*SPACER,SPACER));
     228    control->setDrawPoint(QPoint(-mControls[AlarmControlOn]->image()->width()-control->image()->width()
     229                                 -mControls[FavouriteControlOn]->image()->width()-3*SPACER,SPACER));
    217230    mControls.insert(MapControl,control);
    218231}
Note: See TracChangeset for help on using the changeset viewer.