There is no way to elevate your privileges once you start the process. However, you can require for higher privileges when starting a new process. As you're on Windows, just use ShellExecuteEx and set runas in lpVerb field of SHELLEXECUTEINFO:
SHELLEXECUTEINFO shExInfo = {0};
shExInfo.cbSize = sizeof(shExInfo);
shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
shExInfo.hwnd = 0;
shExInfo.lpVerb = _T("runas"); // Operation to perform
shExInfo.lpFile = _T("regsvr32.exe"); // Application to start
shExInfo.lpParameters = _T("npmyplugin.dll"); // Additional parameters
shExInfo.lpDirectory = 0;
shExInfo.nShow = SW_SHOW;
shExInfo.hInstApp = 0;
ShellExecuteEx(&shExInfo);
return 0;
To use this in a Qt application, just #include <windows.h> and make sure include and lib variables are set properly for the Windows SDK.
For setting up Qt creator with Windows SDK, check this question: How can I use the Windows SDK with Qt Creator
The original code is comming from the accepted answer in this question:
How can I run a child process that requires elevation and wait?