Results 1 to 3 of 3

Thread: handling events of Acrobat Activex control Embedded in QAxWidget

  1. #1
    Join Date
    Feb 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default handling events of Acrobat Activex control Embedded in QAxWidget

    Hello,
    I am working on application which is being developed in Qt on Windows. I need to display
    PDF file on dialog in Activex Control. I used QAxWidget control in qt and embed
    Acrobat Browser Control on it. I used Acrobat Browser Control type Library to preview
    PDf file in QAxWidget. Following is code snippet:

    pdf=new PdfWidget(this);
    pdf->setGeometry(60,30,500,480);
    pdf->dynamicCall("LoadFile(const QString&)","D:\\cryptkey.pdf");
    pdf->dynamicCall("setShowScrollbars(bool)","false");
    pdf->dynamicCall("setShowToolbar(bool)","false");
    pdf->dynamicCall("setPageMode(const QString&)","none");

    where pdfWidget is class inherited from QAxWidget. I need to disable mouse and key events on PDF file displayed in Activex control. So I override mousePressEvent() of QAxWidget class and used its ignore() to disable mouse clicks

    void PdfWidget::mousePressEvent( QMouseEvent * event )
    {
    event->ignore();
    }

    This works fine if no file is loaded in Acrobat Browser control but After a PDF file is loaded it does not recieve any events.

    I think Acrobat Browser control has taken the control and now how I will handle the mouse events on Acrobat Activex control so that I can disable the mouse clicks on PDf file displayed in it.
    I have read in QAxWidget documentation
    "However, you cannot reimplement Qt-specific event handlers like mousePressEvent or keyPressEvent and expect them to be called reliably. The embedded control covers the QAxWidget completely, and usually handles the user interface itself. Use control-specific APIs (i.e. listen to the signals of the control), or use standard COM techniques like window procedure subclassing."

    Please help me out as I have little knowledege in COM techniques and how I will handle Activex controls events to disable mouse clicks.

    Waiting for reply................

  2. #2
    Join Date
    Feb 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Question Re: handling events of Acrobat Activex control Embedded in QAxWidget

    Quote Originally Posted by aarti.nagpal View Post
    Hello,
    I am working on application which is being developed in Qt on Windows. I need to display
    PDF file on dialog in Activex Control. I used QAxWidget control in qt and embed
    Acrobat Browser Control on it. I used Acrobat Browser Control type Library to preview
    PDf file in QAxWidget. Following is code snippet:

    pdf=new PdfWidget(this);
    pdf->setGeometry(60,30,500,480);
    pdf->dynamicCall("LoadFile(const QString&)","D:\\cryptkey.pdf");
    pdf->dynamicCall("setShowScrollbars(bool)","false");
    pdf->dynamicCall("setShowToolbar(bool)","false");
    pdf->dynamicCall("setPageMode(const QString&)","none");

    where pdfWidget is class inherited from QAxWidget. I need to disable mouse and key events on PDF file displayed in Activex control. So I override mousePressEvent() of QAxWidget class and used its ignore() to disable mouse clicks

    void PdfWidget::mousePressEvent( QMouseEvent * event )
    {
    event->ignore();
    }

    This works fine if no file is loaded in Acrobat Browser control but After a PDF file is loaded it does not recieve any events.

    I think Acrobat Browser control has taken the control and now how I will handle the mouse events on Acrobat Activex control so that I can disable the mouse clicks on PDf file displayed in it.
    I have read in QAxWidget documentation
    "However, you cannot reimplement Qt-specific event handlers like mousePressEvent or keyPressEvent and expect them to be called reliably. The embedded control covers the QAxWidget completely, and usually handles the user interface itself. Use control-specific APIs (i.e. listen to the signals of the control), or use standard COM techniques like window procedure subclassing."

    Please help me out as I have little knowledege in COM techniques and how I will handle Activex controls events to disable mouse clicks.

    Waiting for reply................


    Pls help me out as I am struck at this point.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: handling events of Acrobat Activex control Embedded in QAxWidget

    What is the problem? As the docs clearly say you cannot expect QAxWidget's mouse event handler to be called reliably because the contained ActiveX control covers the entire widget. The contained control therefore gets these events. You need to disable the handling of those events by setting the appropriate settings in the Adobe control: see the Adobe control's documentation.

Similar Threads

  1. Replies: 4
    Last Post: 27th June 2012, 10:41
  2. Get the iDispatch interface of an ActiveX control
    By punkypogo in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2010, 08:00
  3. Working with ActiveX client QAxWidget
    By InnoQT in forum Qt Programming
    Replies: 0
    Last Post: 29th January 2010, 10:28
  4. ActiveX control
    By Kapil in forum General Discussion
    Replies: 0
    Last Post: 4th October 2006, 09:56
  5. ActiveX Control and Qt
    By munna in forum Newbie
    Replies: 1
    Last Post: 15th April 2006, 22:19

Tags for this Thread

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.