FullScreen
::FullScreen(QWidget *parent
) : ui(new Ui::FullScreen)
{
ui->setupUi(this);
// Open parameter
QList<QVariant> param_list;
param_list.append(file_ppt);
param_list.append(1);
param_list.append(0);
param_list.append(0);
// Make a object PPT
obj_ppt
->setGeometry
(QRect(0,
0,
800,
600));
if(!obj_ppt->setControl("{91493441-5A91-11CF-8700-00AA0060263B}"))
{
QMessageBox::critical(this, trUtf8
("Error PPT"),
"Install Microsoft Power Point (R) for the support PPT!");
}
// Open a template file
QAxObject *presentations
= obj_ppt
->querySubObject
("Presentations");
QAxObject *presentation
= presentations
->querySubObject
("Open(const QString&,int,int,int)", param_list
);
// Start the slides
QAxObject *slideshow
= presentation
->querySubObject
("SlideShowSettings");
slideshow->setProperty("RangeType", "ppShowAll");
slideshow->dynamicCall("run()");
}
FullScreen::FullScreen(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::FullScreen)
{
ui->setupUi(this);
QString file_ppt = "C:\\aaa.pptx";
// Open parameter
QList<QVariant> param_list;
param_list.append(file_ppt);
param_list.append(1);
param_list.append(0);
param_list.append(0);
// Make a object PPT
QAxWidget *obj_ppt = new QAxWidget("Powerpoint.Application", this->ui->slides);
obj_ppt->setGeometry(QRect(0,0,800,600));
if(!obj_ppt->setControl("{91493441-5A91-11CF-8700-00AA0060263B}"))
{
QMessageBox::critical(this, trUtf8("Error PPT"), "Install Microsoft Power Point (R) for the support PPT!");
}
// Open a template file
QAxObject *presentations = obj_ppt->querySubObject("Presentations");
QAxObject *presentation = presentations->querySubObject("Open(const QString&,int,int,int)", param_list);
// Start the slides
QAxObject *slideshow = presentation->querySubObject("SlideShowSettings");
slideshow->setProperty("RangeType", "ppShowAll");
slideshow->dynamicCall("run()");
}
To copy to clipboard, switch view to plain text mode
Bookmarks