Skip to content
Snippets Groups Projects
Commit d1d8b92b authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Use qobject_cast on TimelineItem

parent 5e3022bd
No related branches found
No related tags found
No related merge requests found
...@@ -374,7 +374,7 @@ TimelineView::addTimelineItem(TimelineItem *item, TimelineDirection direction) ...@@ -374,7 +374,7 @@ TimelineView::addTimelineItem(TimelineItem *item, TimelineDirection direction)
if (direction == TimelineDirection::Bottom) { if (direction == TimelineDirection::Bottom) {
const auto lastItemPosition = scroll_layout_->count() - 1; const auto lastItemPosition = scroll_layout_->count() - 1;
auto lastItem = auto lastItem =
static_cast<TimelineItem *>(scroll_layout_->itemAt(lastItemPosition)->widget()); qobject_cast<TimelineItem *>(scroll_layout_->itemAt(lastItemPosition)->widget());
if (lastItem) { if (lastItem) {
auto oldDate = lastItem->descriptionMessage().datetime; auto oldDate = lastItem->descriptionMessage().datetime;
...@@ -389,7 +389,7 @@ TimelineView::addTimelineItem(TimelineItem *item, TimelineDirection direction) ...@@ -389,7 +389,7 @@ TimelineView::addTimelineItem(TimelineItem *item, TimelineDirection direction)
// the widgets to the bottom of the page. // the widgets to the bottom of the page.
if (scroll_layout_->count() > 1) { if (scroll_layout_->count() > 1) {
auto firstItem = auto firstItem =
static_cast<TimelineItem *>(scroll_layout_->itemAt(1)->widget()); qobject_cast<TimelineItem *>(scroll_layout_->itemAt(1)->widget());
if (firstItem) { if (firstItem) {
auto oldDate = firstItem->descriptionMessage().datetime; auto oldDate = firstItem->descriptionMessage().datetime;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment