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

Command Pattern



  • Hello! I want to use QVariant for dynamic type identification.
    void hello(int a)
    {

    }
    std::function<void(int)> variant = hello; //It's ok
    std::function<QVariant(QVariant)> newVariant = hello; //error.
    How can I use QVariant for this?
    i.e.
    typedef std::function<QVariant(QVariant)> Function;


Log in to reply