Ignore:
Timestamp:
01/21/10 16:39:43 (12 years ago)
Author:
fortefr <fortefr@…>
Branches:
master, qt5
Children:
76cde75
Parents:
a957cfa
Message:

Warning handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/delegate.cpp

    ra957cfa r3f3e22d  
    136136        //if(static_cast<Event*>(index.internalPointer())->hasTimeConflict())
    137137        if(bkgrColor == Qt::yellow)
     138        {
    138139            painter->drawImage(mControls[WarningControlOn]->drawPoint(option.rect),*mControls[WarningControlOn]->image());
     140            mControls[WarningControlOn]->hasConflict=true;
     141        }
    139142        else
     143        {
    140144            painter->drawImage(mControls[WarningControlOff]->drawPoint(option.rect),*mControls[WarningControlOff]->image());
     145            mControls[WarningControlOn]->hasConflict=false;
     146        }
    141147
    142148        // draw texts
     
    310316    {
    311317        ControlId id = i.next();
    312         if(mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint))
     318        if((mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint))
     319            && (id != WarningControlOn) && (id != WarningControlOff))
     320        {
    313321            return id;
     322        }
     323        else
     324        {
     325            if ((mControls[id]->drawRect(static_cast<QTreeView*>(parent())->visualRect(aIndex)).contains(aPoint))
     326            && (mControls[id]->hasConflict))
     327            {
     328            return id;
     329            }
     330        }
    314331    }
    315332
     
    369386    control = new Control(WarningControlOn,QString(":icons/exclamation-iconOn.png"));
    370387    p = mControls[MapControl]->drawPoint();
     388    control->hasConflict = false;
    371389    p.setX(p.x()-control->image()->width()-SPACER);
    372390    control->setDrawPoint(p);
     
    375393    control = new Control(WarningControlOff,QString(":icons/exclamation-iconOff.png"));
    376394    p = mControls[MapControl]->drawPoint();
     395    control->hasConflict = false;
    377396    p.setX(p.x()-control->image()->width()-SPACER);
    378397    control->setDrawPoint(p);
Note: See TracChangeset for help on using the changeset viewer.