Results 1 to 9 of 9

Thread: How to show MS Word int QWidget ?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Posts
    11
    Thanks
    3

    Default How to show MS Word int QWidget ?

    Hello, I want to show MS Word in QWidget, I 've tried like this:

    In a QWidget's constructor:

    Qt Code:
    1. QString qsFileName( "D:/Test/Test.doc" );
    2.  
    3. QHBoxLayout *playout = new QHBoxLayout( this );
    4. setLayout( playout );
    5.  
    6. QAxWidget *pAxWidget = new QAxWidget( this );
    7.  
    8. playout->addWidget( pAxWidget );
    9. playout->setMargin( 0 );
    10.  
    11. pAxWidget ->setControl( qsFileName );
    To copy to clipboard, switch view to plain text mode 

    Use this method, I can show it in a QWidget, but these menubars and commandbars are hidden.

    So I tried to make them visible like this:

    Qt Code:
    1. QAxObject *pStandard = pAxWidget->querySubObject( "CommandBars( const QVariant & )", "Standard" );
    2. pStandard->dynamicCall( "Enabled", true );
    3. pStandard->dynamicCall( "Visible", true );
    4. QAxObject *pFormatting = pAxWidget->querySubObject( "CommandBars( const QVariant & )", "Formatting" );
    5. pFormatting->dynamicCall( "Enabled", true );
    6. pFormatting->dynamicCall( "Visible", true );
    To copy to clipboard, switch view to plain text mode 

    but I still cannot see any commandBar.

    Can you help me? Thanks.
    Last edited by luoyes; 6th January 2011 at 05:44.

Similar Threads

  1. Replies: 10
    Last Post: 11th June 2012, 09:16
  2. setFocus after hide and show qwidget
    By alexandernst in forum Newbie
    Replies: 0
    Last Post: 14th April 2010, 17:25
  3. Replies: 3
    Last Post: 27th February 2008, 08:01
  4. QWidget::exec() and QWidget::show()
    By MarkoSan in forum Qt Programming
    Replies: 6
    Last Post: 18th October 2007, 21:39
  5. QWidget::show () segmentation fault
    By Umar Said in forum Qt Programming
    Replies: 6
    Last Post: 27th September 2007, 05:50

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
  •  
Qt is a trademark of The Qt Company.