void DigitalSignalsWidget::paintChannels(QPainter& p, int i0, int i1) { i1 = qMin(i1, m_data.size()); paintChannel(p, 0x01, 20, QColor(0x00, 0x80, 0x20), i0, i1); paintChannel(p, 0x02, 40, Qt::red, i0, i1); }
void ChannelItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const { const int itemType = index.data(ChannelModel::ItemTypeRole).toInt(); if (itemType == ChannelModel::ItemChannel) paintChannel(painter, option, index); else if (itemType == ChannelModel::ItemAggregate) paintAggregate(painter, option, index); else if (itemType == ChannelModel::ItemUnwatched) paintUnwatched(painter, option, index); else QStyledItemDelegate::paint(painter, option, index); }
void AudioVisualiserComponent::paint (Graphics& g) { g.fillAll (backgroundColour); Rectangle<float> r (getLocalBounds().toFloat()); const float channelHeight = r.getHeight() / channels.size(); g.setColour (waveformColour); for (int i = 0; i < channels.size(); ++i) { const ChannelInfo& c = *channels.getUnchecked(i); paintChannel (g, r.removeFromTop (channelHeight), c.levels.begin(), c.levels.size(), c.nextSample); } }