Changeset f2ef735 for src/mvc


Ignore:
Timestamp:
01/20/10 16:16:10 (12 years ago)
Author:
fortefr <fortefr@…>
Branches:
master, qt5
Children:
d4a8bbf
Parents:
990afd5
Message:

Warning icon (uncompleted)

Location:
src/mvc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/delegate.cpp

    r990afd5 rf2ef735  
    124124        // map
    125125        painter->drawImage(mControls[MapControl]->drawPoint(option.rect),*mControls[MapControl]->image());
     126        // Time conflict
     127        if(static_cast<Event*>(index.internalPointer())->hasTimeConflict())
     128            painter->drawImage(mControls[WarningControlOn]->drawPoint(option.rect),*mControls[WarningControlOn]->image());
     129        else
     130            painter->drawImage(mControls[WarningControlOff]->drawPoint(option.rect),*mControls[WarningControlOff]->image());
    126131
    127132        // draw texts
     
    338343    control->setDrawPoint(p);
    339344    mControls.insert(MapControl,control);
     345
     346    // WARNING ICONs
     347    // on
     348    control = new Control(WarningControlOn,QString(":icons/exclamation-iconOn.png"));
     349    p = mControls[MapControl]->drawPoint();
     350    p.setX(p.x()-control->image()->width()-SPACER);
     351    control->setDrawPoint(p);
     352    mControls.insert(WarningControlOn,control);
     353    // off
     354    control = new Control(WarningControlOff,QString(":icons/exclamation-iconOff.png"));
     355    p = mControls[MapControl]->drawPoint();
     356    p.setX(p.x()-control->image()->width()-SPACER);
     357    control->setDrawPoint(p);
     358    mControls.insert(WarningControlOff,control);
    340359}
    341360
  • src/mvc/delegate.h

    r990afd5 rf2ef735  
    1919            AlarmControlOn,
    2020            AlarmControlOff,
    21             MapControl
     21            MapControl,
     22            WarningControlOn,
     23            WarningControlOff
    2224        };
    2325
  • src/mvc/event.h

    r990afd5 rf2ef735  
    4141    bool isFavourite() const { return value("favourite").toBool(); }
    4242    bool hasAlarm() const { return value("alarm").toBool(); }
     43    bool hasTimeConflict() const { return true; /*return value("warning").toBool()*/; } //TODO
    4344    // Table 2 : virtual table for FTS (Full Text Search)
    4445    QString tag() const { return value("tag").toString(); }
Note: See TracChangeset for help on using the changeset viewer.