void PaintArea::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::RightButton) _right = true; else _right = false; if (_tool != 0) { _redo.clear(); emit noRedo(); } if (_isselect) { Undo(); _isselect = false; emit noCopy(); } lastPoint = event->pos(); if (_tool == 7) { _history.push_back(image); emit enableUndo(); drawWord(lastPoint); } else if (_tool == 6) { _history.push_back(image); emit enableUndo(); drawBucket(event->pos()); } else if (_tool == 10) { _history.push_back(image); emit enableUndo(); Paste(event->pos()); } else if (_tool == 12) { if (event->button() == Qt::LeftButton) zoomIn(); else zoomOut(); } else { _history.push_back(image); emit enableUndo(); _scroll = image; scribbling = true; if (_tool == 1) drawLineTo(event->pos()); else if (_tool == 2) drawEraser(event->pos()); else if (_tool == 11) drawSpray(event->pos()); } }
void CThermoMeterItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { painter->save(); resetDrawingVariables(painter); drawBackground(painter); drawMark(painter); drawBucket(painter); drawGraph(painter); painter->restore(); }