qt 添加本程序的注册表项
QStringcmd;
cmd.clear();
QStringapplication_path=QCoreApplication::applicationFilePath();//带文件扩展名的全路径
application_path.replace("/","\\");
QStringregPath="HKEY_CLASSES_ROOT\\software_name\\shell\\open\\command\\";
QSettings *programReg=new QSettings(regPath,QSettings::NativeFormat);
QVariantva=programReg->value(".");//"."=="Default"
if(!va.toString().contains(application_path,Qt::CaseInsensitive))
{
cmd="\""+application_path+"\""+"\"%1\"";
programReg->setValue(".",cmd);
delete programReg;
}