16,175
社区成员
发帖
与我相关
我的任务
分享
void PrintLabel::label_returnPressed()
{
if(!lppx)//lppx init ok
{
ui.label->setText("lppx init fail.");
return;
}
QAxObject *docs = lppx->querySubObject("Documents");//docs not null,ok
docs->dynamicCall("CloseAll(bool)",false);//ok
//QAxObject *lppxDoc = docs->querySubObject("Open(QString,bool)","C:\\label.lab",false);//lppxDoc not null,ok
docs->dynamicCall("Open(QString,bool)","C:\\label.lab",false);//Open OK
//qDebug()<<lppxDoc->dynamicCall("FullName").toString();//""
QAxObject *lppxDoc = lppx->querySubObject("ActiveDocument");//lppxDoc not null
qDebug()<<lppx->querySubObject("ActiveDocument")->property("FullName").toString();//output "",reason??
qDebug()<<docs->querySubObject("Item(QString)","label.lab")->property("FullName").toString();//also ""
QAxObject *vars = lppxDoc->querySubObject("Variables");
QAxObject *var1 = vars->querySubObject("Item(QString)","var1");
qDebug()<<var1->property("Value").toString();
var1->setProperty("Value",ui.lineEdit->text());// set value fail
//lppx->setProperty("Visible",true);
//lppxDoc->dynamicCall("PrintDocument()");
}