QAxWidget
QAxWidget
Public Functions
QAxWidget(QWidget *parent = nullptr, Qt::WindowFlags f = ...) | |
QAxWidget(const QString &c, QWidget *parent = nullptr, Qt::WindowFlags f = ...) | |
QAxWidget(IUnknown *iface, QWidget *parent = nullptr, Qt::WindowFlags f = ...) | |
virtual | ~QAxWidget() |
virtual QAxAggregated * | createAggregate() |
bool | doVerb(const QString &verb) |
Reimplemented Public Functions
virtual void | clear() override |
virtual QSize | minimumSizeHint() const override |
virtual QSize | sizeHint() const override |
- 219 public functions inherited from QWidget
- 19 public functions inherited from QAxBase
- 34 public functions inherited from QObject
Protected Functions
virtual bool | createHostWindow(bool initialized) |
bool | createHostWindow(bool initialized, const QByteArray &data) |
virtual bool | translateKeyEvent(int message, int keycode) const |
Reimplemented Protected Functions
virtual void | changeEvent(QEvent *e) override |
virtual void | connectNotify(const QMetaMethod &signal) override |
virtual bool | initialize(IUnknown **ptr) override |
virtual void | resizeEvent(QResizeEvent *) override |
- 35 protected functions inherited from QWidget
- 5 protected functions inherited from QAxBase
- 9 protected functions inherited from QObject
Additional Inherited Members
- 59 properties inherited from QWidget
- 1 property inherited from QAxBase
- 1 property inherited from QObject
- 19 public slots inherited from QWidget
- 1 public slot inherited from QObject
- 3 signals inherited from QWidget
- 3 signals inherited from QAxBase
- 2 signals inherited from QObject
- 1 public variable inherited from QWidget
- 1 public variable inherited from QObject
- 7 static public members inherited from QWidget
- 10 static public members inherited from QObject
- 1 protected slot inherited from QWidget
- 2 protected variables inherited from QObject
Detailed Description
QAxWidget类是包装ActiveX控件的QWidget。
QAxWidget可以实例化为空对象,带有它应该包装的ActiveX控件的名称,或者带有指向ActiveX控件的现有接口指针。ActiveX控件的属性、方法和事件仅使用QAxBase支持的数据类型,可作为Qt属性、插槽和信号使用。基类QAxBase提供了一个API,可以通过IUnknown指针直接访问ActiveX。
QAxWidget是一个QWidget,主要用于QWidget,例如,它可以组织在widget层次结构和布局中,或者充当事件过滤器。支持标准小部件属性,例如enabled,但它取决于ActiveX控件来实现对环境属性(例如调色板或字体)的支持。QAxWidget试图提供必要的提示。
但是,您不能重新实现特定于Qt的事件处理程序,如mousePressEvent或keyPressEvent,并期望可靠地调用它们。嵌入式控件完全覆盖QAxWidget,通常处理用户界面本身。使用特定于控件的API(即侦听控件的信号),或使用标准COM技术,如窗口过程子类化。
QAxWidget还从QAxBase继承了大部分与ActiveX相关的功能,特别是dynamicCall()和querySubObject()。
警告:您可以将QAxWidget子类化,但不能在子类中使用Q_对象宏(生成的moc文件将不会编译),因此无法添加更多信号、插槽或属性。此限制是由于运行时生成的元对象信息造成的。要解决此问题,请将QAxWidget聚合为QObject子类的成员。
##############################
QQ 3087438119