Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Signals and slots run function. QT5

    General and Desktop
    4
    4
    1010
    Loading More Posts
    • 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.
    • A
      avengerweb last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        [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.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • H
          Hareen Laks last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • D
            dbzhang800 last edited by

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

            Please read the documentation of QObject::connect()

            1 Reply Last reply Reply Quote 0
            • First post
              Last post