Change t.MaxFPS in C++?

Is there a way to set the console variable t.MaxFPS in C++?

I have tried GEngine->GetWorld()->Exec(GEngine->GetWorld(), TEXT(“t.MaxFPS 60”)), it doesn’t work unfortunately.

Solved!

int fps = 60; 
IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("t.MaxFPS"));
CVar->Set(fps);

Does this work in a Shipping build?

Only two years after this question: But yes!

Just tested in a Shipped/Packaged game on both Windows and Android, and doing this approach has allowed me to set r.ShadowQuality.
(I tried doing sg.ShadowQuality, the actual property in GameUserSettings, but that doesn’t seem to either work, or work properly, or turn off ALL shadows - whereas being able to effect r.ShadowQuality does work)