| 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. |
| 685 | template <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 | |
| 707 | void playlistItemOverlay::clear(int startRow) |
| 708 | { |
nothing calls this directly
no test coverage detected