Thus, they are only "near" omnipotent.
This would
Not only is Q far older (2000 years old, twice Thanos' age), he is FAR more experienced with such cosmic powers. Thanos has only has such powers for a short amount of time with the infinity gauntlet.
Another thing we have to consider is the Gauntlet
Personally, I think Q will assess the situation with his powers, use them to recognize the source of Thanos' powers, and after a short clash...snap the gauntlet away.
Thus, I conclude: