QAxWidget
Header: #include <QAxWidget> qmake: QT += axcontainer
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
QAxWidget类是包装ActiveX控件的QWidget。
QAxWidget可以实例化为一个空对象,使用它应该包装的ActiveX控件的名称,或者使用指向ActiveX控件的现有接口指针。ActiveX控件的属性、方法和事件仅使用QAxBase支持的数据类型,可作为Qt属性、槽和信号使用。基类QAxBase提供了通过IUnknown指针直接访问ActiveX的API。
QAxWidget是一个QWidget,通常可以这样使用,例如,它可以组织在widget层次结构和布局中,或者充当事件过滤器。支持标准控件属性,例如enabled,但它依赖于ActiveX控件来实现对环境属性的支持,例如调色板或字体。QAxWidget试图提供必要的提示。
但是,您不能重新实现特定于Qt的事件处理程序,如mousePressEvent或keyPressEvent,并期望它们被可靠地调用。嵌入式控件完全覆盖QAxWidget,并且通常处理用户界面本身。使用特定于控件的API(即监听控件的信号),或使用标准COM技术,如窗口过程子类化。
QAxWidget还继承了QAxBase的大部分与ActiveX相关的功能,特别是dynamicCall()和querySubObject()。
警告:您可以将QAxWidget子类化,但不能在子类中使用Q_OBJECT宏(生成的moc文件不会编译),因此不能添加更多的信号、槽或属性。此限制是由于运行时生成的元对象信息造成的。要解决这个问题,请将QAxWidget聚合为QObject子类的成员。
#####################
标签:控件,QAxWidget,virtual,QWidget,inherited,public From: https://www.cnblogs.com/herd/p/17035143.html