

Before your application starts its computation intensive work, or before it starts loading plugins, etc., invoke KSplash as follows:
DCOPClient *c = kapp->dcopClient();
QString error;
QCString KSplashName;
int pid = 0;
QStringList args;
args << "--theme=MyCoolTheme" << "--managed";
if (kapp->startServiceByDesktopName("ksplash", args, &error,
&KSplashName, &pid))
{
KMessageBox::sorry(0, error, "Unable to invoke KSplash");
// Some error processing here.
}
We will assume that there is only one instance of KSplash running. Other cases are slightly more complex. Please see the DCOP documentation for further details.