After running a program containing the Qaxwidget control for a period of time, there are records indicating that the interface becomes stuck. Monitoring the notify of QApplication, the receiver->objectName for mouse click events is empty
Unsolved
General and Desktop
-
Maybe you can steal back to the focus by muting the control, say by calling disableEventSink on it.
-
this is my class inherits from QAxWidget.
class MyChildQaxWidget : public QAxWidget { public: MyChildQaxWidget ( QWidget * parent = 0 ) : QAxWidget (parent) { this->setFocusPolicy(Qt::ClickFocus); this->setAttribute(Qt::WA_ShowWithoutActivating); this->disableClassInfo(); this->disableEventSink(); } MyChildQaxWidget ( const QString & c, QWidget * parent = 0 ) : QAxWidget (c,parent) {} protected: void mousePressEvent ( QMouseEvent * e ) override { setFocus(); clearFocus(); QAxWidget::mousePressEvent ( e ); } void showEvent(QShowEvent* event) override { return QAxWidget::showEvent(event); } void hideEvent(QHideEvent* event) override { this->clearFocus(); return QAxWidget::hideEvent(event); } };
-
What COM object are you hosting in your MyChildQaxWidget?
If it's something like Internet Explorer, you might be better off using Qt's WebEngine instead. -
@hskoglund Thank you for your reply. This control was created by a third-party company through dumppp.exe.
Here is the code I used.class MyChildQaxWidget : public QAxWidget { public: MyChildQaxWidget ( QWidget * parent = 0 ) : QAxWidget (parent) { this->setFocusPolicy(Qt::NoFocus); this->setAttribute(Qt::WA_ShowWithoutActivating); this->disableClassInfo(); this->disableEventSink(); } } MyChildQaxWidget* QaxWid2 = new MyChildQaxWidget(); flyResultQaxWid2->setControl(QString::fromUtf8("{313241A6-62F9-464B-BEDE-F514827E2F22}")); flyResultQaxWid2->dynamicCall("GetObjectPointer()");