Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. ActiveX and COM in QT

ActiveX and COM in QT

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 118 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CertainSci.Owl
    wrote on 20 May 2020, 21:17 last edited by aha_1980
    #1

    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
    e0c64e60-2f9e-4ca3-b43f-daf3dd092f50-image.png
    .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 Reply Last reply
    0

    1/1

    20 May 2020, 21:17

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved