Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to connect signal and slot in two diffrent form ?
Forum Update on Monday, May 27th 2025

How to connect signal and slot in two diffrent form ?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
emit signal
4 Posts 3 Posters 2.8k 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.
  • MhM93M Offline
    MhM93M Offline
    MhM93
    wrote on last edited by
    #1

    Hi.
    In my first page I want to emit signal that change some thing by slot in second form.
    I do like this example : http://stackoverflow.com/questions/6199962/how-to-pass-data-from-one-form-to-another-in-qt
    but not worked (maybe because I removed this code from main.cpp : "second.show(); " -> just this change ).
    How can I do that?

    H.Ghassami

    K 1 Reply Last reply
    0
    • MhM93M MhM93

      Hi.
      In my first page I want to emit signal that change some thing by slot in second form.
      I do like this example : http://stackoverflow.com/questions/6199962/how-to-pass-data-from-one-form-to-another-in-qt
      but not worked (maybe because I removed this code from main.cpp : "second.show(); " -> just this change ).
      How can I do that?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @MhM93

      Probably it is better for you to start with an implementation and post about more specific issues when you are running into trouble.

      There are examples around for interaction between different widgets (e.g. Slider example). That may give you a good start.

      Certainly there is also the option to use the example from stackoverflow. However, you need to check if it does already something close to your goals. For issues popping up with your changed code, You should post here the relevant sections.
      That will probably give you better chances for an answer you can use.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • yuvaramY Offline
        yuvaramY Offline
        yuvaram
        wrote on last edited by
        #3

        Hi,
        Here are some examples of signal and slots connected in different forms.
        It may help you.
        (http://doc.qt.io/qt-5/signalsandslots.html)

        Yuvaram Aligeti
        Embedded Qt Developer
        : )

        1 Reply Last reply
        0
        • MhM93M Offline
          MhM93M Offline
          MhM93
          wrote on last edited by
          #4

          It solved. I have a silly mistake. I call slot when my form is null and does not create.
          In that example in stackoverflow both form create and they connect the signal and slot . but my second form is null.

          H.Ghassami

          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