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 Signals

Qt Signals

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.2k Views
  • 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.
  • S Offline
    S Offline
    sarahjohn
    wrote on last edited by
    #1

    Hi,
    I have a doubt regarding qt signals,Is it possible to block signals according to some conditions. like, I am using two signals contentSizeChanged() and loadStarted() in my program connecting to two different slots.Is it possible to make like If loadStarted()signal emitted, contentSizeChanged() signal should not work?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean the slot connected to contentSizeChanged should do nothing ?
      If so, just use a flag that's set when the slot connected to loadStarted is called and and in the slot connected to contentSizeChanged don't do anything if the flag is set.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • IamSumitI Offline
        IamSumitI Offline
        IamSumit
        wrote on last edited by
        #3

        Hii...

        You can use-->bool QObject::blockSignals ( bool block )

        If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). If block is false, no such blocking will occur.

        The return value is the previous value of signalsBlocked().

        Be Cute

        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