Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I want to show powerPoint in QAxwidget. Please help me.
Forum Updated to NodeBB v4.3 + New Features

I want to show powerPoint in QAxwidget. Please help me.

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    seokwon
    wrote on last edited by
    #1

    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.

    JKSHJ J 2 Replies Last reply
    0
    • S seokwon

      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.

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @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:

      • http://doc.qt.io/qt-5/activeqt-index.html
      • http://doc.qt.io/qt-5/activeqt-container.html
      • http://doc.qt.io/qt-5/qaxwidget.html

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      4
      • hskoglundH Online
        hskoglundH Online
        hskoglund
        wrote on last edited by
        #3

        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 the QT += ... line, insert axcontainer at the end.
        In the designer, add a QAxWidget widget to your MainWindow,
        In the mainwindow.cpp file, insert this line after ui->setup(this);

        ui->axWidget->setControl("C:\\Temp\\Test.ppt");
        

        That should show you the first page of your PowerPoint doc.

        S 1 Reply Last reply
        7
        • hskoglundH hskoglund

          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 the QT += ... line, insert axcontainer at the end.
          In the designer, add a QAxWidget widget to your MainWindow,
          In the mainwindow.cpp file, insert this line after ui->setup(this);

          ui->axWidget->setControl("C:\\Temp\\Test.ppt");
          

          That should show you the first page of your PowerPoint doc.

          S Offline
          S Offline
          seokwon
          wrote on last edited by seokwon
          #4

          @hskoglund

          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?

          1 Reply Last reply
          0
          • hskoglundH Online
            hskoglundH Online
            hskoglund
            wrote on last edited by
            #5

            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.

            S 1 Reply Last reply
            4
            • hskoglundH hskoglund

              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.

              S Offline
              S Offline
              seokwon
              wrote on last edited by
              #6

              @hskoglund
              thanks for your kindness. Have a nice day.

              1 Reply Last reply
              0
              • S seokwon

                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.

                J Offline
                J Offline
                JOZEF
                Banned
                wrote on last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                -1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved