Qt6 topics merged with General

Replace an Object name with a String???

  • Hello,

    I have a function with one integer parameter.

    If it gets a 1: -> auto1 (String auto + parameter 1)
    if it gets a 2: -> auto2 (String auto + parameter 2)

    and i want to replace following object in this line with this string, to make this function dynamic

    @std::string s1 = this->auto1->getname();@

    In this exmple auto1 is the object-name.

    Can i replace it with my string?

Log in to reply