QString path = QCoreApplication::applicationDirPath();
QDir::setCurrent(path);
path.replace("/","\\");
path.append("\\Nanya.exe");
QSettings *reg = new QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
QSettings::NativeFormat);
reg->setValue("Nanya",QVariant(path));
delete reg;