Qt generated ActiveX control calls (a) in MFC

First, the generation Active Control with QT
development environment + QT5.7.1 VS2015
1, New Project -> Qt-> Qt ActiveQt Server, enter a name, select a location. As shown in FIG:
Here Insert Picture Descriptionfile directory FIG:
Here Insert Picture Description

2, added QtActiveWidget.ui generated interface elements, modify the style sheet, as shown in FIG.:
Here Insert Picture Description
. 3, the Qt generated Active control interface functions announced by external public slot; in

class QtActiveWidget : public QWidget, public QAxBindable
{
    Q_OBJECT
public:
    QtActiveWidget(QWidget *parent = Q_NULLPTR);
public slots: //定义调用接口
    void slt_setLineText(QString str);
    QString slt_getLineText();
    void slt_clickedButton(bool clicked);
private:
    Ui::QtActiveWidgetClass ui;
};

In the cpp file functions to achieve
4, Active control can be generated by the Active Qt tool testcon.exe call
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/u011370855/article/details/86075756