Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Need help with slots and signals

    General and Desktop
    2
    4
    512
    Loading More Posts
    • 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.
    • T
      trebeter last edited by

      Hello. I need some help with signal and slots
      i have
      file1.cpp
      file1.h
      file2.cpp
      file2.h

      In file1 i have tableViev and i load data from database
      In file2 i have label
      When I double click tableViev. I have variable id_user where I write rows where i clicked
      now i want connect file1 tableViev -> file2 label
      when i clicked file1 tableViev i want change file2 label to id_user
      Someone can say me how i shoud do this?

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Do you mean when you select a line ?

        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 Reply Quote 0
        • T
          trebeter last edited by

          Do you mean when you select a line ?

          yes

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Then have a look at the activated signal. You can create a custom slot in your class that extract id_user and emit another signal with a QString parameter that you'll connect your QLabel setText slot

            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 Reply Quote 0
            • First post
              Last post