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. Cant emit signal array of structure QList<Structure>
Forum Updated to NodeBB v4.3 + New Features

Cant emit signal array of structure QList<Structure>

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 230 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.
  • V Offline
    V Offline
    V0rtex
    wrote on last edited by
    #1

    Hi I want to send a signal mainwindow to mythread.

    mainwindow.cpp

    QList<PLC_CONTROLPARAMS_LIST > PLC_ProfileParameters[100][100];
    connect(this,SIGNAL(SendProfileParams(QList<PLC_CONTROLPARAMS_LIST>)),mThread,SLOT(ReceiveProfileParams(QList<PLC_CONTROLPARAMS_LIST >)));
    //Some Code
    emit SendProfileParams(PLC_ProfileParameters);
    

    mainwindow.h

    signals:
                 void SendProfileParams(QList<PLC_CONTROLPARAMS_LIST> );
    

    mythread.h

    void ReceiveProfileParams(QList<PLC_CONTROLPARAMS_LIST>);
    

    mythread.cpp

    void MyThread::ReceiveProfileParams(QList<PLC_CONTROLPARAMS_LIST *> Profile)
    {
    //Some code
    }
    Q_DECLARE_METATYPE(PLC_CONTROLPARAMS_LIST)
    

    I cant read Profile variable its empty.
    Can you help?

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by Kent-Dorfman
      #2

      @V0rtex said in Cant emit signal array of structure QList<Structure>:

      Q_DECLARE_METATYPE(PLC_CONTROLPARAMS_LIST)

      That's not the type you need to declare. You created a container of those.

      BTW: please use using instead of typedef to alias the type.

      using PLC_LIST = QList<PLC_CONTROLPARAMS_LIST >;

      If you meet the AI on the road, kill it.

      1 Reply Last reply
      1

      • Login

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