I want to show powerPoint in QAxwidget. Please help me.
-
wrote on 9 Aug 2018, 01:25 last edited by
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.
-
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:
-
wrote on 9 Aug 2018, 02:40 last edited by
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.
wrote on 9 Aug 2018, 04:26 last edited by seokwon 8 Sept 2018, 04:39Oh 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?
-
wrote on 10 Aug 2018, 00:10 last edited by
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.
wrote on 10 Aug 2018, 00:46 last edited by@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.
This post is deleted!