rock_widget_collection  0.1
Public Member Functions | List of all members
StreamAlignerDelegate Class Reference

Inherits QStyledItemDelegate.

Public Member Functions

void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
 

Detailed Description

Definition at line 340 of file StreamAlignerWidget.cpp.

Member Function Documentation

◆ paint()

void StreamAlignerDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
inline

Definition at line 343 of file StreamAlignerWidget.cpp.

345  {
346  if (index.column() == 1 && index.data(BufferSize).toInt()) {
347  int bSize = index.data(BufferSize).toInt();
348  int bFill = index.data(BufferFill).toInt();
349 
350  QStyleOptionProgressBar progressBarOption;
351  progressBarOption.rect = option.rect;
352  progressBarOption.minimum = 0;
353  progressBarOption.maximum = bSize;
354  progressBarOption.progress = bFill;
355  progressBarOption.text = QString::number(bFill) + " / " + QString::number(bSize);
356  progressBarOption.textVisible = true;
357 
358  QApplication::style()->drawControl(QStyle::CE_ProgressBar,
359  &progressBarOption, painter);
360  } else
361  QStyledItemDelegate::paint(painter, option, index);
362  }

The documentation for this class was generated from the following file: