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. Signal connected but not emitted on QAxObject
Qt 6.11 is out! See what's new in the release blog

Signal connected but not emitted on QAxObject

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 964 Views 1 Watching
  • 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.
  • E Offline
    E Offline
    eddystefes
    wrote on last edited by
    #1

    Hi,

    here is my Problem:

    i try to cennect to a signal that is emited by e COM Object. The signal has a struct as argument. i know that the signal is emited because i have a slot listening on the signal signal(QString, int, void * ). But my SLOT for the special signal is never called. The over signals that have simple arguments are called without a problem.
    i also tryed a to use class instead of a struct for mySpecialStructType. it gave me the same result.

    @
    struct mySpecialStructType{
    QString Name;
    int Number;
    ....
    };

    ...
    Q_DECLARE_METATYPE(mySpecialStructType )

    ...

    MyClass::MyClass()
    {
    ...
    qRegisterMetaType<mySpecialStructType>();

    mySpecialStructType test;
    QVariant a = QVariant::fromValue(test);
    
    qDebug<<"canconvert? "<<(bool) a.canConvert<mySpecialStructType>();
    
     QAxObject myObject = new QAxObject("{myid}");
    
    connect(myObject, SIGNAL(myEasySignal(int )), 
            this,SLOT(myEasySlot(int)));
    
     connect(myObject, SIGNAL(mySignal(mySpecialStructType )), 
            this,SLOT(mySlot(mySpecialStructType)));
    
     connect(myObject, SIGNAL(signal(QString, int, void * )), 
            this,SLOT(signalrecord(QString , int , void * )));
    
      m440ax->dumpObjectInfo();
    

    ...
    }

    void MyClass::signalrecord(QString name, int argc, void * argv)
    {
    qDebug()<<"----signal:"<<name<<"("<<argc<<")";
    }

    void MyClass::mySlot(mySpecialStructType foo)
    {
    qDebug()<<"mySlot was called!";
    }

    void MyClass::myEasySlot(int number)
    {
    qDebug()<<"Easyslot: "<<number;
    }
    @

    this gives me the output:

    ...
    canconvert? true

    SIGNALS OUT

    signal: signal(QString,int,void*)

          --&gt; MyClass::MyClass signalrecord(QString,int,void*)
    

    signal: mySignal(mySpecialStructType )

          --&gt; MyClass::MyClass  mySlot(mySpecialStructType)
    

    signal: myEasySignal(mySpecialStructType )

          --&gt; MyClass::MyClass  myEasySlot(mySpecialStructType)
    

    ...
    ----signal: "myEasySignal(int )" ( 1 )
    EasySlot: 3
    ----signal: "myEasySignal(int )" ( 1 )
    Easyslot: 2

    ...

    ----signal: "mySignal(mySpecialStructType )" ( 1 )
    ----signal: "mySignal(mySpecialStructType )" ( 1 )

    ...

    what am i doing wrong?
    why is my slot not beeing called?

    greetings eddy

    1 Reply Last reply
    0

    • Login

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