Results 1 to 6 of 6

Thread: DOCX,PPTX and XLSX file preview in Qt

  1. #1
    Join Date
    May 2007
    Posts
    110
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default DOCX,PPTX and XLSX file preview in Qt

    Hi

    I am using Qt 4.8.7 Static on Windows Platform. I want to show preview DOCX,PPTX and XLSX file preview.

    Is there any way to show preview...I am using following code

    Qt Code:
    1. ///for Powerpoint
    2. QAxWidget *m_pAxDocument = new QAxWidget("PowerPoint.Application",m_pTextEdit);
    3. m_pAxDocument->setGeometry(m_pTextEdit->geometry());
    4. m_pAxDocument->setProperty("DisplayAlerts",false);
    5.  
    6. QAxObject *axObject = m_pAxDocument->querySubObject("Presentations");
    7. QAxObject *present = axObject->querySubObject("Open(const QVariant&)",QVariant(strFileName));
    To copy to clipboard, switch view to plain text mode 

    for DOCX
    Qt Code:
    1. m_pAxDocument = new QAxWidget("Word.Document",m_pTextEdit);
    2. m_pAxDocument->setGeometry(m_pTextEdit->geometry());
    3. m_pAxDocument->setProperty("DisplayAlerts",false);
    4. m_pAxDocument->setControl(strFileName))
    To copy to clipboard, switch view to plain text mode 
    It show preview but it is editable, it directly open in MS Word or powerpoint and you can do anything with its preview...cut, copy paste.

    I want it to make preview using QAxWidget readable only...Is there any method for this...I am also unable to disable the QAxWidget/QTextEdit.. I don't have control on this preview...

    Or any other way to show DOCX,PPTX and XLSX file preview in Qt.

    Kindly reply..

    Thanks
    Santosh
    Last edited by anda_skoa; 5th November 2016 at 14:03. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: DOCX,PPTX and XLSX file preview in Qt

    Is there a "setProperty" call for a read-only property?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    May 2007
    Posts
    110
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: DOCX,PPTX and XLSX file preview in Qt

    I don't know whether readonly property or not. Kindly tell me whether disable qaxwidget or readonly it. I didn't find any documentation regarding preview of office files. I will codetags# after 1 days, I may accessing through mobile.

    If anybody know this solution kindly help me.
    Thanks for reply.

  4. #4
    Join Date
    May 2007
    Posts
    110
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: DOCX,PPTX and XLSX file preview in Qt

    If anybody know this solution kindly help me.

  5. #5
    Join Date
    May 2007
    Posts
    110
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: DOCX,PPTX and XLSX file preview in Qt

    Hi

    Anybody know if docx,pptx, xlsx convert into HTML format.

    Thanks
    Santosh

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: DOCX,PPTX and XLSX file preview in Qt

    I don't know whether readonly property or not. Kindly tell me whether disable qaxwidget or readonly it.
    QAxWidget is simply a container where ActiveX controls can display their content. It has no concept of "read-only". You need to look at the Microsoft documentation for your ActiveX controls to find out if they support a read-only property on their documents.

    Anybody know if docx,pptx, xlsx convert into HTML format.
    Again, you need to look at the Microsoft documentation. I doubt if you can convert documents in these formats into the subset of HTML that Qt supports; you will almost certainly end up with HTML that cannot be rendered by Qt. You will be much better off if you read the Microsoft ActiveX documentation for these document types and learn how to display them in QAxWidget with a read-only property.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. microsoft docx <-> qtextdocument
    By andres in forum Jobs
    Replies: 2
    Last Post: 8th June 2012, 21:43
  2. To preview pdf, doc, rtf file.
    By merry in forum Qt Programming
    Replies: 3
    Last Post: 21st September 2011, 11:53
  3. Replies: 9
    Last Post: 25th June 2009, 15:10
  4. File Open dialog with preview?
    By will49 in forum Qt Programming
    Replies: 2
    Last Post: 24th July 2007, 19:08
  5. preview file dialog
    By mickey in forum Qt Programming
    Replies: 11
    Last Post: 22nd April 2006, 00:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.