Results 1 to 5 of 5

Thread: QObject::connect: No such slot

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QObject::connect: No such slot

    For future users I can give one advice - don't connect no arguments signals with no argument slots. It was my main problem in this example.
    This is not good advice at all. It is always appropriate to connect a signal with no arguments to a slot with no arguments. In fact, it is the only way such a signal can be connected. QPushButton::clicked() and QAction::triggered() are two very, very common cases of such signals*, and connecting them to no-argument slots is the only way to handle those signals.

    I think you still have a basic misunderstanding of signals and slots, otherwise you would not make such a statement.

    *Edit: QAbstractButton::clicked() and QAction::triggered() are actually overloaded methods - they come in two forms, one with a bool "checked" argument and another with the bool argument defaulted to false. The signals are usually connected to no-argument slots, which means the bool argument is ignored.
    Last edited by d_stranz; 21st April 2021 at 16:29.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 6
    Last Post: 11th January 2021, 00:17
  2. Replies: 0
    Last Post: 9th January 2021, 13:07
  3. Problem with the Slot in QObject::connect(...)
    By d'Matthias in forum Qt Programming
    Replies: 14
    Last Post: 4th June 2011, 07:46
  4. QObject::connect: No such slot !?!
    By Mystical Groovy in forum Qt Programming
    Replies: 3
    Last Post: 18th September 2008, 18:31
  5. Replies: 2
    Last Post: 24th March 2008, 16:59

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.