I want to show powerPoint in QAxwidget. Please help me.
-
I want to show powerPoint in QAxWidget. But I didnt konw how to use QAxWidget. So I want a small example. Plase some comment. thanks guys.
@seokwon said in I want to show powerPoint in QAxwidget. Please help me.:
I want to show powerPoint in QAxWidget. But I didnt konw how to use QAxWidget. So I want a small example. Plase some comment. thanks guys.
Start by reading these:
-
Some more help if you need:
Assume you have a PowerPoint document at C:\Temp\Test.ppt, then create a vanilla (empty) widgets app.
In the .pro file, in theQT += ...
line, insertaxcontainer
at the end.
In the designer, add a QAxWidget widget to your MainWindow,
In the mainwindow.cpp file, insert this line afterui->setup(this);
ui->axWidget->setControl("C:\\Temp\\Test.ppt");
That should show you the first page of your PowerPoint doc.
-
Some more help if you need:
Assume you have a PowerPoint document at C:\Temp\Test.ppt, then create a vanilla (empty) widgets app.
In the .pro file, in theQT += ...
line, insertaxcontainer
at the end.
In the designer, add a QAxWidget widget to your MainWindow,
In the mainwindow.cpp file, insert this line afterui->setup(this);
ui->axWidget->setControl("C:\\Temp\\Test.ppt");
That should show you the first page of your PowerPoint doc.
Oh Thanks I sucess it. and I have a one more question. Can i edit pptx file on QAxwidget? and after edit How to save pptx file in QAxwidget?
-
Hi sure you can edit the .pptx file directly.
However since there's no menu bar visible, there's no easy way to save the file.One workaround is to add a Push Button to the form, right-click on the button and select "Go to slot" and click Ok, then you will have a new function
void MainWindow::on_pushButton_clicked()
in your mainwindow.cpp.
Then edit the function so it looks like this:void MainWindow::on_pushButton_clicked() { auto app = ui->axWidget->querySubObject("Application"); auto acp = app->querySubObject("ActivePresentation"); acp->dynamicCall("SaveAs(QString&)","C:\\Temp\\Test.ppt"); }
So when you want to save, click the button.
-
Hi sure you can edit the .pptx file directly.
However since there's no menu bar visible, there's no easy way to save the file.One workaround is to add a Push Button to the form, right-click on the button and select "Go to slot" and click Ok, then you will have a new function
void MainWindow::on_pushButton_clicked()
in your mainwindow.cpp.
Then edit the function so it looks like this:void MainWindow::on_pushButton_clicked() { auto app = ui->axWidget->querySubObject("Application"); auto acp = app->querySubObject("ActivePresentation"); acp->dynamicCall("SaveAs(QString&)","C:\\Temp\\Test.ppt"); }
So when you want to save, click the button.
@hskoglund
thanks for your kindness. Have a nice day. -
I want to show powerPoint in QAxWidget. But I didnt konw how to use QAxWidget. So I want a small example. Plase some comment. thanks guys.