MCPcopy Create free account
hub / github.com/IENT/YUView / widgetAt

Function widgetAt

YUViewLib/src/playlistitem/playlistItemOverlay.cpp:685–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

683// Returns a possibly new widget at given row and column, having a set column span.
684// Any existing widgets of other types or other span will be removed.
685template <typename W> static W *widgetAt(QGridLayout *grid, int row, int column)
686{
687 Q_ASSERT(grid->columnCount() <= 3);
688 QPointer<QWidget> widgets[3];
689 for (int j = 0; j < grid->columnCount(); ++j)
690 {
691 auto item = grid->itemAtPosition(row, j);
692 if (item)
693 widgets[j] = item->widget();
694 }
695
696 auto widget = qobject_cast<W *>(widgets[column]);
697 if (!widget)
698 {
699 // There may be an incompatible widget there.
700 delete widgets[column];
701 widget = new W;
702 grid->addWidget(widget, row, column, 1, 1);
703 }
704 return widget;
705}
706
707void playlistItemOverlay::clear(int startRow)
708{

Callers

nothing calls this directly

Calls 1

columnCountMethod · 0.80

Tested by

no test coverage detected