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. Understanding signal slot flow
Qt 6.11 is out! See what's new in the release blog

Understanding signal slot flow

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.1k 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.
  • K Offline
    K Offline
    kpks
    wrote on last edited by
    #1

    Hi,
    This is just to improve my understanding of how Qt/Signals and SLots work.

    I have 1 Main Window MW, 1 Child window CW and 1 Child class CC.
    Case 1
    I emit signal in child class, connect CC signal to CW slot. Nothing happens. I set up the connection in the constructor for MW where I create CC and CW.
    workaround solution, Case 2
    I then emit signal in CC, connect CC signal to MW slot, call the CW functions from MW slot, everything works perfectly!

    Why does case 1 fail?

    Thanks,
    kpks

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      check the return value of the connect() statement. In case of an error it returns false.
      Also check the console since any problems with the signal-slot-connection are printed there and give a fast hint what is going wrong.

      I suspect you use a NULL pointer at the time you setup the connection.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kpks
        wrote on last edited by
        #3

        I check the status and print a "connection made" if true, that works fine.

        There is nothing in the console, just this in issues:
        D:\kpks\software\tcpComm\dynamicplots.ui:-1: warning: Z-order assignment: 'plotW' is not a valid widget.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          poorBob
          wrote on last edited by
          #4

          Do all of Your classes derive from QObject and contain Q_OBJECT macro?

          Robert

          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