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. Custom Signal/Slot connection is not working (Slot is not called)
Forum Updated to NodeBB v4.3 + New Features

Custom Signal/Slot connection is not working (Slot is not called)

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 291 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.
  • M Offline
    M Offline
    Meeuxi
    wrote on last edited by
    #1

    I am trying to connect a Signal to a custom slot that I have defined. The connection is done in the constructor of my class which extends QWidget. I am trying to catch when a slider in my scrollArea changes value and call the slot. My code for the connection is:

    connect(ui.scrollArea->verticalScrollBar(), SIGNAL(sliderMoved(int)), this, SLOT(on_verticalScrollBar_sliderChanged(int)));

    However when I move the slider in my scrollArea, the corresponding slot is never called and thus not doing anything.

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

      Please post the code where you do the connect and where you emit the signal.
      Also please use the new signal/slot syntax to make sure the signal and slot signatures are correct.

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

      M 1 Reply Last reply
      2
      • Christian EhrlicherC Christian Ehrlicher

        Please post the code where you do the connect and where you emit the signal.
        Also please use the new signal/slot syntax to make sure the signal and slot signatures are correct.

        M Offline
        M Offline
        Meeuxi
        wrote on last edited by
        #3

        @Christian-Ehrlicher Using the new syntax already seems to have solved the issue. Thank you!

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved