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. why? it shows me these warnings when I generate the slots for my controls.
Forum Updated to NodeBB v4.3 + New Features

why? it shows me these warnings when I generate the slots for my controls.

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

    Hello friends, I have the following problem in my code, it happens that when I generate the slots corresponding to some widgets, I always get these warnings, and I have no idea why it is, I would appreciate any suggestion of how I could solve it, and if in the future this may blow up in my face, thanks in advance.

    270d8ba2-8072-48fe-b699-58c26c5305a8-image.png

    Solitary wolf

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      These slots are named to take advantage of automatic connections between signals and slots implemented by QMetaObject::connectSlotsByName() and most often used in Qt Designer UIs. This mechanism is not inherently evil. However, if you rename the object in the Designer UI and not the matching slot then the automatic connection will not happen (silently). Conversely (and less likely), if you name a function on_blah_triggered() for a reason unrelated to the UI, but where blah exists and has a triggered() signal, you may find an unexpected connection is made (silently). You will find these at run time. This fragility is the reason for the warning.

      The alternative is to avoid the automatic connection naming and explicitly code connections in your constructor. If you use new-style connect() then this will fail at compile time in the first case, and the connection will not be present in the second.

      1 Reply Last reply
      3

      • Login

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