[Interest] Zoom In and Zoom Out Event with ActiveQt ( QAxWidget )
Michael Sué
sue at sf.mpg.de
Tue Jul 4 09:26:21 CEST 2017
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 <http://doc.qt.io/qt-5/quuid.html> QUuid &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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170704/524d6cbb/attachment.html>
More information about the Interest
mailing list