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. How to invoke slot on widget?
Qt 6.11 is out! See what's new in the release blog

How to invoke slot on widget?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 424 Views 2 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
    #1

    I have added a slot to the clicked signal of a QCheckBox, I want to use the slot which is Lambda to set-up the initial widgets, is there a way to trigger a call of the checkbox clicked signal programmatically?

    Kind Regards,
    Sy

    SPlattenS 1 Reply Last reply
    0
    • SPlattenS SPlatten

      I have added a slot to the clicked signal of a QCheckBox, I want to use the slot which is Lambda to set-up the initial widgets, is there a way to trigger a call of the checkbox clicked signal programmatically?

      SPlattenS Offline
      SPlattenS Offline
      SPlatten
      wrote on last edited by
      #2

      @SPlatten , sorted:

      QMetaObject::invokeMethod(mpui->pcbMonShowRx, "clicked", Qt::QueuedConnection, Q_ARG("clicked", false));
      

      Kind Regards,
      Sy

      jeremy_kJ 1 Reply Last reply
      1
      • SPlattenS SPlatten

        @SPlatten , sorted:

        QMetaObject::invokeMethod(mpui->pcbMonShowRx, "clicked", Qt::QueuedConnection, Q_ARG("clicked", false));
        
        jeremy_kJ Offline
        jeremy_kJ Offline
        jeremy_k
        wrote on last edited by jeremy_k
        #3

        For public signals, directly emitting is an option.

        emit mpui->pcbMonShowRx.clicked(false);
        

        Asking a question about code? http://eel.is/iso-c++/testcase/

        1 Reply Last reply
        2

        • Login

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