fix clanzy issue "src/mainwidget.cpp 676:64: warning: Don't call QList::last() on temporary [clazy-detaching-temporary]"