[Interest] Zoom In and Zoom Out Event with ActiveQt ( QAxWidget )
neel patel
neel5481 at gmail.com
Wed Jul 5 07:29:36 CEST 2017
Thanks. It worked. I queried interface and called "ExecWB" method for zoom
In and Out.
Thanks for the support.
On Tue, Jul 4, 2017 at 12:56 PM, Michael Sué <sue at sf.mpg.de> wrote:
> Hi,
>
>
>
> I think you will have to query an interface of the contained COM object
> and do it directly with its member functions:
> long QAxBase::queryInterface(const QUuid
> <http://doc.qt.io/qt-5/quuid.html> &*uuid*, void ***iface*) const
>
> - Michael.
>
>
>
>
>
>
>
> *From:* Interest [mailto:interest-bounces+sue=sf.mpg.de at qt-project.org] *On
> Behalf Of *neel patel
> *Sent:* Tuesday, July 4, 2017 8:40 AM
> *To:* interest at qt-project.org
> *Subject:* [Interest] Zoom In and Zoom Out Event with ActiveQt (
> QAxWidget )
>
>
>
> Hi,
>
>
>
> How can we achieve Zoom In and Zoom Out with QAxWidget. As the web
> contents are rendered properly but if user want to zoom in and zoom out the
> content of QAxWidget then how to do that ?
>
>
>
> As for the QWebView - method "setZoomFactor" is available but with this
> QAxWidget there is no method available. I have registered QShortCut as
> below and listen to "Ctrl +" and "Ctrl -" events in slots i tried to set
> the font size but didn't help.
>
>
>
>
>
> zoomInShortcut = new QShortcut(QKeySequence(QKeySequence::ZoomIn), this);
>
> zoomInShortcut->setContext(Qt::ApplicationShortcut);
>
> QObject::connect(zoomInShortcut, SIGNAL(activated()), this,
> SLOT(zoomInAxWidget()));
>
>
>
> zoomOutShortcut = new QShortcut(QKeySequence(QKeySequence::ZoomOut),
> this);
>
> zoomOutShortcut->setContext(Qt::ApplicationShortcut);
>
> QObject::connect(zoomOutShortcut, SIGNAL(activated()), this,
> SLOT(zoomOutAxWidget()));
>
>
>
> void MainWindow::zoomInAxWidget()
>
> {
>
> QFont orgFont = m_qaxWidget->font();
>
> orgFont.setPointSize(orgFont.pointSize() + 1);
>
> m_qaxWidget->setFont(orgFont);
>
> }
>
>
>
> // zoom out widget
>
> void MainWindow::zoomOutAxWidget()
>
> {
>
> QFont orgFont = m_qaxWidget->font();
>
> orgFont.setPointSize(orgFont.pointSize() - 1);
>
> m_qaxWidget->setFont(orgFont);
>
> }
>
>
>
>
>
> Above code is not working. Is there any alternative to achieve zoom in/out
> with QAxWidget ?
>
>
>
> Thanks in Advance.
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170705/824a7cc7/attachment.html>
More information about the Interest
mailing list