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.

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 1.8k Views
  • 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 9 Aug 2018, 01:25 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.

    J J 2 Replies Last reply 9 Aug 2018, 02:12
    0
    • S seokwon
      9 Aug 2018, 01:25

      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
      JKSH
      Moderators
      wrote on 9 Aug 2018, 02:12 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
      • H Online
        H Online
        hskoglund
        wrote on 9 Aug 2018, 02:40 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 9 Aug 2018, 04:26
        7
        • H hskoglund
          9 Aug 2018, 02:40

          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 9 Aug 2018, 04:26 last edited by seokwon 8 Sept 2018, 04:39
          #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
          • H Online
            H Online
            hskoglund
            wrote on 10 Aug 2018, 00:10 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 10 Aug 2018, 00:46
            4
            • H hskoglund
              10 Aug 2018, 00:10

              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 10 Aug 2018, 00:46 last edited by
              #6

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

              1 Reply Last reply
              0
              • S seokwon
                9 Aug 2018, 01:25

                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 25 Dec 2019, 23:09 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