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. Need help with slots and signals
Qt 6.11 is out! See what's new in the release blog

Need help with slots and signals

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 760 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.
  • T Offline
    T Offline
    trebeter
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • T Offline
        T Offline
        trebeter
        wrote on last edited by
        #3

        Do you mean when you select a line ?

        yes

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

          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
          0

          • Login

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