#include <QQmlContext>
int main(int argc, char *argv[])
{
qDebug()<<"argc:"<<argc;
engine.rootContext()->setContextProperty("c_argc", QString::number(argc, 10));
if(argc > 1){
QString argv1 = QObject::tr(argv[1]);
qDebug()<<"argv1 vvvv:"<<argv[1];
QString v1 =argv1.right(argv1.length()-5);
qDebug()<<"argv1 vvvv:"<<v1;
engine.rootContext()->setContextProperty("c_loginPara", v1);
}else{
engine.rootContext()->setContextProperty("c_loginPara", "");
qDebug()<<"argv1:"<<argv[1];
}
}
网友评论