if (!scene)
return;
- connect(_scene, SIGNAL(destroyed()), this, SLOT(sceneDestroyed()));
- connect(_scene, SIGNAL(layoutChanged()), this, SLOT(repositionHighlights()));
- connect(Client::messageModel(), SIGNAL(finishedBacklogFetch(BufferId)), this, SLOT(updateHighlights()));
+ connect(_scene, &QObject::destroyed, this, &ChatViewSearchController::sceneDestroyed);
+ connect(_scene, &ChatScene::layoutChanged, this, [this]() { repositionHighlights(); });
+ connect(Client::messageModel(), &MessageModel::finishedBacklogFetch, this, [this]() { updateHighlights(); });
updateHighlights();
}
if (reuse) {
QSet<ChatLine *> chatLines;
foreach(SearchHighlightItem *highlightItem, _highlightItems) {
- ChatLine *line = qgraphicsitem_cast<ChatLine *>(highlightItem->parentItem());
+ auto *line = qgraphicsitem_cast<ChatLine *>(highlightItem->parentItem());
if (line)
chatLines << line;
}
int start = 0; int end = _highlightItems.count() - 1;
QPointF startPos;
QPointF endPos;
- while (1) {
+ while (true) {
startPos = _highlightItems[start]->scenePos();
endPos = _highlightItems[end]->scenePos();
if (startPos == oldHighlightPos) {
}
foreach(QGraphicsItem *child, line->childItems()) {
- SearchHighlightItem *highlightItem = qgraphicsitem_cast<SearchHighlightItem *>(child);
+ auto *highlightItem = qgraphicsitem_cast<SearchHighlightItem *>(child);
if (!highlightItem)
continue;
{
QSet<ChatLine *> chatLines;
foreach(SearchHighlightItem *item, _highlightItems) {
- ChatLine *line = qgraphicsitem_cast<ChatLine *>(item->parentItem());
+ auto *line = qgraphicsitem_cast<ChatLine *>(item->parentItem());
if (line)
chatLines << line;
}
{
QList<SearchHighlightItem *> searchHighlights;
foreach(QGraphicsItem *child, line->childItems()) {
- SearchHighlightItem *highlightItem = qgraphicsitem_cast<SearchHighlightItem *>(child);
+ auto *highlightItem = qgraphicsitem_cast<SearchHighlightItem *>(child);
if (highlightItem)
searchHighlights << highlightItem;
}
setPos(wordRect.x(), wordRect.y());
updateGeometry(wordRect.width(), wordRect.height());
- connect(&_timeLine, SIGNAL(valueChanged(qreal)), this, SLOT(updateHighlight(qreal)));
+ connect(&_timeLine, &QTimeLine::valueChanged, this, &SearchHighlightItem::updateHighlight);
}