44 ,
public QGraphicsItem
47 SCORE_GRAPHICS_ITEM_TYPE(300)
53 void setColumns(std::vector<ValueListColumn> cols);
54 const std::vector<ValueListColumn>& columns()
const noexcept {
return m_columns; }
55 void setCountRange(
int min,
int max);
56 void setItemsPerLine(
int n);
58 void setValue(
const ossia::value& v);
59 ossia::value value()
const;
61 QString toText()
const;
63 bool setText(
const QString& text);
70 QRectF boundingRect()
const override;
74 void sliderMoved() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sliderMoved)
76 void sliderReleased() E_SIGNAL(SCORE_LIB_BASE_EXPORT, sliderReleased)
78 void edited() E_SIGNAL(SCORE_LIB_BASE_EXPORT, edited)
79 void sizeChanged(QSizeF sz) E_SIGNAL(SCORE_LIB_BASE_EXPORT, sizeChanged, sz)
82 using Row =
std::vector<
double>;
84 bool scalar() const noexcept {
return m_columns.size() == 1; }
85 int maxCount() const noexcept;
86 Row defaultRow() const;
87 Row clampRow(Row r) const;
91 void structuralEdit();
94 int rowAt(QPointF p) const noexcept;
95 QRectF cellRect(
int row,
int col) const noexcept;
96 QRectF removeRect(
int row) const noexcept;
97 QRectF addRect() const noexcept;
98 QRectF popRect() const noexcept;
99 qreal headerHeight() const noexcept;
100 qreal columnWidth(
int col) const noexcept;
102 void insertRow(
int at, Row r);
103 void removeRow(
int row);
104 void moveRow(
int row,
int dir);
106 void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
107 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
108 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) override;
109 void contextMenuEvent(QGraphicsSceneContextMenuEvent* event) override;
110 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
114 std::vector<Row> m_rows;
115 std::vector<std::vector<QGraphicsItem*>> m_cells;
119 int m_itemsPerLine{4};