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. Qt 4.8.3, signal and slot connections
Forum Updated to NodeBB v4.3 + New Features

Qt 4.8.3, signal and slot connections

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 591 Views 3 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.
  • SPlattenS Offline
    SPlattenS Offline
    SPlatten
    wrote on last edited by SPlatten
    #1

    I'm using an older version of Qt for a project where I currently cannot use a later version because the SDK that issues uses this old version.

    Anyway....I have to connect signals and slots, my system has Qt version 5.12 and I'm trying to transfer some code from that system to the older version.

    My connection looks like this:

        QObject::connect(pwndMain
                        ,&clsMainWnd::systemBattery
                        ,mpdlgDisplaySettings
                        ,&clsXMLnode::systemBattery);
    

    Both systemBattery signals and slots have the exact same prototype:

        void systemBattery(int intBattery);
    

    When I build the project using the older Qt version I get:

        no matching function for call to 'clsMainWnd::connection(clsMainWnd* const,const char*,clsDisplaySettings*&,const char*)'
    

    How do I implement this using what is available in the older version?

    I've also tried:

        Object::connect(pwndMain
                       ,SIGNAL(systemBattery(int))
                       ,mpdlgDisplaySettings
                       ,SLOT(systemBattery(int)));
    

    I got the same message.

    Kind Regards,
    Sy

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You can't use the new signal/slot syntax with Qt4.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      4
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Why do you delete your post? The problem may have others too but now nobody can find the answer because you deleted your post...

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        3
        • SPlattenS Offline
          SPlattenS Offline
          SPlatten
          wrote on last edited by SPlatten
          #4

          I have and it works, the reason it didn't work was because I forgot to add QObject and Q_OBJECT to the slot class definition.

          Once I did that the warnings went away. Just to be clear I used the later connect method in my post which works fine.

          Kind Regards,
          Sy

          Pablo J. RoginaP 1 Reply Last reply
          3
          • SPlattenS SPlatten

            I have and it works, the reason it didn't work was because I forgot to add QObject and Q_OBJECT to the slot class definition.

            Once I did that the warnings went away. Just to be clear I used the later connect method in my post which works fine.

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @SPlatten it seems you was able to solve your issue. If so please don't forget to mark your post as such. Thanks

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            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