refactor  c++  code  below ,QtConcurrent::run([=]() {
        auto lic = SntlLicGen::getInstance(1);
        qDebug()<<"Update license expiration in background";
        QString rstrdStr, msgStr;
        const auto featId = lic->getFeature();
        if(featId < 0){
            msgStr = QObject::tr("Hasp internal user type error.");
        }
        bool succ = lic->getRemainTime(rstrdStr, featId);
        bool showMsg = false;
        if(!succ){
            msgStr = lic->getHaspError();
        }else{
            if(rstrdStr.compare("perpetual", Qt::CaseInsensitive) == 0){
                showMsg = false;
            }else{
                bool isok = false;
                double totalTime = QVariant(rstrdStr).toDouble(&isok);
                if(isok){
                    if(totalTime < 0){
                        quint16 minute = 60;
                        quint16 hour = minute * 60;
                        quint64 day = hour * 24;
                        quint64 curDay = fabs(totalTime) / day;
                        quint64 curHour = (fabs(totalTime) - curDay * day) / hour;
                        quint64 curMinute = (fabs(totalTime) - curDay * day - curHour * hour) / minute;
                        if(curDay < 7 || (curDay == 7 && curHour == 0 && curMinute == 0)){
                            msgStr = QObject::tr("Your product license will expire in ")
                                     + QString::number(curDay) + " " + QObject::tr("day") + " "
                                     + QString::number(curHour) + " "+ QObject::tr("hour")+ " "
                                     + QString::number(curMinute) + " "+ QObject::tr("minute");
                            if(curDay <= 0){
                                msgStr = QObject::tr("Your product license will expire in ") + " "+
                                         QString::number(curHour) + " "+ QObject::tr("hour") + " "+
                                         QString::number(curMinute) + " "+ QObject::tr("minute");
                            }
                            showMsg = true;
                        }
                    }else{
                        msgStr = QObject::tr("The feature is expired.");
                        showMsg = true;
                    }
                }else{
                    msgStr = QObject::tr("Internal error occurred when parsing time from memory.");
                    showMsg = true;
                }
            }
        }
        qDebug()<<"License message:"<<msgStr;
        if(showMsg){
            Q_EMIT toShowMessage(QObject::tr("Andromeda License Message"), msgStr);
        }
    });