No matching function for QObject::connect

后端 未结 4 1171
伪装坚强ぢ
伪装坚强ぢ 2021-01-11 11:50

I\'m writing a program that send an UDP frame every 10 mS. Here\'s how my program is supposed to work :

I\'ve got a client class :

//Con         


        
4条回答
  •  隐瞒了意图╮
    2021-01-11 12:03

    Another possible cause of this error is trying to connect to a slot which is overloaded. For example, this well cause the same error

    QObject::connect(this,
                     &MazeWidget::MyUpdate,
                     this, 
                     &QWidget::update,
                     Qt::QueuedConnection);
    

    But not if you explicitely cast:

    QObject::connect(this,
                     &MazeWidget::MyUpdate,
                     this,
                     static_cast(&QWidget::update),
                      Qt::QueuedConnection);
    

提交回复
热议问题