Results 1 to 6 of 6

Thread: No such signal when porting from Qt4.8 to Qt5.5

  1. #1
    Join Date
    Oct 2016
    Posts
    5
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default No such signal when porting from Qt4.8 to Qt5.5

    Hello,

    We are currently trying to port an application from Qt4.8 to Qt5.5, and we are having issues with signals connections at runtime.

    We are using the old syntax for signals and slots, which is still supported, and we obtain messages like "no such signal" at runtime under Qt5.5 whereas the execution worked well under Qt4.8.

    Does someone have a hint on the matter ?

    Best regards,

    Anthony

  2. #2
    Join Date
    Mar 2014
    Posts
    23
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: No such signal when porting from Qt4.8 to Qt5.5

    Can you provide an example of an action that is affected by this issue?

  3. #3
    Join Date
    Oct 2016
    Posts
    5
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: No such signal when porting from Qt4.8 to Qt5.5

    Of course. For example, we have the following connect :

    Qt Code:
    1. connect(_vuePalette, SIGNAL(paletteModifiee(Pointeur<LUT>, Pointeur<Fonction>, TypeValeurVue, bool)), this, SLOT(paletteModifiee_SLOT(Pointeur<LUT>, Pointeur<Fonction>, TypeValeurVue, bool)));
    To copy to clipboard, switch view to plain text mode 

    The message generated at runtime is :
    QObject::connect: No such signal VuePalette::paletteModifiee(Pointeur<LUT>, Pointeur<Fonction>, TypeValeurVue, bool) in vueimage.cpp:83
    (sender name: 'VuePalette')
    _vuePalette refers to a class "VuePalette" wich is derived from QWidget and which contains the Q_OBJECT macro, and this refers to a class named "VueImage" which is derived from multiple classes derived from QObject, and "VueImage" contains the Q_OBJECT macro too.

    The signal and the slot are respectively defined in the "signals" section of class "VuePalette" and in the "public slots" section of class "VueImage".

    Thanks for your help.

  4. #4
    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: No such signal when porting from Qt4.8 to Qt5.5

    VuePalette:: paletteModifiee
    And are you certain that your VuePalette class speaks French? Or should the signal be this?

    VuePalette:: paletteModified
    Otherwise, if the spellings are correct for the name of the signal and types of all the arguments (and you have the correct number of arguments), I do not see anything wrong with the code you have posted. This same code is valid for both Qt4 and Qt5.

    By the way, changing to Qt5 connect syntax would give you a compile-time error which would let you fix the error without the need to run the program and examine the debug output.
    <=== 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.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: No such signal when porting from Qt4.8 to Qt5.5

    Are you certain that the VuePalette header file is listed in HEADERS and that qmake has run moc over it?

  6. #6
    Join Date
    Oct 2016
    Posts
    5
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: No such signal when porting from Qt4.8 to Qt5.5

    Thanks for your replies.

    I believe I've found what the problem is : in the "connect" statement, "Pointeur" is a QSharedPointer, so "LUT" and "Fonction" classes need to inherit from QObject and to contain the Q_OBJECT macro.

    Sorry, I didn't find it before, but if it can help someone it would be worth it .

Similar Threads

  1. Porting from C# to Qt4
    By Sölve in forum Newbie
    Replies: 4
    Last Post: 15th May 2011, 12:02
  2. Porting qt app from 32 bit to 64 bit
    By AmolShinde_8 in forum Qt Programming
    Replies: 1
    Last Post: 25th October 2010, 08:03
  3. Need some help porting from Qt3 to Qt4
    By psadhukhan in forum Qt Programming
    Replies: 3
    Last Post: 27th November 2008, 11:02
  4. Porting from Qt3 to Qt4
    By vermarajeev in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2007, 06:27
  5. Porting QT3 or 4
    By antonyang in forum Newbie
    Replies: 1
    Last Post: 3rd October 2006, 17:57

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.