[Interest] Zoom In and Zoom Out Event with ActiveQt ( QAxWidget )

neel patel neel5481 at gmail.com
Tue Jul 4 08:39:41 CEST 2017


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/ff03b570/attachment.html>


More information about the Interest mailing list