Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Rid QtWidget signals inside QObject
Qt 6.12 LTS is out! See what's new in the release blog

Rid QtWidget signals inside QObject

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 324 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.
  • O Offline
    O Offline
    Omicron91
    wrote on last edited by
    #1

    Hello guys,

    I have a tab based software, for each tab I wrote a class to separate the code and control each module. I used findChild method to get access to the widgets inside of the related tab. My problem is trying to delete the instance of a specific tab and disconnect all signals of the widgets inside of a QObject on the destruct method instead of selecting a widget one by one and disconnecting their signals.

    Thanks in advance!

    J.HilkJ 1 Reply Last reply
    0
    • O Omicron91

      Hello guys,

      I have a tab based software, for each tab I wrote a class to separate the code and control each module. I used findChild method to get access to the widgets inside of the related tab. My problem is trying to delete the instance of a specific tab and disconnect all signals of the widgets inside of a QObject on the destruct method instead of selecting a widget one by one and disconnecting their signals.

      Thanks in advance!

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by J.Hilk
      #2

      @Omicron91 said in Rid QtWidget signals inside QObject:

      I have a tab based software, for each tab I wrote a class to separate the code and control each module. I used findChild method to get access to the widgets inside of the related tab.

      SchockedMeme.png

      why bother with encapsulation at all when you do this ?

      My problem is trying to delete the instance of a specific tab and disconnect all signals of the widgets inside of a QObject on the destruct method instead of selecting a widget one by one and disconnecting their signals.

      when done properly, connects will "disconnect" as soon as one of the object instances gets destroyed, there should be no need for manual disconnect calls.


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      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
      • Unsolved