Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Q_PROPERTY error when updated to qt 5.12 and QtCreator 4.7.2



  • Hi,
    i had this Q_Property

    Q_PROPERTY(QMap<QString,long long unsigned int> sftpFilesList READ  sftpFilesList WRITE setSftpFilesList NOTIFY sftpFilesListChanged)
    

    and this in my main to make it work

     qRegisterMetaType<QMap<QString,long long unsigned int>>("QMap<QString,long long unsigned int>");
    

    this was ok with Qt5.11 and qt creator 4.5.2

    after i updated to qt 5.12 and QtCreator 4.7.2 project still compil and run but
    i have this errors in the ide :

    Lexical or  Preprocessor Issue
    To many arguments provided to function-like macro invocation
    

    Ho to fiw this please ?


  • Moderators

    hi @LeLev

    if you replace

    Q_PROPERTY(QMap<QString,long long unsigned int> sftpFilesList READ  sftpFilesList WRITE setSftpFilesList NOTIFY sftpFilesListChanged)
    

    with

    Q_PROPERTY(QMap sftpFilesList READ  sftpFilesList WRITE setSftpFilesList NOTIFY sftpFilesListChanged)
    

    it should work, I think :-)

    It's a guess on my part, but the docu supports me

    http://doc.qt.io/archives/qt-4.8/properties.html#requirements-for-declaring-properties
    0_1543571035531_c13b95f6-91c5-45d4-b1a0-81614da37f4c-image.png



  • Thank you @J-Hilk


Log in to reply