Limit the number of parameters in a variadic template parameter pack

Is it possible to make to compiler give an error if a template function with a parameter pack has the number of arguments higher than a compile-time determined value?

Yes, use static_assert:

template <class ...Args>
void setRequestArguments(const Args&... args)
{
    static_assert(sizeof...(args) <= 10, "You can't have more than 10 arguments!");
    //Stuff...
}

To make the function not callable when there's too many arguments, you can constraint the function with sfinae. That way, if there's another overload that accepts more arguments, the compiler will be able to select the correct overload.

A simple std::enable_if with the condition will suffice:

template <class ...Args, std::enable_if_t<(sizeof...(Args) <= 10)>* = nullptr>
void setRequestArguments(const Args&... args)
{
    const std::vector<QGenericArgument> vec = {args... };
}

For the sake of readability, you can put the constraint in the trailing return type of your function:

template <class ...Args>
auto setRequestArguments(const Args&... args) -> std::enable_if_t<(sizeof...(args) <= 10)>
{
    const std::vector<QGenericArgument> vec = {args... };
}

Here's an updated version for C++20 using requires and terse template syntax:

auto setRequestArguments(const auto&... args) requires (sizeof...(args) <= 10) -> void {
    const std::vector<QGenericArgument> vec = {args... };
}