ActiveX and COM in QT
Unsolved
General and Desktop
-
wrote on 20 May 2020, 21:17 last edited by aha_1980
Hello. I need to create a label with animated QMovie gif inside as a COM-object and than add it to another program's window. My code and compile errors are bellow.
I've checked official documentation and different forums but still have no clue what to do.
p.s. maybe my code is nonsense since I'm absolute noob, so I'd appreciate any help
errors
.h file#ifndef ANIMATION_H #define ANIMATION_H #include <QMovie> #include <QLabel> class Widget : public QObject { Q_OBJECT Q_CLASSINFO("ClassID", "{08690144-E269-4D99-8994-25A7F059CE93}") Q_CLASSINFO("InterfaceID", "{086C97D0-4389-4BED-AA16-6AC02F433541}") Q_CLASSINFO("RegisterObject", "yes") Q_PROPERTY(bool stopped READ isStopped WRITE setStopped) public: explicit Widget(QWidget *parent = 0, QLabel* label = 0); ~Widget(){ delete gif; } void setStopped(bool); bool isStopped(); private: QMovie *gif; bool stopped; bool visible; }; #endif // ANIMATION_H
.pro
QT += core gui TEMPLATE = lib QT += axserver CONFIG += dll DEF_FILE = qaxserver.def RC_FILE = qaxserver.rc greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++11 # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ animation.cpp \ main.cpp HEADERS += \ animation.h FORMS += # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target RESOURCES += \ img.qrc
1/1