Advertisement
VRonin

Roles check

Oct 23rd, 2018
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. if (!roles.isEmpty()) {
  2.     const int relevantRoles[] = {Qt::DisplayRole, Qt::DecorationRole, Qt::SizeHintRole, Qt::FontRole};
  3.     if (!std::any_of(roles.cbegin(), roles.cend(), [&relevantRoles](int role) -> bool {return std::find(std::begin(relevantRoles), std::end(relevantRoles), role) != std::end(relevantRoles);})
  4.         return;
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement