Nominate our 2022 Qt Champions!

Signals and slots run function. QT5

  • in general, I need to run the function on signal:
    @connect (& accesManager, SIGNAL (finished (QNetworkReply *)), this, MainWindow :: someFunction (QNetworkReply *));@

    That just is not tried, as such a thing?

  • Moderators

    [quote author="avengerweb" date="1375945483"]That just is not tried, as such a thing?[/quote]

    You need to rephrase this.

    In your connect statement, you need to connect to a slot or a function pointer if you are using new connect syntax.

  • You need to declare your_ someFunction _ as a SLOT.

    Then connect like this.

    connect (& accesManager, SIGNAL (finished (QNetworkReply *)), this, SLOT(someFunction (QNetworkReply *)));

    Slots can also use as normal functions.

  • Hi, New_Signal_Slot_Syntax and Old_Signal_Slot_Syntax can not be mixed in one connection.

    Please read the documentation of QObject::connect()

Log in to reply