Maybe:

Q_INVOKABLE void sortByAttachment(int order = static_cast<int>(Qt::DescendingOrder));