• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ossia / score / 40815790952

29 Oct 2026 04:05AM UTC coverage: 50.888% (+1.7%) from 49.183%
40815790952

Pull #2361

github

web-flow
Merge 996cd0c5d into b3ba4155e
Pull Request #2361: MIDI effects, audio and MIDI loopers, MIDI sync

176299 of 346447 relevant lines covered (50.89%)

166790.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.14
/src/plugins/score-plugin-dataflow/Dataflow/WidgetInletFactory.cpp
1
#include "WidgetInletFactory.hpp"
2

3
#include <score/graphics/widgets/QGraphicsValueList.hpp>
4

5
#include <QGraphicsScene>
6
#include <QGraphicsView>
7

8
#include <cmath>
9

10
namespace Dataflow
11
{
12

13
QWidget* makeGraphicsViewForInspectorItem(QGraphicsItem* item, QWidget* parent)
2,572 ✔
14
{
15
  auto s = new QGraphicsScene;
2,572 ✔
16
  auto widg = new QGraphicsView(s, parent);
2,572 ✔
17
  s->setParent(widg);
2,572 ✔
18
  widg->setMinimumWidth(item->boundingRect().width());
2,572 ✔
19
  widg->setMinimumHeight(item->boundingRect().height());
2,572 ✔
20
  // The form layout of the inspector gives extra height to expanding widgets:
21
  // the view is exactly as tall as its item.
22
  widg->setMaximumHeight(std::ceil(item->boundingRect().height()));
2,572 ✔
23
  widg->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
2,572 ✔
24
  widg->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
2,572 ✔
25
  widg->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
2,572 ✔
26

27
  widg->setAlignment(Qt::AlignTop | Qt::AlignLeft);
2,572 ✔
28
  widg->setFrameStyle(0);
2,572 ✔
29
  widg->setDragMode(QGraphicsView::NoDrag);
2,572 ✔
30
  widg->setAcceptDrops(true);
2,572 ✔
31
  widg->setFocusPolicy(Qt::WheelFocus);
2,572 ✔
32
  widg->setRenderHints(
5,144 ✔
33
      QPainter::Antialiasing | QPainter::SmoothPixmapTransform
2,572 ✔
34
      | QPainter::TextAntialiasing);
2,572 ✔
35

36
#if !defined(__EMSCRIPTEN__)
37
  widg->setOptimizationFlag(QGraphicsView::DontSavePainterState, true);
2,572 ✔
38
  widg->setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing, true);
2,572 ✔
39
  // widg->setAttribute(Qt::WA_PaintOnScreen, false);
40
  // widg->setAttribute(Qt::WA_OpaquePaintEvent, true);
41
  // widg->viewport()->setAttribute(Qt::WA_OpaquePaintEvent, true);
42
#endif
43
  s->addItem(item);
2,572 ✔
44
  widg->centerOn(item);
2,572 ✔
45

46
  // Lists grow and shrink with their rows: the view follows
47
  if(auto list = qgraphicsitem_cast<score::QGraphicsValueList*>(item))
2,572 ✔
48
  {
49
    QObject::connect(list, &score::QGraphicsValueList::sizeChanged, widg, [widg, s, list] {
860 ✔
50
      const QRectF r = list->boundingRect();
50 ✔
51
      s->setSceneRect(r);
50 ✔
52
      widg->setMinimumWidth(r.width());
50 ✔
53
      widg->setMinimumHeight(r.height());
50 ✔
54
      widg->setMaximumHeight(std::ceil(r.height()));
50 ✔
55
      widg->updateGeometry();
50 ✔
56
    });
50 ✔
57
    s->setSceneRect(list->boundingRect());
810 ✔
58
  }
810 ✔
59
  return widg;
2,572 ✔
60
}
×
61

62
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc