bool FrameAttributes::operator==( const FrameAttributes& r ) const { return ( isVisible() == r.isVisible() && pen() == r.pen() && cornerRadius() == r.cornerRadius() && padding() == r.padding() ); }
bool FrameAttributes::operator==( const FrameAttributes& r ) const { /* qDebug() << "FrameAttributes:" << (isVisible() == r.isVisible()) << (pen() == r.pen()) << (padding() == r.padding()) << "\n"; */ return ( isVisible() == r.isVisible() && pen() == r.pen() && padding() == r.padding() ); }
void markPeak(Plotter* p, const QModelIndex& peak, quint64 cost, const KColorScheme& scheme) { QBrush brush = p->model()->data(peak, DatasetBrushRole).value<QBrush>(); QColor outline = brush.color(); QColor foreground = scheme.foreground().color(); QBrush background = scheme.background(); DataValueAttributes dataAttributes = p->dataValueAttributes(peak); dataAttributes.setDataLabel(prettyCost(cost)); dataAttributes.setVisible(true); dataAttributes.setShowRepetitiveDataLabels(true); dataAttributes.setShowOverlappingDataLabels(false); FrameAttributes frameAttrs = dataAttributes.frameAttributes(); QPen framePen(outline); framePen.setWidth(2); frameAttrs.setPen(framePen); frameAttrs.setVisible(true); dataAttributes.setFrameAttributes(frameAttrs); MarkerAttributes a = dataAttributes.markerAttributes(); a.setMarkerSize(QSizeF(7, 7)); a.setPen(outline); a.setMarkerStyle(KChart::MarkerAttributes::MarkerDiamond); a.setVisible(true); dataAttributes.setMarkerAttributes(a); TextAttributes txtAttrs = dataAttributes.textAttributes(); txtAttrs.setPen(foreground); txtAttrs.setFontSize(Measure(12)); dataAttributes.setTextAttributes(txtAttrs); BackgroundAttributes bkgAtt = dataAttributes.backgroundAttributes(); bkgAtt.setBrush(background); bkgAtt.setVisible(true); dataAttributes.setBackgroundAttributes(bkgAtt); p->setDataValueAttributes(peak, dataAttributes); }