[SOLVED] QMap as a parameter



  • how do i pass a qmap variable? i get an error --- error: ‘QMap’ is not a type

    @
    window::window()
    {
    QMap<QString, QString> data;
    window::callFunc(data);
    }

    window::callFunc(QMap data) // i get the error in this line
    {
    // process QMap here
    }
    @

    or there is another way to pass an array that needs keys & values (data['string'] = 'string')

    thanx..



  • my bad...

    @
    window::callFunc(QMap<QString, QString> data) {

    }
    @

    im so stupid...



  • Even Qmap and QString are implicit shared pass it by const reference:

    @window::callFunc(const QMap<QString, QString> &data) {

    }@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.