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...@qt-project.org] On Behalf 
Of neel patel
Sent: Tuesday, July 4, 2017 8:40 AM
To: interest@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@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to